Skip to content
Browse files

Add modifications to database rake tasks as part of #5139. [schoenm@e…

…arthlink.net]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4356 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent b5a6ba6 commit 738c43c549a504c7478aee34aacb31030fac612a Marcel Molina committed May 21, 2006
Showing with 3 additions and 3 deletions.
  1. +3 −3 railties/lib/tasks/databases.rake
View
6 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)

0 comments on commit 738c43c

Please sign in to comment.
Something went wrong with that request. Please try again.