diff --git a/migrations/versions/d0b4cb352ca1_drop_package_md5sum_column.py b/migrations/versions/d0b4cb352ca1_drop_package_md5sum_column.py new file mode 100644 index 0000000..edbf74d --- /dev/null +++ b/migrations/versions/d0b4cb352ca1_drop_package_md5sum_column.py @@ -0,0 +1,31 @@ +"""drop package.md5sum column + +Revision ID: d0b4cb352ca1 +Revises: 2a69a8406f71 +Create Date: 2024-03-25 10:09:20.603755 + +""" +import sqlalchemy as sa +from alembic import op + +# revision identifiers, used by Alembic. +revision = 'd0b4cb352ca1' +down_revision = '2a69a8406f71' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + with op.batch_alter_table('package', schema=None) as batch_op: + batch_op.drop_column('md5sum') + + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + with op.batch_alter_table('package', schema=None) as batch_op: + batch_op.add_column(sa.Column('md5sum', sa.VARCHAR(length=32), nullable=False)) + + # ### end Alembic commands ### diff --git a/test/conftest.py b/test/conftest.py index 8ab12b8..3419d85 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -194,7 +194,7 @@ def wrapper(db, *args, **kwargs): def create_package(func=None, id=None, name=None, base=None, version='1.0-1', arch='any', database='core', description='', url=None, filename='somefile-1.0-1-any.tar.xz', - md5sum='md5', sha256sum='sha256', builddate=0): + sha256sum='sha256', builddate=0): def decorator(func): @wraps(func) def wrapper(db, *args, **kwargs): @@ -209,7 +209,6 @@ def wrapper(db, *args, **kwargs): package.description = description package.url = url package.filename = filename - package.md5sum = md5sum package.sha256sum = sha256sum package.builddate = builddate diff --git a/tracker/maintenance.py b/tracker/maintenance.py index 8fe849c..12e11a1 100644 --- a/tracker/maintenance.py +++ b/tracker/maintenance.py @@ -86,7 +86,6 @@ def update_package_cache(): 'arch': package.arch, 'database': package.db.name, 'filename': package.filename, - 'md5sum': package.md5sum, 'sha256sum': package.sha256sum, 'builddate': package.builddate }) diff --git a/tracker/model/package.py b/tracker/model/package.py index cf57d24..53b3f1f 100644 --- a/tracker/model/package.py +++ b/tracker/model/package.py @@ -18,7 +18,6 @@ class Package(db.Model): description = db.Column(db.String(256), nullable=False) url = db.Column(db.String(192)) filename = db.Column(db.String(128), nullable=False) - md5sum = db.Column(db.String(32), nullable=False) sha256sum = db.Column(db.String(64), nullable=False) builddate = db.Column(db.Integer(), nullable=False)