diff options
author | Jarka Kadlecová <jarka@gitlab.com> | 2018-07-11 19:33:24 +0300 |
---|---|---|
committer | Jarka Kadlecová <jarka@gitlab.com> | 2018-07-11 19:33:24 +0300 |
commit | 8717c7dad9b5a8fa21ec9a652c54718a6b4c2175 (patch) | |
tree | abedd3ea3e4de67953b992df1a67d7baef8aebe2 /db/migrate/20180608091413_add_group_to_todos.rb | |
parent | c7c630f142a23505b4adce449c0a176dec142384 (diff) |
Revert "Merge branch 'ee-5481-epic-todos' into 'master'"
This reverts commit 4d9a3f42f1fd3be21555e19872b7121cca65015e, reversing
changes made to ecf9c145f6e4d170cd059df88743393d9e63c489.
Diffstat (limited to 'db/migrate/20180608091413_add_group_to_todos.rb')
-rw-r--r-- | db/migrate/20180608091413_add_group_to_todos.rb | 32 |
1 files changed, 0 insertions, 32 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 |