diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-03-31 17:56:26 +0100 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-03-31 19:37:17 +0100 |
commit | b5fce1d5ac87546e8f31fb0ef6f6c4d514670198 (patch) | |
tree | acc3a2ec699bcdc6ebab3c9a82f1816916643658 /db/migrate | |
parent | 18b445ade4280c03e73ccbf2ca4d175e97a887c8 (diff) | |
download | gitlab-ce-b5fce1d5ac87546e8f31fb0ef6f6c4d514670198.tar.gz |
Removed unnecessary table ‘protected_tag_merge_access_levels’
Fixed timestamps on protected_tags
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20170309173138_create_protected_tags.rb | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/db/migrate/20170309173138_create_protected_tags.rb b/db/migrate/20170309173138_create_protected_tags.rb index c69ef970410..00794529143 100644 --- a/db/migrate/20170309173138_create_protected_tags.rb +++ b/db/migrate/20170309173138_create_protected_tags.rb @@ -4,36 +4,25 @@ class CreateProtectedTags < ActiveRecord::Migration # Set this constant to true if this migration requires downtime. DOWNTIME = false - GitlabAccessMaster = 40 + GITLAB_ACCESS_MASTER = 40 def change create_table :protected_tags do |t| t.integer :project_id, null: false t.string :name, null: false - t.string :timestamps #TODO: `null: false`? Missing from protected_branches + t.timestamps null: false end add_index :protected_tags, :project_id - create_table :protected_tag_merge_access_levels do |t| - t.references :protected_tag, index: { name: "index_protected_tag_merge_access" }, foreign_key: true, null: false - - t.integer :access_level, default: GitlabAccessMaster, null: true #TODO: was false, check schema - t.integer :group_id #TODO: check why group/user id missing from CE - t.integer :user_id - t.timestamps null: false - end - create_table :protected_tag_push_access_levels do |t| t.references :protected_tag, index: { name: "index_protected_tag_push_access" }, foreign_key: true, null: false - t.integer :access_level, default: GitlabAccessMaster, null: true #TODO: was false, check schema - t.integer :group_id - t.integer :user_id + t.integer :access_level, default: GITLAB_ACCESS_MASTER, null: true + t.references :user, foreign_key: true, index: true + t.integer :group_id#TODO: Should this have an index? Doesn't appear in brances #, index: true t.timestamps null: false end - #TODO: These had rubocop set to disable Migration/AddConcurrentForeignKey - # add_foreign_key :protected_tag_merge_access_levels, :namespaces, column: :group_id - # add_foreign_key :protected_tag_push_access_levels, :namespaces, column: :group_id + add_foreign_key :protected_tag_push_access_levels, :namespaces, column: :group_id # rubocop: disable Migration/AddConcurrentForeignKey end end |