Class: ARDatabaseDuplicator::CapturedSchema

Inherits:
Object
  • Object
show all
Defined in:
lib/ar_database_duplicator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ardb, schema_file_name) ⇒ CapturedSchema

Returns a new instance of CapturedSchema.



682
683
684
685
686
# File 'lib/ar_database_duplicator.rb', line 682

def initialize(ardb, schema_file_name)
  @db = ardb
  self.schema_file_name = schema_file_name
  parse_schema
end

Instance Attribute Details

#dbObject (readonly)

Returns the value of attribute db.



680
681
682
# File 'lib/ar_database_duplicator.rb', line 680

def db
  @db
end

#schemaObject

Returns the value of attribute schema.



680
681
682
# File 'lib/ar_database_duplicator.rb', line 680

def schema
  @schema
end

#schema_file_nameObject

Returns the value of attribute schema_file_name.



680
681
682
# File 'lib/ar_database_duplicator.rb', line 680

def schema_file_name
  @schema_file_name
end

Instance Method Details

#recorded_assume_migratedObject



700
701
702
# File 'lib/ar_database_duplicator.rb', line 700

def recorded_assume_migrated
  @recorded_assume_migrated ||= []
end

#recorded_initialize_schemaObject



704
705
706
# File 'lib/ar_database_duplicator.rb', line 704

def recorded_initialize_schema
  @recorded_initialize_schema ||= []
end

#schema_for(table_name) ⇒ Object



692
693
694
# File 'lib/ar_database_duplicator.rb', line 692

def schema_for(table_name)
  [create_table_command(table_name), index_commands(table_name)].join("\n")
end

#table_commands_for(table_name) ⇒ Object



688
689
690
# File 'lib/ar_database_duplicator.rb', line 688

def table_commands_for(table_name)
  recorded_table_commands[table_name]
end

#table_namesObject



696
697
698
# File 'lib/ar_database_duplicator.rb', line 696

def table_names
  recorded_table_commands.keys
end