diff options
author | Markus Koller <markus-koller@gmx.ch> | 2017-09-18 15:03:24 +0200 |
---|---|---|
committer | Markus Koller <markus.koller.ext@siemens.com> | 2017-11-06 10:51:46 +0100 |
commit | 6902848a9c54f9eb1bfd82fe173ad0d5d62fe2d5 (patch) | |
tree | 9a28f3a4e52c7e6108a7f0358f813a375eec90a2 /db | |
parent | 823a9d351b49a6be8c12cfe06edb4aa6ec08fe95 (diff) | |
download | gitlab-ce-6902848a9c54f9eb1bfd82fe173ad0d5d62fe2d5.tar.gz |
Support custom attributes on projects
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20170918111708_create_project_custom_attributes.rb | 15 | ||||
-rw-r--r-- | db/schema.rb | 12 |
2 files changed, 27 insertions, 0 deletions
diff --git a/db/migrate/20170918111708_create_project_custom_attributes.rb b/db/migrate/20170918111708_create_project_custom_attributes.rb new file mode 100644 index 00000000000..b5bc90ec02e --- /dev/null +++ b/db/migrate/20170918111708_create_project_custom_attributes.rb @@ -0,0 +1,15 @@ +class CreateProjectCustomAttributes < ActiveRecord::Migration + DOWNTIME = false + + def change + create_table :project_custom_attributes do |t| + t.timestamps_with_timezone null: false + t.references :project, null: false, foreign_key: { on_delete: :cascade } + t.string :key, null: false + t.string :value, null: false + + t.index [:project_id, :key], unique: true + t.index [:key, :value] + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 80d8ff92d6e..76fc92e2282 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1214,6 +1214,17 @@ ActiveRecord::Schema.define(version: 20171026082505) do add_index "project_auto_devops", ["project_id"], name: "index_project_auto_devops_on_project_id", unique: true, using: :btree + create_table "project_custom_attributes", force: :cascade do |t| + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "project_id", null: false + t.string "key", null: false + t.string "value", null: false + end + + add_index "project_custom_attributes", ["key", "value"], name: "index_project_custom_attributes_on_key_and_value", using: :btree + add_index "project_custom_attributes", ["project_id", "key"], name: "index_project_custom_attributes_on_project_id_and_key", unique: true, using: :btree + create_table "project_features", force: :cascade do |t| t.integer "project_id" t.integer "merge_requests_access_level" @@ -1859,6 +1870,7 @@ ActiveRecord::Schema.define(version: 20171026082505) do add_foreign_key "project_authorizations", "projects", on_delete: :cascade add_foreign_key "project_authorizations", "users", on_delete: :cascade add_foreign_key "project_auto_devops", "projects", on_delete: :cascade + add_foreign_key "project_custom_attributes", "projects", on_delete: :cascade add_foreign_key "project_features", "projects", name: "fk_18513d9b92", on_delete: :cascade add_foreign_key "project_group_links", "projects", name: "fk_daa8cee94c", on_delete: :cascade add_foreign_key "project_import_data", "projects", name: "fk_ffb9ee3a10", on_delete: :cascade |