Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2018-07-11 20:08:45 +0300
committerJose <jvargas@gitlab.com>2018-07-11 23:07:18 +0300
commit23b0ba4e296e19eb6a0856f2bb2bf4519a990572 (patch)
tree77b7797633c376a65cd8e4dbbaf8333eb7787e77 /db
parentae95fde0f7f4976909b8cdd150d7dfbd4c3ef77c (diff)
Merge branch 'revert-todos-epic' into 'master'
Revert "Merge branch 'ee-5481-epic-todos' into 'master'" See merge request gitlab-org/gitlab-ce!20560
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20180608091413_add_group_to_todos.rb32
-rw-r--r--db/schema.rb5
2 files changed, 1 insertions, 36 deletions
diff --git a/db/migrate/20180608091413_add_group_to_todos.rb b/db/migrate/20180608091413_add_group_to_todos.rb
deleted file mode 100644
index af3ee48b29d..00000000000
--- a/db/migrate/20180608091413_add_group_to_todos.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-class AddGroupToTodos < ActiveRecord::Migration
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_column :todos, :group_id, :integer
- add_concurrent_foreign_key :todos, :namespaces, column: :group_id, on_delete: :cascade
- add_concurrent_index :todos, :group_id
-
- change_column_null :todos, :project_id, true
- end
-
- def down
- return unless group_id_exists?
-
- remove_foreign_key :todos, column: :group_id
- remove_index :todos, :group_id if index_exists?(:todos, :group_id)
- remove_column :todos, :group_id
-
- execute "DELETE FROM todos WHERE project_id IS NULL"
- change_column_null :todos, :project_id, false
- end
-
- private
-
- def group_id_exists?
- column_exists?(:todos, :group_id)
- end
-end
diff --git a/db/schema.rb b/db/schema.rb
index 1898dfc6022..79091892441 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1949,7 +1949,7 @@ ActiveRecord::Schema.define(version: 20180702120647) do
create_table "todos", force: :cascade do |t|
t.integer "user_id", null: false
- t.integer "project_id"
+ t.integer "project_id", null: false
t.integer "target_id"
t.string "target_type", null: false
t.integer "author_id", null: false
@@ -1959,12 +1959,10 @@ ActiveRecord::Schema.define(version: 20180702120647) do
t.datetime "updated_at"
t.integer "note_id"
t.string "commit_id"
- t.integer "group_id"
end
add_index "todos", ["author_id"], name: "index_todos_on_author_id", using: :btree
add_index "todos", ["commit_id"], name: "index_todos_on_commit_id", using: :btree
- add_index "todos", ["group_id"], name: "index_todos_on_group_id", using: :btree
add_index "todos", ["note_id"], name: "index_todos_on_note_id", using: :btree
add_index "todos", ["project_id"], name: "index_todos_on_project_id", using: :btree
add_index "todos", ["target_type", "target_id"], name: "index_todos_on_target_type_and_target_id", using: :btree
@@ -2338,7 +2336,6 @@ ActiveRecord::Schema.define(version: 20180702120647) do
add_foreign_key "term_agreements", "users", 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 "todos", "namespaces", column: "group_id", on_delete: :cascade
add_foreign_key "todos", "notes", name: "fk_91d1f47b13", on_delete: :cascade
add_foreign_key "todos", "projects", name: "fk_45054f9c45", on_delete: :cascade
add_foreign_key "todos", "users", column: "author_id", name: "fk_ccf0373936", on_delete: :cascade