Class: ActiveRecord::Tasks::OracleDatabaseTasks

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/tasks/oracle_database_tasks.rb

Overview

:nodoc:

Instance Method Summary collapse

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

#charsetObject



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

#createObject



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

#dropObject



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

#purgeObject



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