Class: Nochmal::MigrationData::CreateMigrationTables
- Inherits:
-
Object
- Object
- Nochmal::MigrationData::CreateMigrationTables
- Defined in:
- lib/nochmal/migration_data/create_tables.rb
Overview
:nodoc:
Instance Method Summary collapse
- #down ⇒ Object
-
#up ⇒ Object
rubocop:disable Metrics/MethodLength.
Instance Method Details
#down ⇒ Object
27 28 29 30 |
# File 'lib/nochmal/migration_data/create_tables.rb', line 27 def down drop_table :nochmal_migration_data_status, if_exists: true drop_table :nochmal_migration_data_meta, if_exists: true end |
#up ⇒ Object
rubocop:disable Metrics/MethodLength
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/nochmal/migration_data/create_tables.rb', line 6 def up # rubocop:disable Metrics/MethodLength create_table :nochmal_migration_data_status do |t| t.belongs_to :record, polymorphic: true t.string :uploader_type t.string :filename t.string :status end return if table_exists?(:nochmal_migration_data_meta) create_table :nochmal_migration_data_meta do |t| t.string :record_type t.string :uploader_type t.integer :expected t.integer :migrated t.string :status end end |