Sha256: 284e4c1720aaa6fd4eeb6ef8e9e9d7de81e65fbf9cc3df4791edf8ce725bdf4c

Contents?: true

Size: 614 Bytes

Versions: 1

Compression:

Stored size: 614 Bytes

Contents

# frozen_string_literal: true

VersionedMigration = ActiveRecord::Migration[ActiveRecord::Migration.current_version] # rubocop:disable Metrics/LineLength

class TestSetupMigration < VersionedMigration
  def up
    db_connection = ActiveRecord::Base.connection
    return if db_connection.try(:data_source_exists?, :test_classes)

    create_table :test_classes do |t|
      t.string :field
      t.float :number_field
    end

    create_table :association_test_classes do |t|
      t.integer :test_class_id
    end
  end

  def down
    drop_table :test_classes
    drop_table :association_test_classes
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
order_as_specified-1.6 spec/config/test_setup_migration.rb