Commit b5fce1d5 authored by James Edwards-Jones's avatar James Edwards-Jones

Removed unnecessary table ‘protected_tag_merge_access_levels’

Fixed timestamps on protected_tags
parent 18b445ad
...@@ -4,36 +4,25 @@ class CreateProtectedTags < ActiveRecord::Migration ...@@ -4,36 +4,25 @@ class CreateProtectedTags < ActiveRecord::Migration
# Set this constant to true if this migration requires downtime. # Set this constant to true if this migration requires downtime.
DOWNTIME = false DOWNTIME = false
GitlabAccessMaster = 40 GITLAB_ACCESS_MASTER = 40
def change def change
create_table :protected_tags do |t| create_table :protected_tags do |t|
t.integer :project_id, null: false t.integer :project_id, null: false
t.string :name, null: false t.string :name, null: false
t.string :timestamps #TODO: `null: false`? Missing from protected_branches t.timestamps null: false
end end
add_index :protected_tags, :project_id 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| 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.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 :access_level, default: GITLAB_ACCESS_MASTER, null: true
t.integer :group_id t.references :user, foreign_key: true, index: true
t.integer :user_id t.integer :group_id#TODO: Should this have an index? Doesn't appear in brances #, index: true
t.timestamps null: false t.timestamps null: false
end end
#TODO: These had rubocop set to disable Migration/AddConcurrentForeignKey add_foreign_key :protected_tag_push_access_levels, :namespaces, column: :group_id # rubocop: 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
end end
end end
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170317203554) do ActiveRecord::Schema.define(version: 20170315194013) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
...@@ -963,28 +963,23 @@ ActiveRecord::Schema.define(version: 20170317203554) do ...@@ -963,28 +963,23 @@ ActiveRecord::Schema.define(version: 20170317203554) do
add_index "protected_branches", ["project_id"], name: "index_protected_branches_on_project_id", using: :btree add_index "protected_branches", ["project_id"], name: "index_protected_branches_on_project_id", using: :btree
create_table "protected_tag_merge_access_levels", force: :cascade do |t|
t.integer "protected_tag_id", null: false
t.integer "access_level", default: 40, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
add_index "protected_tag_merge_access_levels", ["protected_tag_id"], name: "index_protected_tag_merge_access", using: :btree
create_table "protected_tag_push_access_levels", force: :cascade do |t| create_table "protected_tag_push_access_levels", force: :cascade do |t|
t.integer "protected_tag_id", null: false t.integer "protected_tag_id", null: false
t.integer "access_level", default: 40, null: false t.integer "access_level", default: 40
t.integer "user_id"
t.integer "group_id"
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
end end
add_index "protected_tag_push_access_levels", ["protected_tag_id"], name: "index_protected_tag_push_access", using: :btree add_index "protected_tag_push_access_levels", ["protected_tag_id"], name: "index_protected_tag_push_access", using: :btree
add_index "protected_tag_push_access_levels", ["user_id"], name: "index_protected_tag_push_access_levels_on_user_id", using: :btree
create_table "protected_tags", force: :cascade do |t| create_table "protected_tags", force: :cascade do |t|
t.integer "project_id", null: false t.integer "project_id", null: false
t.string "name", null: false t.string "name", null: false
t.string "timestamps" t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end end
add_index "protected_tags", ["project_id"], name: "index_protected_tags_on_project_id", using: :btree add_index "protected_tags", ["project_id"], name: "index_protected_tags_on_project_id", using: :btree
...@@ -1331,8 +1326,9 @@ ActiveRecord::Schema.define(version: 20170317203554) do ...@@ -1331,8 +1326,9 @@ ActiveRecord::Schema.define(version: 20170317203554) do
add_foreign_key "project_statistics", "projects", on_delete: :cascade add_foreign_key "project_statistics", "projects", on_delete: :cascade
add_foreign_key "protected_branch_merge_access_levels", "protected_branches" add_foreign_key "protected_branch_merge_access_levels", "protected_branches"
add_foreign_key "protected_branch_push_access_levels", "protected_branches" add_foreign_key "protected_branch_push_access_levels", "protected_branches"
add_foreign_key "protected_tag_merge_access_levels", "protected_tags" add_foreign_key "protected_tag_push_access_levels", "namespaces", column: "group_id"
add_foreign_key "protected_tag_push_access_levels", "protected_tags" add_foreign_key "protected_tag_push_access_levels", "protected_tags"
add_foreign_key "protected_tag_push_access_levels", "users"
add_foreign_key "subscriptions", "projects", on_delete: :cascade add_foreign_key "subscriptions", "projects", on_delete: :cascade
add_foreign_key "timelogs", "issues", name: "fk_timelogs_issues_issue_id", on_delete: :cascade add_foreign_key "timelogs", "issues", name: "fk_timelogs_issues_issue_id", on_delete: :cascade
add_foreign_key "timelogs", "merge_requests", name: "fk_timelogs_merge_requests_merge_request_id", on_delete: :cascade add_foreign_key "timelogs", "merge_requests", name: "fk_timelogs_merge_requests_merge_request_id", on_delete: :cascade
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment