Commit 72b7d239 by nnnghia98

add index to tables

parent 5bcdfe93
Pipeline #242 canceled with stages
in 0 seconds
......@@ -6,7 +6,7 @@ class CreateUsers < ActiveRecord::Migration[6.0]
## Database authenticatable
t.string :email, null: false, default: ""
t.string :username
t.string :username, unique: true
t.string :encrypted_password, null: false, default: ""
## Recoverable
......
......@@ -8,5 +8,7 @@ class CreateCompanies < ActiveRecord::Migration[6.0]
t.timestamps
end
add_index :companies, :email, unique: true
end
end
......@@ -6,5 +6,7 @@ class CreateCities < ActiveRecord::Migration[6.0]
t.timestamps
end
add_index :cities, :name, unique: true
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment