diff options
author | Stan Hu <stanhu@gmail.com> | 2016-06-09 14:51:57 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2016-06-09 15:06:19 -0700 |
commit | bf92ea687f7085d8ea0168f47507d0bc459b6d36 (patch) | |
tree | 701a8e12fd3f8959604ae5345c938d901cf8b37a | |
parent | 5f803f0fd1676c5a77eaa800c3036729bac0db98 (diff) | |
download | gitlab-ce-bf92ea687f7085d8ea0168f47507d0bc459b6d36.tar.gz |
Properly quote table name in Rake task for MySQL and PostgreSQL compatibilityfix-issue-15259-postgresql
!4318 broke the gitlab:db:drop_tables functionality for PostgreSQL.
Closes #15259
-rw-r--r-- | lib/tasks/gitlab/db.rake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tasks/gitlab/db.rake b/lib/tasks/gitlab/db.rake index e3135532540..7230b9485be 100644 --- a/lib/tasks/gitlab/db.rake +++ b/lib/tasks/gitlab/db.rake @@ -34,7 +34,7 @@ namespace :gitlab do # PG: http://www.postgresql.org/docs/current/static/ddl-depend.html # MySQL: http://dev.mysql.com/doc/refman/5.7/en/drop-table.html # Add `IF EXISTS` because cascade could have already deleted a table. - tables.each { |t| connection.execute("DROP TABLE IF EXISTS `#{t}` CASCADE") } + tables.each { |t| connection.execute("DROP TABLE IF EXISTS #{connection.quote_table_name(t)} CASCADE") } end desc 'Configures the database by running migrate, or by loading the schema and seeding if needed' |