mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Quoted path to <Rails.env>_structure.sql file in db:test:clone_structure task.
Leaving the path unquoted causes errors in paths containing spaces or dashes.
This commit is contained in:
@@ -424,10 +424,10 @@ db_namespace = namespace :db do
|
||||
ENV['PGHOST'] = abcs['test']['host'] if abcs['test']['host']
|
||||
ENV['PGPORT'] = abcs['test']['port'].to_s if abcs['test']['port']
|
||||
ENV['PGPASSWORD'] = abcs['test']['password'].to_s if abcs['test']['password']
|
||||
`psql -U "#{abcs['test']['username']}" -f #{Rails.root}/db/#{Rails.env}_structure.sql #{abcs['test']['database']} #{abcs['test']['template']}`
|
||||
`psql -U "#{abcs['test']['username']}" -f "#{Rails.root}/db/#{Rails.env}_structure.sql" #{abcs['test']['database']} #{abcs['test']['template']}`
|
||||
when /sqlite/
|
||||
dbfile = abcs['test']['database'] || abcs['test']['dbfile']
|
||||
`sqlite3 #{dbfile} < #{Rails.root}/db/#{Rails.env}_structure.sql`
|
||||
`sqlite3 #{dbfile} < "#{Rails.root}/db/#{Rails.env}_structure.sql"`
|
||||
when 'sqlserver'
|
||||
`sqlcmd -S #{abcs['test']['host']} -d #{abcs['test']['database']} -U #{abcs['test']['username']} -P #{abcs['test']['password']} -i db\\#{Rails.env}_structure.sql`
|
||||
when 'oci', 'oracle'
|
||||
|
||||
Reference in New Issue
Block a user