Class: DataMigrate::DataSchemaMigration
- Inherits:
-
ActiveRecord::SchemaMigration
- Object
- ActiveRecord::SchemaMigration
- DataMigrate::DataSchemaMigration
- Defined in:
- lib/data_migrate/data_schema_migration.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.create_version(version) ⇒ Object
23 24 25 26 27 |
# File 'lib/data_migrate/data_schema_migration.rb', line 23 def create_version(version) # Note that SchemaMigration.create_version in Rails 7.1 does not # raise an error if validations fail but we retain this behaviour for now. create!(version: version) end |
.primary_key ⇒ Object
19 20 21 |
# File 'lib/data_migrate/data_schema_migration.rb', line 19 def primary_key "version" end |
.table_name ⇒ Object
15 16 17 |
# File 'lib/data_migrate/data_schema_migration.rb', line 15 def table_name ActiveRecord::Base.table_name_prefix + 'data_migrations' + ActiveRecord::Base.table_name_suffix end |
Instance Method Details
#primary_key ⇒ Object
10 11 12 |
# File 'lib/data_migrate/data_schema_migration.rb', line 10 def primary_key "version" end |
#table_name ⇒ Object
6 7 8 |
# File 'lib/data_migrate/data_schema_migration.rb', line 6 def table_name ActiveRecord::Base.table_name_prefix + 'data_migrations' + ActiveRecord::Base.table_name_suffix end |