add unique index for emails in clients
This commit is contained in:
5
db/migrate/20250721145904_add_index_to_clients.rb
Normal file
5
db/migrate/20250721145904_add_index_to_clients.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddIndexToClients < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_index :clients, :email, unique: true
|
||||
end
|
||||
end
|
||||
3
db/schema.rb
generated
3
db/schema.rb
generated
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_07_21_140802) do
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_07_21_145904) do
|
||||
create_table "clients", force: :cascade do |t|
|
||||
t.string "company_name"
|
||||
t.string "firstname"
|
||||
@@ -23,6 +23,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_07_21_140802) do
|
||||
t.string "phone"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["email"], name: "index_clients_on_email", unique: true
|
||||
end
|
||||
|
||||
create_table "projects", force: :cascade do |t|
|
||||
|
||||
Reference in New Issue
Block a user