diff options
author | Jose Torres <torres@balameb.com> | 2016-09-21 21:54:09 +0000 |
---|---|---|
committer | Jose Torres <torres@balameb.com> | 2016-12-27 22:58:02 -0600 |
commit | 80772ccaef9c0a883e4686940d7b4e37c5c0609f (patch) | |
tree | 66781ff52a2e914c1fdbe1f707ce87f81ef5511e | |
parent | b93c72e33a50aaed845fe333dee0201b0b11934e (diff) | |
download | gitlab-ce-mysql_validate_pre_truncate.tar.gz |
Adds validation for schema_migration prior to truncate.mysql_validate_pre_truncate
Adds note to table.delete
-rw-r--r-- | lib/tasks/gitlab/db.rake | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/tasks/gitlab/db.rake b/lib/tasks/gitlab/db.rake index 7c96bc864ce..b2780e0a9ac 100644 --- a/lib/tasks/gitlab/db.rake +++ b/lib/tasks/gitlab/db.rake @@ -30,9 +30,10 @@ namespace :gitlab do connection.execute('SET FOREIGN_KEY_CHECKS=0') if Gitlab::Database.mysql? tables = connection.tables + # Removes the entry from the array tables.delete 'schema_migrations' - # Truncate schema_migrations to ensure migrations re-run - connection.execute('TRUNCATE schema_migrations') + # Truncate schema_migrations to ensure migrations re-run + connection.execute('TRUNCATE schema_migrations') if connection.table_exists? 'schema_migrations' # Drop tables with cascade to avoid dependent table errors # PG: http://www.postgresql.org/docs/current/static/ddl-depend.html |