Skip to content

Commit 33799c8

Browse files
committed
Merge pull request rails#3203 from jrmehle/fix_clone_structure
db:test:clone_structure if path to .sql file contains spaces or dashes
2 parents 0adab7c + 80e0cd3 commit 33799c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

activerecord/lib/active_record/railties/databases.rake

+2-2
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,10 @@ db_namespace = namespace :db do
424424
ENV['PGHOST'] = abcs['test']['host'] if abcs['test']['host']
425425
ENV['PGPORT'] = abcs['test']['port'].to_s if abcs['test']['port']
426426
ENV['PGPASSWORD'] = abcs['test']['password'].to_s if abcs['test']['password']
427-
`psql -U "#{abcs['test']['username']}" -f #{Rails.root}/db/#{Rails.env}_structure.sql #{abcs['test']['database']} #{abcs['test']['template']}`
427+
`psql -U "#{abcs['test']['username']}" -f "#{Rails.root}/db/#{Rails.env}_structure.sql" #{abcs['test']['database']} #{abcs['test']['template']}`
428428
when /sqlite/
429429
dbfile = abcs['test']['database'] || abcs['test']['dbfile']
430-
`sqlite3 #{dbfile} < #{Rails.root}/db/#{Rails.env}_structure.sql`
430+
`sqlite3 #{dbfile} < "#{Rails.root}/db/#{Rails.env}_structure.sql"`
431431
when 'sqlserver'
432432
`sqlcmd -S #{abcs['test']['host']} -d #{abcs['test']['database']} -U #{abcs['test']['username']} -P #{abcs['test']['password']} -i db\\#{Rails.env}_structure.sql`
433433
when 'oci', 'oracle'

0 commit comments

Comments
 (0)