From 6c59ef8cb83bc5ba29bb1d046873f82b58d3e36c Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Thu, 5 Dec 2024 13:47:08 +1300 Subject: [PATCH] migration to remove related field #371 --- app/models.py | 1 - .../f2fa25ab5e52_remove_home_checkbox.py | 32 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 migrations/versions/f2fa25ab5e52_remove_home_checkbox.py diff --git a/app/models.py b/app/models.py index 82cd2465..e19e2a28 100644 --- a/app/models.py +++ b/app/models.py @@ -456,7 +456,6 @@ class Community(db.Model): private_mods = db.Column(db.Boolean, default=False) # Which feeds posts from this community show up in - show_home = db.Column(db.Boolean, default=False) # unused show_popular = db.Column(db.Boolean, default=True) show_all = db.Column(db.Boolean, default=True) diff --git a/migrations/versions/f2fa25ab5e52_remove_home_checkbox.py b/migrations/versions/f2fa25ab5e52_remove_home_checkbox.py new file mode 100644 index 00000000..af8d4527 --- /dev/null +++ b/migrations/versions/f2fa25ab5e52_remove_home_checkbox.py @@ -0,0 +1,32 @@ +"""remove home checkbox + +Revision ID: f2fa25ab5e52 +Revises: 98680738ebb0 +Create Date: 2024-12-05 13:46:20.291051 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'f2fa25ab5e52' +down_revision = '98680738ebb0' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + with op.batch_alter_table('community', schema=None) as batch_op: + batch_op.drop_column('show_home') + + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + with op.batch_alter_table('community', schema=None) as batch_op: + batch_op.add_column(sa.Column('show_home', sa.BOOLEAN(), autoincrement=False, nullable=True)) + + # ### end Alembic commands ###