Class: ARDatabaseDuplicator::CapturedSchema
- Inherits:
-
Object
- Object
- ARDatabaseDuplicator::CapturedSchema
- Defined in:
- lib/ar_database_duplicator.rb
Instance Attribute Summary collapse
-
#db ⇒ Object
readonly
Returns the value of attribute db.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
-
#schema_file_name ⇒ Object
readonly
Returns the value of attribute schema_file_name.
Instance Method Summary collapse
-
#initialize(ardb, schema_file_name) ⇒ CapturedSchema
constructor
A new instance of CapturedSchema.
- #recorded_assume_migrated ⇒ Object
- #recorded_initialize_schema ⇒ Object
- #schema_for(table_name) ⇒ Object
- #table_commands_for(table_name) ⇒ Object
- #table_names ⇒ Object
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
#db ⇒ Object (readonly)
Returns the value of attribute db.
680 681 682 |
# File 'lib/ar_database_duplicator.rb', line 680 def db @db end |
#schema ⇒ Object
Returns the value of attribute schema.
680 681 682 |
# File 'lib/ar_database_duplicator.rb', line 680 def schema @schema end |
#schema_file_name ⇒ Object
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_migrated ⇒ Object
700 701 702 |
# File 'lib/ar_database_duplicator.rb', line 700 def recorded_assume_migrated @recorded_assume_migrated ||= [] end |
#recorded_initialize_schema ⇒ Object
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_names ⇒ Object
696 697 698 |
# File 'lib/ar_database_duplicator.rb', line 696 def table_names recorded_table_commands.keys end |