summaryrefslogtreecommitdiff
path: root/lib/tasks/gitlab
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-06-13 14:12:28 +0100
committerNick Thomas <nick@gitlab.com>2019-07-23 16:53:03 +0100
commit4aa76dddecc048cef24963323afe59f1c120cb72 (patch)
tree0a15518b73ee1646d09161954cbefb577d249138 /lib/tasks/gitlab
parentd892e80bf0161b535389c91ccb53539e4f08d790 (diff)
downloadgitlab-ce-4aa76dddecc048cef24963323afe59f1c120cb72.tar.gz
Remove dead MySQL code
None of this code can be reached any more, so it can all be removed
Diffstat (limited to 'lib/tasks/gitlab')
-rw-r--r--lib/tasks/gitlab/db.rake13
-rw-r--r--lib/tasks/gitlab/setup.rake1
2 files changed, 3 insertions, 11 deletions
diff --git a/lib/tasks/gitlab/db.rake b/lib/tasks/gitlab/db.rake
index 4e7a8adbef6..5f2ed5274e4 100644
--- a/lib/tasks/gitlab/db.rake
+++ b/lib/tasks/gitlab/db.rake
@@ -26,12 +26,9 @@ namespace :gitlab do
task drop_tables: :environment do
connection = ActiveRecord::Base.connection
- # If MySQL, turn off foreign key checks
- connection.execute('SET FOREIGN_KEY_CHECKS=0') if Gitlab::Database.mysql?
-
- # connection.tables is deprecated in MySQLAdapter, but in PostgreSQLAdapter
- # data_sources returns both views and tables, so use #tables instead
- tables = Gitlab::Database.mysql? ? connection.data_sources : connection.tables
+ # In PostgreSQLAdapter, data_sources returns both views and tables, so use
+ # #tables instead
+ tables = connection.tables
# Removes the entry from the array
tables.delete 'schema_migrations'
@@ -40,12 +37,8 @@ namespace :gitlab do
# 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
# Add `IF EXISTS` because cascade could have already deleted a table.
tables.each { |t| connection.execute("DROP TABLE IF EXISTS #{connection.quote_table_name(t)} CASCADE") }
-
- # If MySQL, re-enable foreign key checks
- connection.execute('SET FOREIGN_KEY_CHECKS=1') if Gitlab::Database.mysql?
end
desc 'Configures the database by running migrate, or by loading the schema and seeding if needed'
diff --git a/lib/tasks/gitlab/setup.rake b/lib/tasks/gitlab/setup.rake
index e876b23d43f..e763de682f8 100644
--- a/lib/tasks/gitlab/setup.rake
+++ b/lib/tasks/gitlab/setup.rake
@@ -31,7 +31,6 @@ namespace :gitlab do
terminate_all_connections unless Rails.env.production?
Rake::Task["db:reset"].invoke
- Rake::Task["add_limits_mysql"].invoke
Rake::Task["setup_postgresql"].invoke
Rake::Task["db:seed_fu"].invoke
rescue Gitlab::TaskAbortedByUserError