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] ...@@ -6,7 +6,7 @@ class CreateUsers < ActiveRecord::Migration[6.0]
## Database authenticatable ## Database authenticatable
t.string :email, null: false, default: "" t.string :email, null: false, default: ""
t.string :username t.string :username, unique: true
t.string :encrypted_password, null: false, default: "" t.string :encrypted_password, null: false, default: ""
## Recoverable ## Recoverable
......
...@@ -8,5 +8,7 @@ class CreateCompanies < ActiveRecord::Migration[6.0] ...@@ -8,5 +8,7 @@ class CreateCompanies < ActiveRecord::Migration[6.0]
t.timestamps t.timestamps
end end
add_index :companies, :email, unique: true
end end
end end
...@@ -6,5 +6,7 @@ class CreateCities < ActiveRecord::Migration[6.0] ...@@ -6,5 +6,7 @@ class CreateCities < ActiveRecord::Migration[6.0]
t.timestamps t.timestamps
end end
add_index :cities, :name, unique: true
end end
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