Class: CreateSecondstepTables

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/second_step/migration/templates/migration.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/generators/second_step/migration/templates/migration.rb', line 2

def change
  create_table :second_step_application_users do |t|
    t.string     :phone
    t.string     :uuid
    t.references :user, polymorphic: true, index: true
    t.timestamps
  end

  add_index :second_step_application_users, [:uuid, :phone], unique: true

  create_table :second_step_application_user_links do |t|
    t.string     :secret
    t.string     :uuid
    t.references :second_step_application_users, index: true, forgein_key: true
    t.timestamps
  end
end