summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2016-08-01 18:34:17 +0300
committerValery Sizov <valery@gitlab.com>2016-08-22 18:43:13 +0300
commit8f9a7ca854ffda26c5ce9aed2aec10bf155d0463 (patch)
tree5dc2ac0b10ac93ac122fa398f137e62d817dcbe4 /db
parentfb84439a92e759ff90811e98f6abf6bdbb3e6d55 (diff)
downloadgitlab-ce-8f9a7ca854ffda26c5ce9aed2aec10bf155d0463.tar.gz
Revert the revert of Optimistic Lockingrevert_revert_issuable_lock
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20160707104333_add_lock_to_issuables.rb18
-rw-r--r--db/schema.rb32
2 files changed, 35 insertions, 15 deletions
diff --git a/db/migrate/20160707104333_add_lock_to_issuables.rb b/db/migrate/20160707104333_add_lock_to_issuables.rb
new file mode 100644
index 00000000000..54866d02cbc
--- /dev/null
+++ b/db/migrate/20160707104333_add_lock_to_issuables.rb
@@ -0,0 +1,18 @@
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class AddLockToIssuables < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def up
+ add_column :issues, :lock_version, :integer
+ add_column :merge_requests, :lock_version, :integer
+ end
+
+ def down
+ remove_column :issues, :lock_version
+ remove_column :merge_requests, :lock_version
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 6cbc766831b..25cfb5de2fa 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -84,8 +84,8 @@ ActiveRecord::Schema.define(version: 20160819221833) do
t.string "health_check_access_token"
t.boolean "send_user_confirmation_email", default: false
t.integer "container_registry_token_expire_delay", default: 5
- t.boolean "user_default_external", default: false, null: false
t.text "after_sign_up_text"
+ t.boolean "user_default_external", default: false, null: false
t.string "repository_storage", default: "default"
t.string "enabled_git_access_protocol"
t.boolean "domain_blacklist_enabled", default: false
@@ -175,8 +175,8 @@ ActiveRecord::Schema.define(version: 20160819221833) do
t.text "artifacts_metadata"
t.integer "erased_by_id"
t.datetime "erased_at"
- t.string "environment"
t.datetime "artifacts_expire_at"
+ t.string "environment"
t.integer "artifacts_size"
t.string "when"
t.text "yaml_variables"
@@ -471,6 +471,7 @@ ActiveRecord::Schema.define(version: 20160819221833) do
t.datetime "deleted_at"
t.date "due_date"
t.integer "moved_to_id"
+ t.integer "lock_version"
end
add_index "issues", ["assignee_id"], name: "index_issues_on_assignee_id", using: :btree
@@ -613,12 +614,13 @@ ActiveRecord::Schema.define(version: 20160819221833) do
t.datetime "locked_at"
t.integer "updated_by_id"
t.string "merge_error"
+ t.text "merge_params"
t.boolean "merge_when_build_succeeds", default: false, null: false
t.integer "merge_user_id"
t.string "merge_commit_sha"
t.datetime "deleted_at"
t.string "in_progress_merge_commit_sha"
- t.text "merge_params"
+ t.integer "lock_version"
end
add_index "merge_requests", ["assignee_id"], name: "index_merge_requests_on_assignee_id", using: :btree
@@ -772,10 +774,10 @@ ActiveRecord::Schema.define(version: 20160819221833) do
t.integer "user_id", null: false
t.string "token", null: false
t.string "name", null: false
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
t.boolean "revoked", default: false
t.datetime "expires_at"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
end
add_index "personal_access_tokens", ["token"], name: "index_personal_access_tokens_on_token", unique: true, using: :btree
@@ -838,8 +840,8 @@ ActiveRecord::Schema.define(version: 20160819221833) do
t.boolean "only_allow_merge_if_build_succeeds", default: false, null: false
t.boolean "has_external_issue_tracker"
t.string "repository_storage", default: "default", null: false
- t.boolean "has_external_wiki"
t.boolean "request_access_enabled", default: true, null: false
+ t.boolean "has_external_wiki"
end
add_index "projects", ["ci_id"], name: "index_projects_on_ci_id", using: :btree
@@ -960,8 +962,8 @@ ActiveRecord::Schema.define(version: 20160819221833) do
t.string "noteable_type"
t.string "title"
t.text "description"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.boolean "submitted_as_ham", default: false, null: false
end
@@ -1032,13 +1034,13 @@ ActiveRecord::Schema.define(version: 20160819221833) do
add_index "u2f_registrations", ["user_id"], name: "index_u2f_registrations_on_user_id", using: :btree
create_table "user_agent_details", force: :cascade do |t|
- t.string "user_agent", null: false
- t.string "ip_address", null: false
- t.integer "subject_id", null: false
- t.string "subject_type", null: false
+ t.string "user_agent", null: false
+ t.string "ip_address", null: false
+ t.integer "subject_id", null: false
+ t.string "subject_type", null: false
t.boolean "submitted", default: false, null: false
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
end
create_table "users", force: :cascade do |t|
@@ -1154,4 +1156,4 @@ ActiveRecord::Schema.define(version: 20160819221833) do
add_foreign_key "protected_branch_merge_access_levels", "protected_branches"
add_foreign_key "protected_branch_push_access_levels", "protected_branches"
add_foreign_key "u2f_registrations", "users"
-end \ No newline at end of file
+end