mirror of
https://github.com/DatabaseCleaner/database_cleaner
synced 2023-03-27 23:22:03 -04:00
Using built in postgresql_version - should be forwards compatible with version 10+
This commit is contained in:
parent
b5694e74c6
commit
a5e47d68c3
1 changed files with 3 additions and 3 deletions
|
@ -60,15 +60,15 @@ module ActiveRecord
|
|||
class PostgreSQLAdapter < AbstractAdapter
|
||||
|
||||
def db_version
|
||||
@db_version ||= select_value('SHOW SERVER_VERSION')
|
||||
@db_version ||= postgresql_version
|
||||
end
|
||||
|
||||
def cascade
|
||||
@cascade ||= db_version >= '8.2' ? 'CASCADE' : ''
|
||||
@cascade ||= db_version >= 80200 ? 'CASCADE' : ''
|
||||
end
|
||||
|
||||
def restart_identity
|
||||
@restart_identity ||= db_version >= '8.4' ? 'RESTART IDENTITY' : ''
|
||||
@restart_identity ||= db_version >= 80400 ? 'RESTART IDENTITY' : ''
|
||||
end
|
||||
|
||||
def truncate_table(table_name)
|
||||
|
|
Loading…
Reference in a new issue