mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
See doc/git-archive.md for general Git archive specifications See doc/repos/metadata-repo.md for info and direction related to the new Git metadata archive
33 lines
750 B
Python
33 lines
750 B
Python
"""add PopularityUpdated to PackageBase
|
|
|
|
Revision ID: 6441d3b65270
|
|
Revises: d64e5571bc8d
|
|
Create Date: 2022-09-22 18:08:03.280664
|
|
|
|
"""
|
|
from alembic import op
|
|
from sqlalchemy.exc import OperationalError
|
|
|
|
from aurweb.models.package_base import PackageBase
|
|
from aurweb.scripts import popupdate
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "6441d3b65270"
|
|
down_revision = "d64e5571bc8d"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
table = PackageBase.__table__
|
|
|
|
|
|
def upgrade():
|
|
try:
|
|
op.add_column(table.name, table.c.PopularityUpdated)
|
|
except OperationalError:
|
|
print(f"table '{table.name}' already exists, skipping migration")
|
|
|
|
popupdate.run_variable()
|
|
|
|
|
|
def downgrade():
|
|
op.drop_column(table.name, "PopularityUpdated")
|