From 6f6537b1f3f730e46341d65527a3562918803096 Mon Sep 17 00:00:00 2001 From: hellekin Date: Tue, 6 Oct 2020 17:13:39 +0200 Subject: Fix resources migration t.references already creates an index, so the second index actually broke things. You may need to rebuild the database! --- db/migrate/20201006140511_create_resources.rb | 1 - db/schema.rb | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'db') 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 -- cgit v1.2.3