Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop md5sum column from Package model #221

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions migrations/versions/d0b4cb352ca1_drop_package_md5sum_column.py
Original file line number Diff line number Diff line change
@@ -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 ###
3 changes: 1 addition & 2 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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

Expand Down
1 change: 0 additions & 1 deletion tracker/maintenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down
1 change: 0 additions & 1 deletion tracker/model/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Loading