Skip to content

Commit

Permalink
add alembic migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcusk19 committed Mar 12, 2024
1 parent e0e2de5 commit e88f3f5
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions data/migrations/versions/36cd2b747a08_team_sync_logs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""team sync logs
Revision ID: 36cd2b747a08
Revises: cead4183265c
Create Date: 2024-03-12 14:55:19.431028
"""

# revision identifiers, used by Alembic.
revision = "36cd2b747a08"
down_revision = "cead4183265c"

import sqlalchemy as sa


def upgrade(op, tables, tester):
op.bulk_insert(
tables.logentrykind,
[
{"name": "enable_team_sync"},
{"name": "disable_team_sync"},
],
)


def downgrade(op, tables, tester):
op.execute(
tables.logentrykind.delete().where(
tables.logentrykind.c.name
== op.inline_literal("enable_team_sync") | tables.logentrykind.c.name
== op.inline_literal("disable_team_sync") | tables.logentrykind.c.name
)
)

0 comments on commit e88f3f5

Please sign in to comment.