mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-03 00:31:25 -08:00
52 lines
1.7 KiB
Python
52 lines
1.7 KiB
Python
|
"""notifications
|
||
|
|
||
|
Revision ID: f5706aa6b94c
|
||
|
Revises: ee45b9ea4a0c
|
||
|
Create Date: 2023-11-30 19:21:04.549875
|
||
|
|
||
|
"""
|
||
|
from alembic import op
|
||
|
import sqlalchemy as sa
|
||
|
|
||
|
|
||
|
# revision identifiers, used by Alembic.
|
||
|
revision = 'f5706aa6b94c'
|
||
|
down_revision = 'ee45b9ea4a0c'
|
||
|
branch_labels = None
|
||
|
depends_on = None
|
||
|
|
||
|
|
||
|
def upgrade():
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
op.create_table('notification',
|
||
|
sa.Column('id', sa.Integer(), nullable=False),
|
||
|
sa.Column('title', sa.String(length=50), nullable=True),
|
||
|
sa.Column('url', sa.String(length=512), nullable=True),
|
||
|
sa.Column('read', sa.Boolean(), nullable=True),
|
||
|
sa.Column('user_id', sa.Integer(), nullable=True),
|
||
|
sa.Column('author_id', sa.Integer(), nullable=True),
|
||
|
sa.Column('created_at', sa.DateTime(), nullable=True),
|
||
|
sa.ForeignKeyConstraint(['author_id'], ['user.id'], ),
|
||
|
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
|
||
|
sa.PrimaryKeyConstraint('id')
|
||
|
)
|
||
|
with op.batch_alter_table('post', schema=None) as batch_op:
|
||
|
batch_op.add_column(sa.Column('notify_author', sa.Boolean(), nullable=True))
|
||
|
|
||
|
with op.batch_alter_table('post_reply', schema=None) as batch_op:
|
||
|
batch_op.add_column(sa.Column('notify_author', sa.Boolean(), nullable=True))
|
||
|
|
||
|
# ### end Alembic commands ###
|
||
|
|
||
|
|
||
|
def downgrade():
|
||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
with op.batch_alter_table('post_reply', schema=None) as batch_op:
|
||
|
batch_op.drop_column('notify_author')
|
||
|
|
||
|
with op.batch_alter_table('post', schema=None) as batch_op:
|
||
|
batch_op.drop_column('notify_author')
|
||
|
|
||
|
op.drop_table('notification')
|
||
|
# ### end Alembic commands ###
|