diff options
| author | Xinhui | 2017-08-17 15:47:55 +0200 |
|---|---|---|
| committer | Xinhui | 2017-08-17 16:03:13 +0200 |
| commit | 24862b2b1baa94c80fd7206bfe2244019604dbf5 (patch) | |
| tree | 5f6905f8b76287f061f7ba98258d0ad43fa11bf9 /db | |
| parent | 27d0fc5da357c6ba7b7b3288399c7934c30265f2 (diff) | |
| download | chouette-core-24862b2b1baa94c80fd7206bfe2244019604dbf5.tar.bz2 | |
Model ApiKey add belongs_to organisation
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrate/20170817122914_add_organisation_to_api_keys.rb | 5 | ||||
| -rw-r--r-- | db/schema.rb | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/db/migrate/20170817122914_add_organisation_to_api_keys.rb b/db/migrate/20170817122914_add_organisation_to_api_keys.rb new file mode 100644 index 000000000..14c742c87 --- /dev/null +++ b/db/migrate/20170817122914_add_organisation_to_api_keys.rb @@ -0,0 +1,5 @@ +class AddOrganisationToApiKeys < ActiveRecord::Migration + def change + add_reference :api_keys, :organisation, index: true, foreign_key: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 8816bab2f..e9344e56c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20170816104020) do +ActiveRecord::Schema.define(version: 20170817122914) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -72,13 +72,16 @@ ActiveRecord::Schema.define(version: 20170816104020) do add_index "access_points", ["objectid"], name: "access_points_objectid_key", unique: true, using: :btree create_table "api_keys", id: :bigserial, force: :cascade do |t| - t.integer "referential_id", limit: 8 + t.integer "referential_id", limit: 8 t.string "token" t.string "name" t.datetime "created_at" t.datetime "updated_at" + t.integer "organisation_id" end + add_index "api_keys", ["organisation_id"], name: "index_api_keys_on_organisation_id", using: :btree + create_table "calendars", id: :bigserial, force: :cascade do |t| t.string "name" t.string "short_name" @@ -854,6 +857,7 @@ ActiveRecord::Schema.define(version: 20170816104020) do add_index "workbenches", ["stop_area_referential_id"], name: "index_workbenches_on_stop_area_referential_id", using: :btree add_foreign_key "access_links", "access_points", name: "aclk_acpt_fkey" + add_foreign_key "api_keys", "organisations" add_foreign_key "group_of_lines_lines", "group_of_lines", name: "groupofline_group_fkey", on_delete: :cascade add_foreign_key "journey_frequencies", "timebands", on_delete: :nullify add_foreign_key "journey_frequencies", "vehicle_journeys", on_delete: :nullify |
