diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20160919144305_add_type_to_labels.rb | 9 | ||||
-rw-r--r-- | db/migrate/20160919145149_add_group_id_to_labels.rb | 13 | ||||
-rw-r--r-- | db/schema.rb | 4 |
3 files changed, 26 insertions, 0 deletions
diff --git a/db/migrate/20160919144305_add_type_to_labels.rb b/db/migrate/20160919144305_add_type_to_labels.rb new file mode 100644 index 00000000000..43aac7846d3 --- /dev/null +++ b/db/migrate/20160919144305_add_type_to_labels.rb @@ -0,0 +1,9 @@ +class AddTypeToLabels < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + add_column :labels, :type, :string + end +end diff --git a/db/migrate/20160919145149_add_group_id_to_labels.rb b/db/migrate/20160919145149_add_group_id_to_labels.rb new file mode 100644 index 00000000000..05e21af0584 --- /dev/null +++ b/db/migrate/20160919145149_add_group_id_to_labels.rb @@ -0,0 +1,13 @@ +class AddGroupIdToLabels < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def change + add_column :labels, :group_id, :integer + add_foreign_key :labels, :namespaces, column: :group_id, on_delete: :cascade + add_concurrent_index :labels, :group_id + end +end diff --git a/db/schema.rb b/db/schema.rb index 5ce855fe08f..37f0be0e834 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -529,8 +529,11 @@ ActiveRecord::Schema.define(version: 20161017095000) do t.string "description" t.integer "priority" t.text "description_html" + t.string "type" + t.integer "group_id" end + add_index "labels", ["group_id"], name: "index_labels_on_group_id", using: :btree add_index "labels", ["priority"], name: "index_labels_on_priority", using: :btree add_index "labels", ["project_id"], name: "index_labels_on_project_id", using: :btree add_index "labels", ["title"], name: "index_labels_on_title", using: :btree @@ -1213,6 +1216,7 @@ ActiveRecord::Schema.define(version: 20161017095000) do add_foreign_key "boards", "projects" add_foreign_key "issue_metrics", "issues", on_delete: :cascade + add_foreign_key "labels", "namespaces", column: "group_id", on_delete: :cascade add_foreign_key "lists", "boards" add_foreign_key "lists", "labels" add_foreign_key "merge_request_metrics", "merge_requests", on_delete: :cascade |