Sha256: c59edde43e5846ba3237dff79fb1dc9f91246975b68aa000ed5467947743382a

Contents?: true

Size: 938 Bytes

Versions: 10

Compression:

Stored size: 938 Bytes

Contents

class AddAuthenticationTo<%= model_name.pluralize.camelize %> < ActiveRecord::Migration
  def self.up
    add_column :<%= model_name.tableize %>, :username,         :string  # for user identification
    add_column :<%= model_name.tableize %>, :password_digest,  :string

    add_column :<%= model_name.tableize %>, :email,            :string  # for forgotten-credentials / activation
    add_column :<%= model_name.tableize %>, :token,            :string  # for forgotten-credentials / activation
    add_column :<%= model_name.tableize %>, :token_created_at, :string  # for forgotten-credentials / activation
  end

  def self.down
    remove_column :<%= model_name.tableize %>, :username
    remove_column :<%= model_name.tableize %>, :password_digest
    remove_column :<%= model_name.tableize %>, :email
    remove_column :<%= model_name.tableize %>, :token
    remove_column :<%= model_name.tableize %>, :token_created_at
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
quo_vadis-1.4.2 lib/generators/quo_vadis/templates/migration.rb.erb
quo_vadis-1.4.1 lib/generators/quo_vadis/templates/migration.rb.erb
quo_vadis-1.4.0 lib/generators/quo_vadis/templates/migration.rb.erb
quo_vadis-1.3.2 lib/generators/quo_vadis/templates/migration.rb.erb
quo_vadis-1.3.1 lib/generators/quo_vadis/templates/migration.rb.erb
quo_vadis-1.3.0 lib/generators/quo_vadis/templates/migration.rb.erb
quo_vadis-1.2.3 lib/generators/quo_vadis/templates/migration.rb.erb
quo_vadis-1.2.2 lib/generators/quo_vadis/templates/migration.rb.erb
quo_vadis-1.2.1 lib/generators/quo_vadis/templates/migration.rb.erb
quo_vadis-1.2.0 lib/generators/quo_vadis/templates/migration.rb.erb