From 4a6e203d23cda72154c3215f85d51f4db8d7f416 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Tue, 19 Jul 2022 21:09:54 +0200 Subject: [PATCH] Fix latest migration --- .../8ae9fc9ac88c_webmention_notifications.py | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 alembic/versions/8ae9fc9ac88c_webmention_notifications.py diff --git a/alembic/versions/8ae9fc9ac88c_webmention_notifications.py b/alembic/versions/8ae9fc9ac88c_webmention_notifications.py new file mode 100644 index 0000000..18893a2 --- /dev/null +++ b/alembic/versions/8ae9fc9ac88c_webmention_notifications.py @@ -0,0 +1,34 @@ +"""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 ###