open-law/migrations/versions/8f9233babba4_notifications.py
2023-06-08 15:22:32 +03:00

39 lines
1.1 KiB
Python

"""notifications
Revision ID: 8f9233babba4
Revises: 96995454b90d
Create Date: 2023-06-08 14:49:51.600531
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8f9233babba4'
down_revision = '96995454b90d'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('notifications',
sa.Column('link', sa.String(length=256), nullable=False),
sa.Column('text', sa.String(length=256), nullable=False),
sa.Column('is_read', sa.Boolean(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=True),
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('is_deleted', sa.Boolean(), nullable=True),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('notifications')
# ### end Alembic commands ###