refactor: Encapsulate enum creation logic within a dedicated function in the upgrade process for improved readability and maintainability
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m21s
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m21s
This commit is contained in:
parent
c204c25314
commit
c14b432082
@ -26,6 +26,7 @@ chore_frequency_enum = postgresql.ENUM('one_time', 'daily', 'weekly', 'monthly',
|
||||
chore_type_enum = postgresql.ENUM('personal', 'group', name='choretypeenum', create_type=False)
|
||||
|
||||
def upgrade(context) -> None:
|
||||
def create_enums():
|
||||
user_role_enum.create(op.get_bind(), checkfirst=True)
|
||||
split_type_enum.create(op.get_bind(), checkfirst=True)
|
||||
expense_split_status_enum.create(op.get_bind(), checkfirst=True)
|
||||
@ -34,6 +35,8 @@ def upgrade(context) -> None:
|
||||
chore_frequency_enum.create(op.get_bind(), checkfirst=True)
|
||||
chore_type_enum.create(op.get_bind(), checkfirst=True)
|
||||
|
||||
create_enums()
|
||||
|
||||
op.create_table('users',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('email', sa.String(), nullable=False),
|
||||
|
Loading…
Reference in New Issue
Block a user