Class: DataMigrate::DataSchemaMigration

Inherits:
ActiveRecord::SchemaMigration
  • Object
show all
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_keyObject



19
20
21
# File 'lib/data_migrate/data_schema_migration.rb', line 19

def primary_key
  "version"
end

.table_nameObject



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_keyObject



10
11
12
# File 'lib/data_migrate/data_schema_migration.rb', line 10

def primary_key
  "version"
end

#table_nameObject



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