1
0
Fork 0

Improve migrations

This commit is contained in:
Alex Kotov 2019-07-20 05:49:59 +05:00
parent aa5f81b095
commit 5f347fc2f5
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08

View file

@ -5,9 +5,7 @@ class DeviseCreateUsers < ActiveRecord::Migration[5.2]
create_table :country_states do |t| create_table :country_states do |t|
t.timestamps null: false t.timestamps null: false
t.string :name, null: false t.string :name, null: false, index: { unique: true }
t.index :name, unique: true
end end
create_table :regional_offices do |t| create_table :regional_offices do |t|
@ -23,11 +21,9 @@ class DeviseCreateUsers < ActiveRecord::Migration[5.2]
create_table :accounts do |t| create_table :accounts do |t|
t.timestamps null: false t.timestamps null: false
t.string :guest_token, null: false t.string :guest_token, null: false, index: { unique: true }
t.references :person, index: { unique: true } t.references :person, index: { unique: true }
t.index :guest_token, unique: true
end end
create_table :users do |t| create_table :users do |t|