Class: ActiveRecord::Tasks::OracleDatabaseTasks
- Inherits:
-
Object
- Object
- ActiveRecord::Tasks::OracleDatabaseTasks
- Defined in:
- lib/active_record/tasks/oracle_database_tasks.rb
Overview
:nodoc:
Instance Method Summary collapse
- #charset ⇒ Object
- #create ⇒ Object
- #drop ⇒ Object
-
#initialize(configuration) ⇒ OracleDatabaseTasks
constructor
A new instance of OracleDatabaseTasks.
- #purge ⇒ Object
- #structure_dump(filename) ⇒ Object
- #structure_load(filename) ⇒ Object
Constructor Details
#initialize(configuration) ⇒ OracleDatabaseTasks
Returns a new instance of OracleDatabaseTasks.
6 7 8 9 |
# File 'lib/active_record/tasks/oracle_database_tasks.rb', line 6 def initialize(configuration) ActiveSupport::Deprecation.warn "This database tasks were deprecated, because this tasks should be served by the 3rd party adapter." @configuration = configuration end |
Instance Method Details
#charset ⇒ Object
24 25 26 |
# File 'lib/active_record/tasks/oracle_database_tasks.rb', line 24 def charset $stderr.puts 'sorry, your database adapter is not supported yet, feel free to submit a patch' end |
#create ⇒ Object
11 12 13 |
# File 'lib/active_record/tasks/oracle_database_tasks.rb', line 11 def create $stderr.puts 'sorry, your database adapter is not supported yet, feel free to submit a patch' end |
#drop ⇒ Object
15 16 17 |
# File 'lib/active_record/tasks/oracle_database_tasks.rb', line 15 def drop $stderr.puts 'sorry, your database adapter is not supported yet, feel free to submit a patch' end |
#purge ⇒ Object
19 20 21 22 |
# File 'lib/active_record/tasks/oracle_database_tasks.rb', line 19 def purge establish_connection(:test) connection.structure_drop.split(";\n\n").each { |ddl| connection.execute(ddl) } end |
#structure_dump(filename) ⇒ Object
28 29 30 31 |
# File 'lib/active_record/tasks/oracle_database_tasks.rb', line 28 def structure_dump(filename) establish_connection(configuration) File.open(filename, "w:utf-8") { |f| f << connection.structure_dump } end |
#structure_load(filename) ⇒ Object
33 34 35 36 |
# File 'lib/active_record/tasks/oracle_database_tasks.rb', line 33 def structure_load(filename) establish_connection(configuration) IO.read(filename).split(";\n\n").each { |ddl| connection.execute(ddl) } end |