2021-09-23 06:12:14 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
2021-10-19 00:10:29 +00:00
|
|
|
require_migration!
|
2021-09-23 06:12:14 +00:00
|
|
|
|
|
|
|
RSpec.describe DropTemporaryColumnsAndTriggersForTaggings do
|
|
|
|
let(:taggings_table) { table(:taggings) }
|
|
|
|
|
|
|
|
it 'correctly migrates up and down' do
|
|
|
|
reversible_migration do |migration|
|
|
|
|
migration.before -> {
|
|
|
|
expect(taggings_table.column_names).to include('id_convert_to_bigint')
|
|
|
|
expect(taggings_table.column_names).to include('taggable_id_convert_to_bigint')
|
|
|
|
}
|
|
|
|
|
|
|
|
migration.after -> {
|
|
|
|
taggings_table.reset_column_information
|
|
|
|
expect(taggings_table.column_names).not_to include('id_convert_to_bigint')
|
|
|
|
expect(taggings_table.column_names).not_to include('taggable_id_convert_to_bigint')
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|