diff options
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 |