aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Molina <marcel@vernix.org>2006-05-21 20:17:22 +0000
committerMarcel Molina <marcel@vernix.org>2006-05-21 20:17:22 +0000
commit738c43c549a504c7478aee34aacb31030fac612a (patch)
treec269c88077de75257086f956ee0797d83718b519
parentb5a6ba683369c712ae99b6be38e736413e9637e1 (diff)
downloadrails-738c43c549a504c7478aee34aacb31030fac612a.tar.gz
rails-738c43c549a504c7478aee34aacb31030fac612a.tar.bz2
rails-738c43c549a504c7478aee34aacb31030fac612a.zip
Add modifications to database rake tasks as part of #5139. [schoenm@earthlink.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4356 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--railties/lib/tasks/databases.rake6
1 files changed, 3 insertions, 3 deletions
diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake
index e3272b86b4..4c85263398 100644
--- a/railties/lib/tasks/databases.rake
+++ b/railties/lib/tasks/databases.rake
@@ -37,7 +37,7 @@ namespace :db do
task :dump => :environment do
abcs = ActiveRecord::Base.configurations
case abcs[RAILS_ENV]["adapter"]
- when "mysql", "oci"
+ when "mysql", "oci", "oracle"
ActiveRecord::Base.establish_connection(abcs[RAILS_ENV])
File.open("db/#{RAILS_ENV}_structure.sql", "w+") { |f| f << ActiveRecord::Base.connection.structure_dump }
when "postgresql"
@@ -93,7 +93,7 @@ namespace :db do
`#{abcs["test"]["adapter"]} #{dbfile} < db/#{RAILS_ENV}_structure.sql`
when "sqlserver"
`osql -E -S #{abcs["test"]["host"]} -d #{abcs["test"]["database"]} -i db\\#{RAILS_ENV}_structure.sql`
- when "oci"
+ when "oci", "oracle"
ActiveRecord::Base.establish_connection(:test)
IO.readlines("db/#{RAILS_ENV}_structure.sql").join.split(";\n\n").each do |ddl|
ActiveRecord::Base.connection.execute(ddl)
@@ -124,7 +124,7 @@ namespace :db do
dropfkscript = "#{abcs["test"]["host"]}.#{abcs["test"]["database"]}.DP1".gsub(/\\/,'-')
`osql -E -S #{abcs["test"]["host"]} -d #{abcs["test"]["database"]} -i db\\#{dropfkscript}`
`osql -E -S #{abcs["test"]["host"]} -d #{abcs["test"]["database"]} -i db\\#{RAILS_ENV}_structure.sql`
- when "oci"
+ when "oci", "oracle"
ActiveRecord::Base.establish_connection(:test)
ActiveRecord::Base.connection.structure_drop.split(";\n\n").each do |ddl|
ActiveRecord::Base.connection.execute(ddl)