Class: DatabaseConsistency::Writers::Autofix::MigrationBase
- Includes:
- Helpers::Migration
- Defined in:
- lib/database_consistency/writers/autofix/migration_base.rb
Overview
:nodoc:
Direct Known Subclasses
AssociationMissingIndex, InconsistentTypes, MissingForeignKey, NullConstraintMissing, RedundantIndex
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods included from Helpers::Migration
#migration_configuration, #migration_path, #migration_path_pattern
Methods inherited from Base
Constructor Details
This class inherits a constructor from DatabaseConsistency::Writers::Autofix::Base
Instance Method Details
#attributes ⇒ Object
19 20 21 |
# File 'lib/database_consistency/writers/autofix/migration_base.rb', line 19 def attributes {} end |
#fix! ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/database_consistency/writers/autofix/migration_base.rb', line 9 def fix! file_path = migration_path(migration_name) if Dir[migration_path_pattern(migration_name)].any? p "Skipping migration #{migration_name} because it already exists" else File.write(file_path, migration) end end |