diff options
author | Alex Kalderimis <alex.kalderimis@gmail.com> | 2019-07-30 22:39:08 -0400 |
---|---|---|
committer | Alex Kalderimis <alex.kalderimis@gmail.com> | 2019-08-12 20:50:09 +0100 |
commit | 2502125e823601cd6c515c00a245f9b0625fd531 (patch) | |
tree | 8b80699867fc817de50a4459847d4c3c66b43a11 | |
parent | 22f3142b83fb08589eb1212cc378996975b2157f (diff) | |
download | gitlab-ce-ajk-add-version-author.tar.gz |
Add author column to design versionsajk-add-version-author
this will be used to simplify version handling, and enable richer
interaction with versions.
-rw-r--r-- | db/migrate/20190731003533_add_author_to_design_management_versions.rb | 18 | ||||
-rw-r--r-- | db/schema.rb | 3 |
2 files changed, 21 insertions, 0 deletions
diff --git a/db/migrate/20190731003533_add_author_to_design_management_versions.rb b/db/migrate/20190731003533_add_author_to_design_management_versions.rb new file mode 100644 index 00000000000..d8b95ca654a --- /dev/null +++ b/db/migrate/20190731003533_add_author_to_design_management_versions.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddAuthorToDesignManagementVersions < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + disable_ddl_transaction! + + # Set this constant to true if this migration requires downtime. + DOWNTIME = false + + def change + add_reference :design_management_versions, :author, index: true + add_concurrent_foreign_key :design_management_versions, :users, column: :author_id + end +end diff --git a/db/schema.rb b/db/schema.rb index 591758af0e4..876f43fd5a0 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1130,6 +1130,8 @@ ActiveRecord::Schema.define(version: 2019_08_06_071559) do create_table "design_management_versions", force: :cascade do |t| t.binary "sha", null: false t.bigint "issue_id" + t.bigint "author_id" + t.index ["author_id"], name: "index_design_management_versions_on_author_id" t.index ["issue_id"], name: "index_design_management_versions_on_issue_id" t.index ["sha", "issue_id"], name: "index_design_management_versions_on_sha_and_issue_id", unique: true end @@ -3737,6 +3739,7 @@ ActiveRecord::Schema.define(version: 2019_08_06_071559) do add_foreign_key "design_management_designs_versions", "design_management_designs", column: "design_id", name: "fk_03c671965c", on_delete: :cascade add_foreign_key "design_management_designs_versions", "design_management_versions", column: "version_id", name: "fk_f4d25ba00c", on_delete: :cascade add_foreign_key "design_management_versions", "issues", on_delete: :cascade + add_foreign_key "design_management_versions", "users", column: "author_id", name: "fk_c1440b4896", on_delete: :cascade add_foreign_key "draft_notes", "merge_requests", on_delete: :cascade add_foreign_key "draft_notes", "users", column: "author_id", on_delete: :cascade add_foreign_key "elasticsearch_indexed_namespaces", "namespaces", on_delete: :cascade |