gitscope
← marzneshin / v0.7.2 / app/db/migrations/versions/20241127_79271458a973_drop_notification_reminders_table.py
https://dev.kronoz.win/r/marzneshin.git
app/db/migrations/versions/20241127_79271458a973_drop_notification_reminders_table.py · Python
Blame Raw
 1"""drop notification reminders table
 2
 3Revision ID: 79271458a973
 4Revises: a015ed8ce227
 5Create Date: 2024-11-27 04:43:24.448736
 6
 7"""
 8
 9import sqlalchemy as sa
10from alembic import op
11
12# revision identifiers, used by Alembic.
13revision = "79271458a973"
14down_revision = "a015ed8ce227"
15branch_labels = None
16depends_on = None
17
18
19def upgrade() -> None:
20    # ### commands auto generated by Alembic - please adjust! ###
21    op.drop_table("notification_reminders")
22    # ### end Alembic commands ###
23
24
25def downgrade() -> None:
26    # ### commands auto generated by Alembic - please adjust! ###
27    op.create_table(
28        "notification_reminders",
29        sa.Column("id", sa.Integer(), nullable=False),
30        sa.Column("user_id", sa.Integer(), nullable=True),
31        sa.Column(
32            "type",
33            sa.Enum("expiration_date", "data_usage", name="remindertype"),
34            nullable=False,
35        ),
36        sa.Column("expires_at", sa.DateTime(), nullable=True),
37        sa.Column("created_at", sa.DateTime(), nullable=True),
38        sa.ForeignKeyConstraint(
39            ["user_id"],
40            ["users.id"],
41        ),
42        sa.PrimaryKeyConstraint("id"),
43    )
44    # ### end Alembic commands ###