mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
DEV: Less hacky way of rolling back DB changes
Some specs use psql to test database restores and dropping the table after the test needs to happen outside of rspec because of transactions. The previous attempt lead to some changes to be stored in the test database.
This commit is contained in:
@ -91,10 +91,10 @@ module BackupRestore
|
||||
end
|
||||
|
||||
def restore_dump_command
|
||||
"#{sed_command} #{@db_dump_path} | #{psql_command} 2>&1"
|
||||
"#{sed_command} #{@db_dump_path} | #{self.class.psql_command} 2>&1"
|
||||
end
|
||||
|
||||
def psql_command
|
||||
def self.psql_command
|
||||
db_conf = BackupRestore.database_configuration
|
||||
|
||||
password_argument = "PGPASSWORD='#{db_conf.password}'" if db_conf.password.present?
|
||||
|
Reference in New Issue
Block a user