Add unique index on parks#code

This commit is contained in:
2025-10-07 23:45:25 -07:00
parent ac8338ee90
commit b9c2683d13
2 changed files with 3 additions and 0 deletions

View File

@@ -8,5 +8,7 @@ class CreateParks < ActiveRecord::Migration[8.0]
t.timestamps
end
add_index :parks, :code, unique: true
end
end

1
db/schema.rb generated
View File

@@ -18,5 +18,6 @@ ActiveRecord::Schema[8.0].define(version: 2025_10_08_044109) do
t.json "properties", default: {}, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["code"], name: "index_parks_on_code", unique: true
end
end