diff options
author | Katrina Owen <katrina.owen@gmail.com> | 2011-01-06 12:08:22 +0100 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2011-01-09 15:35:47 -0800 |
commit | 4690bee301588b92fe8c0ae1026c14336e1be57c (patch) | |
tree | 2a98ec7a8b5b9307238348a0a1a5dc057fbb2d4b /activerecord | |
parent | 18605adec36f8487374d68cdb031e89e91379c56 (diff) | |
download | rails-4690bee301588b92fe8c0ae1026c14336e1be57c.tar.gz rails-4690bee301588b92fe8c0ae1026c14336e1be57c.tar.bz2 rails-4690bee301588b92fe8c0ae1026c14336e1be57c.zip |
Adding postgresql template option when executing db:test:clone_structure
Specify the template to use in config/database.yml, e.g.
test:
adapter: postgresql
template: template_postgis
If no template is specified, postgresql defaults to template1
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index a4fc18148e..9924755ddf 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -409,7 +409,7 @@ 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"]}` + `psql -U "#{abcs["test"]["username"]}" -f #{Rails.root}/db/#{Rails.env}_structure.sql #{abcs["test"]["database"]} #{abcs["test"]["template"]}` when "sqlite", "sqlite3" dbfile = abcs["test"]["database"] || abcs["test"]["dbfile"] `#{abcs["test"]["adapter"]} #{dbfile} < #{Rails.root}/db/#{Rails.env}_structure.sql` |