mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
feat: allow users to hide deleted comments
Closes: #435 Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
This commit is contained in:
parent
174af5f025
commit
6ede837b4f
9 changed files with 132 additions and 5 deletions
|
@ -0,0 +1,33 @@
|
|||
"""Add HideDeletedComments to User
|
||||
|
||||
Revision ID: e4e49ffce091
|
||||
Revises: 9e3158957fd7
|
||||
Create Date: 2023-04-19 23:24:25.854874
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
from sqlalchemy.exc import OperationalError
|
||||
|
||||
from aurweb.models.user import User
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "e4e49ffce091"
|
||||
down_revision = "9e3158957fd7"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
table = User.__table__
|
||||
|
||||
|
||||
def upgrade():
|
||||
try:
|
||||
op.add_column(table.name, table.c.HideDeletedComments)
|
||||
except OperationalError:
|
||||
print(
|
||||
f"Column HideDeletedComments already exists in '{table.name}',"
|
||||
f" skipping migration."
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_column(table.name, "HideDeletedComments")
|
Loading…
Add table
Add a link
Reference in a new issue