diff options
author | Robert Speicher <robert@gitlab.com> | 2016-05-06 01:54:13 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-05-06 01:54:13 +0000 |
commit | 00acdcf78f009c0e09ea7be58e30722335720bf7 (patch) | |
tree | c751376c0299fe174d73618480c4c11b7d103848 | |
parent | 4fce876542365baa1d79fa7812d343afd498904a (diff) | |
parent | 50d18a1e1d945297de4162b2712fa6bbcee0e42e (diff) | |
download | gitlab-ce-00acdcf78f009c0e09ea7be58e30722335720bf7.tar.gz |
Merge branch 'cascade_drop' into 'master'
Rake drop tables with cascade
See merge request !4020
-rw-r--r-- | lib/tasks/gitlab/db.rake | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/tasks/gitlab/db.rake b/lib/tasks/gitlab/db.rake index 4921c6e0bcf..1c706dc11b3 100644 --- a/lib/tasks/gitlab/db.rake +++ b/lib/tasks/gitlab/db.rake @@ -29,7 +29,10 @@ namespace :gitlab do tables.delete 'schema_migrations' # Truncate schema_migrations to ensure migrations re-run connection.execute('TRUNCATE schema_migrations') - tables.each { |t| connection.execute("DROP TABLE #{t}") } + # Drop tables with cascade to avoid dependent table errors + # PG: http://www.postgresql.org/docs/current/static/ddl-depend.html + # MySQL: http://dev.mysql.com/doc/refman/5.7/en/drop-table.html + tables.each { |t| connection.execute("DROP TABLE #{t} CASCADE") } end end end |