Rename migration methods
This commit is contained in:
parent
87437b18aa
commit
ceb465da22
4 changed files with 12 additions and 12 deletions
|
@ -4,15 +4,15 @@ class RemoveOldStatuses < ActiveRecord::Migration[6.0]
|
|||
include Partynest::Migration
|
||||
|
||||
def change
|
||||
drop_constraint :relationships, :regional_secretary_flag, <<~SQL
|
||||
remove_constraint :relationships, :regional_secretary_flag, <<~SQL
|
||||
regional_secretary_flag IS NULL OR role = 'regional_manager'
|
||||
SQL
|
||||
|
||||
drop_constraint :relationships, :federal_secretary_flag, <<~SQL
|
||||
remove_constraint :relationships, :federal_secretary_flag, <<~SQL
|
||||
federal_secretary_flag IS NULL OR role = 'federal_manager'
|
||||
SQL
|
||||
|
||||
drop_constraint :relationships, :role, <<~SQL
|
||||
remove_constraint :relationships, :role, <<~SQL
|
||||
status = 'member' OR role IS NULL
|
||||
SQL
|
||||
|
||||
|
@ -68,17 +68,17 @@ class RemoveOldStatuses < ActiveRecord::Migration[6.0]
|
|||
:relationship_status,
|
||||
null: false
|
||||
|
||||
drop_enum :relationship_status, %i[supporter excluded member]
|
||||
remove_enum :relationship_status, %i[supporter excluded member]
|
||||
|
||||
drop_enum :relationship_role, %i[
|
||||
remove_enum :relationship_role, %i[
|
||||
federal_manager
|
||||
federal_supervisor
|
||||
regional_manager
|
||||
regional_supervisor
|
||||
]
|
||||
|
||||
drop_enum :relationship_regional_secretary_flag, %i[regional_secretary]
|
||||
remove_enum :relationship_regional_secretary_flag, %i[regional_secretary]
|
||||
|
||||
drop_enum :relationship_federal_secretary_flag, %i[federal_secretary]
|
||||
remove_enum :relationship_federal_secretary_flag, %i[federal_secretary]
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ class ChangeUserAgent < ActiveRecord::Migration[6.0]
|
|||
include Partynest::Migration
|
||||
|
||||
def change
|
||||
drop_constraint :sessions, :user_agent, <<~SQL
|
||||
remove_constraint :sessions, :user_agent, <<~SQL
|
||||
user_agent = '' OR is_good_big_text(user_agent)
|
||||
SQL
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ class RemoveRegionalOffices < ActiveRecord::Migration[6.0]
|
|||
index: true,
|
||||
foreign_key: true
|
||||
|
||||
drop_constraint :regional_offices, :name, <<~SQL
|
||||
remove_constraint :regional_offices, :name, <<~SQL
|
||||
is_good_small_text(name)
|
||||
SQL
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ module Partynest
|
|||
end
|
||||
end
|
||||
|
||||
def drop_func(name, sql)
|
||||
def remove_func(name, sql)
|
||||
reversible do |dir|
|
||||
dir.up { func_deletion(name).call }
|
||||
dir.down { func_creation(name, sql).call }
|
||||
|
@ -23,7 +23,7 @@ module Partynest
|
|||
end
|
||||
end
|
||||
|
||||
def drop_enum(name, values)
|
||||
def remove_enum(name, values)
|
||||
reversible do |dir|
|
||||
dir.up { enum_deletion(name).call }
|
||||
dir.down { enum_creation(name, values).call }
|
||||
|
@ -37,7 +37,7 @@ module Partynest
|
|||
end
|
||||
end
|
||||
|
||||
def drop_constraint(table, name, check)
|
||||
def remove_constraint(table, name, check)
|
||||
reversible do |dir|
|
||||
dir.up { constraint_deletion(table, name).call }
|
||||
dir.down { constraint_creation(table, name, check).call }
|
||||
|
|
Reference in a new issue