diff options
Diffstat (limited to 'db/migrate/20170508190732_add_foreign_key_to_ci_variables.rb')
-rw-r--r-- | db/migrate/20170508190732_add_foreign_key_to_ci_variables.rb | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/db/migrate/20170508190732_add_foreign_key_to_ci_variables.rb b/db/migrate/20170508190732_add_foreign_key_to_ci_variables.rb deleted file mode 100644 index 305366b2171..00000000000 --- a/db/migrate/20170508190732_add_foreign_key_to_ci_variables.rb +++ /dev/null @@ -1,24 +0,0 @@ -class AddForeignKeyToCiVariables < ActiveRecord::Migration[4.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - execute <<~SQL - DELETE FROM ci_variables - WHERE NOT EXISTS ( - SELECT true - FROM projects - WHERE projects.id = ci_variables.project_id - ) - SQL - - add_concurrent_foreign_key(:ci_variables, :projects, column: :project_id) - end - - def down - remove_foreign_key(:ci_variables, column: :project_id) - end -end |