raise errors if set role or keep default role used in wrong migration.
Manual Test Plan
create data change migration with set_role and run it (customer_service);
class Test < ActiveRecord::Migration[5.2]
include DataUpdate
set_role "superhero"
def up
apply_update "populate_example_data_update"
end
def down
revert_update "populate_example_data_update"
end
end
error should be raised;
Caused by:
PgSaurus::UseKeepDefaultRoleError: Use keep_default_role instead of set_role for data change migration Test
create structure change migration with keep_default_role and run it (customer_service);
class Test < ActiveRecord::Migration[5.2]
keep_default_role
def up
add_index :customers, :created_at
end
def down
remove_index :customers, :created_at
end
end
error should be raised.
Caused by:
PgSaurus::UseSetRoleError: Use set_role instead of keep_default_role for structure migration Test
Description
Manual Test Plan
create data change migration with
set_role
and run it (customer_service);create structure change migration with
keep_default_role
and run it (customer_service);