microblog.pub/alembic/versions/8ae9fc9ac88c_webmention_notifications.py

35 lines
1,011 B
Python
Raw Normal View History

2022-07-19 19:09:54 +00:00
"""Webmention notifications
Revision ID: 8ae9fc9ac88c
Revises: 2b51ae7047cb
Create Date: 2022-07-19 21:09:04.786032
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '8ae9fc9ac88c'
down_revision = '2b51ae7047cb'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('notifications', schema=None) as batch_op:
batch_op.add_column(sa.Column('webmention_id', sa.Integer(), nullable=True))
batch_op.create_foreign_key('fk_webmention_id', 'webmention', ['webmention_id'], ['id'])
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('notifications', schema=None) as batch_op:
batch_op.drop_constraint('fk_webmention_id', type_='foreignkey')
batch_op.drop_column('webmention_id')
# ### end Alembic commands ###