Class: Migflow::Services::DiffBuilder
- Inherits:
-
Object
- Object
- Migflow::Services::DiffBuilder
- Defined in:
- lib/migflow/services/diff_builder.rb
Class Method Summary collapse
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(from_tables:, to_tables:, from_version:, to_version:) ⇒ DiffBuilder
constructor
A new instance of DiffBuilder.
Constructor Details
#initialize(from_tables:, to_tables:, from_version:, to_version:) ⇒ DiffBuilder
Returns a new instance of DiffBuilder.
11 12 13 14 15 16 |
# File 'lib/migflow/services/diff_builder.rb', line 11 def initialize(from_tables:, to_tables:, from_version:, to_version:) @from_tables = from_tables @to_tables = to_tables @from_version = from_version @to_version = to_version end |
Class Method Details
.call(from_tables:, to_tables:, from_version:, to_version:) ⇒ Object
6 7 8 9 |
# File 'lib/migflow/services/diff_builder.rb', line 6 def self.call(from_tables:, to_tables:, from_version:, to_version:) new(from_tables: from_tables, to_tables: to_tables, from_version: from_version, to_version: to_version).build end |
Instance Method Details
#build ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/migflow/services/diff_builder.rb', line 18 def build Models::SchemaDiff.new( from_version: @from_version, to_version: @to_version, changes: table_changes + column_changes + index_changes ) end |