diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-03-30 18:43:45 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-03-30 18:43:45 +0300 |
commit | 7c36e8561c60882e6b0b47c563f7d19f3d6b02a6 (patch) | |
tree | 2c833fc39f5a86717ddedf1e5e47cf247daf0f9a /db | |
parent | 4e8bde967e9beb2d2749bd9d2358adeb895ae2dc (diff) | |
parent | b5987e62ea609b2bb55ab762d074a1fd2642d325 (diff) |
Merge branch '41967_issue_api_closed_by_info' into 'master'
Add closed by information to issue API
See merge request gitlab-org/gitlab-ce!17042
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20180209165249_add_closed_by_to_issues.rb | 20 | ||||
-rw-r--r-- | db/schema.rb | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/db/migrate/20180209165249_add_closed_by_to_issues.rb b/db/migrate/20180209165249_add_closed_by_to_issues.rb new file mode 100644 index 00000000000..e251afd7b49 --- /dev/null +++ b/db/migrate/20180209165249_add_closed_by_to_issues.rb @@ -0,0 +1,20 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddClosedByToIssues < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + disable_ddl_transaction! + # Set this constant to true if this migration requires downtime. + DOWNTIME = false + + def up + add_column :issues, :closed_by_id, :integer + add_concurrent_foreign_key :issues, :users, column: :closed_by_id, on_delete: :nullify + end + + def down + remove_foreign_key :issues, column: :closed_by_id + remove_column :issues, :closed_by_id + end +end diff --git a/db/schema.rb b/db/schema.rb index 9aaefcf1c8d..06fc1a9d7e9 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -932,6 +932,7 @@ ActiveRecord::Schema.define(version: 20180327101207) do t.integer "last_edited_by_id" t.boolean "discussion_locked" t.datetime_with_timezone "closed_at" + t.integer "closed_by_id" end add_index "issues", ["author_id"], name: "index_issues_on_author_id", using: :btree @@ -2095,6 +2096,7 @@ ActiveRecord::Schema.define(version: 20180327101207) do add_foreign_key "issues", "milestones", name: "fk_96b1dd429c", on_delete: :nullify add_foreign_key "issues", "projects", name: "fk_899c8f3231", on_delete: :cascade add_foreign_key "issues", "users", column: "author_id", name: "fk_05f1e72feb", on_delete: :nullify + add_foreign_key "issues", "users", column: "closed_by_id", name: "fk_c63cbf6c25", on_delete: :nullify add_foreign_key "issues", "users", column: "updated_by_id", name: "fk_ffed080f01", on_delete: :nullify add_foreign_key "label_priorities", "labels", on_delete: :cascade add_foreign_key "label_priorities", "projects", on_delete: :cascade |