diff options
author | hellekin <hellekin@cepheide.org> | 2020-10-06 17:13:39 +0200 |
---|---|---|
committer | hellekin <hellekin@cepheide.org> | 2020-10-06 17:13:39 +0200 |
commit | 6f6537b1f3f730e46341d65527a3562918803096 (patch) | |
tree | dafe7b3e2557ae48cf71b1a50091548489d2a326 /db | |
parent | a53257eca445c30ad6d65ad2f0b00c599f9052ac (diff) | |
download | incommon-map-6f6537b1f3f730e46341d65527a3562918803096.tar.gz |
Fix resources migration
t.references already creates an index, so the second index
actually broke things.
You may need to rebuild the database!
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20201006140511_create_resources.rb | 1 | ||||
-rw-r--r-- | db/schema.rb | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/db/migrate/20201006140511_create_resources.rb b/db/migrate/20201006140511_create_resources.rb index 761d5bc..c179087 100644 --- a/db/migrate/20201006140511_create_resources.rb +++ b/db/migrate/20201006140511_create_resources.rb @@ -8,6 +8,5 @@ class CreateResources < ActiveRecord::Migration[6.0] t.timestamps end add_index :resources, [:uuid], unique: true - add_index :resources, [:agent_id] end end diff --git a/db/schema.rb b/db/schema.rb index 8433cd9..fbd0924 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -31,14 +31,17 @@ ActiveRecord::Schema.define(version: 2020_10_06_140511) do t.uuid "uuid" t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false + t.index ["name"], name: "index_agents_on_name", unique: true t.index ["uuid"], name: "index_agents_on_uuid", unique: true end create_table "resources", force: :cascade do |t| t.uuid "uuid" t.jsonb "feature" + t.bigint "agent_id", null: false t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false + t.index ["agent_id"], name: "index_resources_on_agent_id" t.index ["uuid"], name: "index_resources_on_uuid", unique: true end @@ -56,4 +59,5 @@ ActiveRecord::Schema.define(version: 2020_10_06_140511) do add_foreign_key "agencies", "agents" add_foreign_key "agencies", "users" + add_foreign_key "resources", "agents" end |