Created
April 12, 2009 07:23
-
-
Save maxim/93908 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Load SQL structure into database" | |
task(:load => :environment) do | |
conf = ActiveRecord::Base.configurations | |
puts "Loading sql structure..." | |
if system("psql #{conf[RAILS_ENV]["database"]} #{conf[RAILS_ENV]["username"]} < db/#{RAILS_ENV}_structure.sql") | |
puts "Done" | |
else | |
puts "Boom! Something went wrong." | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment