summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-07-25 15:05:07 +0000
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-07-25 15:05:07 +0000
commitaa9db9c869ecbc570bd03f02dd3febf32f99d560 (patch)
tree688a6b97eb6ad25ce0e31198cc8b18dd85a8ca82 /lib
parent663d98c841f807c3302c71a175dc26e557fdccb2 (diff)
parent2b3d00a77822eaf2e622dd0b1baf85ebea2b1ee4 (diff)
downloadgitlab-ce-aa9db9c869ecbc570bd03f02dd3febf32f99d560.tar.gz
Merge branch '54478-table_exists-not-compatible-with-rails-5-1' into 'master'
Resolve "table_exists? not compatible with Rails 5.1" Closes #54478 See merge request gitlab-org/gitlab-ce!30832
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/background_migration/prepare_untracked_uploads.rb2
-rw-r--r--lib/tasks/gitlab/db.rake2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/background_migration/prepare_untracked_uploads.rb b/lib/gitlab/background_migration/prepare_untracked_uploads.rb
index 7d40b459c9a..806c3a7a369 100644
--- a/lib/gitlab/background_migration/prepare_untracked_uploads.rb
+++ b/lib/gitlab/background_migration/prepare_untracked_uploads.rb
@@ -55,7 +55,7 @@ module Gitlab
def ensure_temporary_tracking_table_exists
table_name = :untracked_files_for_uploads
- unless ActiveRecord::Base.connection.data_source_exists?(table_name)
+ unless ActiveRecord::Base.connection.table_exists?(table_name)
UntrackedFile.connection.create_table table_name do |t|
t.string :path, limit: 600, null: false
t.index :path, unique: true
diff --git a/lib/tasks/gitlab/db.rake b/lib/tasks/gitlab/db.rake
index 5f2ed5274e4..d054959e05e 100644
--- a/lib/tasks/gitlab/db.rake
+++ b/lib/tasks/gitlab/db.rake
@@ -33,7 +33,7 @@ namespace :gitlab do
# Removes the entry from the array
tables.delete 'schema_migrations'
# Truncate schema_migrations to ensure migrations re-run
- connection.execute('TRUNCATE schema_migrations') if connection.data_source_exists? 'schema_migrations'
+ 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