From ca51f3a268690ccd5cee1c62d2a249a0a075506b Mon Sep 17 00:00:00 2001 From: Roland Date: Tue, 8 Oct 2024 17:18:57 -0600 Subject: [PATCH] Making Channel.tag_id migration lazier to avoid rare errors. --- alembic/versions/d4e446637f18_channel_tag.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alembic/versions/d4e446637f18_channel_tag.py b/alembic/versions/d4e446637f18_channel_tag.py index 7a99eefd..b149ccfa 100644 --- a/alembic/versions/d4e446637f18_channel_tag.py +++ b/alembic/versions/d4e446637f18_channel_tag.py @@ -23,7 +23,7 @@ def upgrade(): bind = op.get_bind() session = Session(bind=bind) - session.execute('ALTER TABLE channel ADD COLUMN tag_id INTEGER REFERENCES tag(id)') + session.execute('ALTER TABLE channel ADD COLUMN IF NOT EXISTS tag_id INTEGER REFERENCES tag(id)') def downgrade():