diff options
author | Brett Walker <bwalker@gitlab.com> | 2018-03-21 15:38:38 +0100 |
---|---|---|
committer | Brett Walker <bwalker@gitlab.com> | 2018-03-21 15:38:38 +0100 |
commit | 45de8dec9860611a7f56ab6b17f92a6070fa0f53 (patch) | |
tree | 83ce6563428a2a864dfd41ee803ba815bbfa05f0 | |
parent | e7a33b3b5a38adfb580ba2c90873071ae32ff524 (diff) | |
download | gitlab-ce-bw-postgresql-10-db-renames.tar.gz |
remove ee merge conflicts that don't need to be backportedbw-postgresql-10-db-renames
-rw-r--r-- | lib/gitlab/database.rb | 16 | ||||
-rw-r--r-- | spec/lib/gitlab/database_spec.rb | 17 |
2 files changed, 0 insertions, 33 deletions
diff --git a/lib/gitlab/database.rb b/lib/gitlab/database.rb index 2ea121c58ed..f0a2e639bef 100644 --- a/lib/gitlab/database.rb +++ b/lib/gitlab/database.rb @@ -58,10 +58,6 @@ module Gitlab postgresql? && version.to_f >= 9.4 end - def self.pg_stat_wal_receiver_supported? - postgresql? && version.to_f >= 9.6 - end - # map some of the function names that changed between PostgreSQL 9 and 10 # https://wiki.postgresql.org/wiki/New_in_postgres_10 def self.pg_wal_lsn_diff @@ -112,10 +108,6 @@ module Gitlab postgresql? ? "RANDOM()" : "RAND()" end - def self.minute_interval(value) - postgresql? ? "#{value} * '1 minute'::interval" : "INTERVAL #{value} MINUTE" - end - def self.true_value if postgresql? "'t'" @@ -209,14 +201,6 @@ module Gitlab ActiveRecord::ConnectionAdapters::ConnectionPool.new(spec) end - # Disables prepared statements for the current database connection. - def self.disable_prepared_statements - config = ActiveRecord::Base.configurations[Rails.env] - config['prepared_statements'] = false - - ActiveRecord::Base.establish_connection(config) - end - def self.connection ActiveRecord::Base.connection end diff --git a/spec/lib/gitlab/database_spec.rb b/spec/lib/gitlab/database_spec.rb index 28b408ba763..e6c223f3895 100644 --- a/spec/lib/gitlab/database_spec.rb +++ b/spec/lib/gitlab/database_spec.rb @@ -424,23 +424,6 @@ describe Gitlab::Database do end end - describe '#disable_prepared_statements' do - it 'disables prepared statements' do - config = {} - - expect(ActiveRecord::Base.configurations).to receive(:[]) - .with(Rails.env) - .and_return(config) - - expect(ActiveRecord::Base).to receive(:establish_connection) - .with({ 'prepared_statements' => false }) - - described_class.disable_prepared_statements - - expect(config['prepared_statements']).to eq(false) - end - end - describe '#sanitize_timestamp' do let(:max_timestamp) { Time.at((1 << 31) - 1) } |