mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
feat: add PackageBase.MetaModifiedTS column
Since we cannot depend on InnoDB features across all mysql installations, we are instead using this new column to track metadata changes for a particular package base. This will allow us to fetch less data when producing metadata archives for end-users, and it does not depend on installation details aside from the schema/migrations being applied. New columns: - `PackageBase`.`MetaModifiedTS` Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
a84d115fa1
commit
94cc449a2d
6 changed files with 101 additions and 1 deletions
|
@ -0,0 +1,31 @@
|
|||
"""add MetaModifiedTS to PackageBase
|
||||
|
||||
Revision ID: 42584a60e7a7
|
||||
Revises: d64e5571bc8d
|
||||
Create Date: 2022-09-06 12:37:49.460344
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
from sqlalchemy.exc import OperationalError
|
||||
|
||||
from aurweb.models import PackageBase
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "42584a60e7a7"
|
||||
down_revision = "d64e5571bc8d"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
table = PackageBase.__tablename__
|
||||
|
||||
|
||||
def upgrade():
|
||||
try:
|
||||
op.add_column(table, PackageBase.__table__.c.MetaModifiedTS)
|
||||
except OperationalError as e:
|
||||
print(e)
|
||||
print("MetaModifiedTS column already exists")
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.remove_column(table, "MetaModifiedTS")
|
Loading…
Add table
Add a link
Reference in a new issue