Sha256: da6eaf352e5f8be51bf17b63deb684399f79e3ba262a427e10d9d7062fd50520

Contents?: true

Size: 728 Bytes

Versions: 5

Compression:

Stored size: 728 Bytes

Contents

class DeviseCreate<%= table_name.camelize %> < ActiveRecord::Migration
  def self.up
    create_table(:<%= table_name %>) do |t|
      t.string :email, :null => :false
      t.string :omniauth_uid, :null => false

      # t.rememberable
      # t.trackable
      # t.confirmable
      # t.token_authenticatable

<% for attribute in attributes -%>
      t.<%= attribute.type %> :<%= attribute.name %>
<% end -%>

      t.timestamps
    end

    add_index :<%= table_name %>, :email,                :unique => true
    add_index :<%= table_name %>, :omniauth_uid,         :unique => true
    # add_index :<%= table_name %>, :authentication_token, :unique => true
  end

  def self.down
    drop_table :<%= table_name %>
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
google_authentication-0.3.0 lib/generators/templates/migration.rb
google_authentication-0.2.0 lib/generators/templates/migration.rb
google_authentication-0.1.2 lib/generators/templates/migration.rb
google_authentication-0.1.1 lib/generators/templates/migration.rb
google_authentication-0.1.0 lib/generators/templates/migration.rb