This repository has been archived on 2026-05-31. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
imagerepo/migrations/versions/9c3559ba0427_phashing_changes.py
2025-07-29 00:34:03 -04:00

67 lines
2.3 KiB
Python

"""phashing changes
Revision ID: 9c3559ba0427
Revises: 426ed1b38bcf
Create Date: 2025-07-29 01:53:50.446751
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9c3559ba0427'
down_revision = '426ed1b38bcf'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('image_record', schema=None) as batch_op:
batch_op.add_column(sa.Column('perceptual_hash', sa.String(length=16), nullable=True))
batch_op.add_column(sa.Column('is_thumbnail', sa.Boolean(), nullable=True))
batch_op.alter_column('filename',
existing_type=sa.VARCHAR(length=256),
type_=sa.String(length=255),
existing_nullable=False)
batch_op.alter_column('artist',
existing_type=sa.VARCHAR(length=128),
type_=sa.String(length=255),
nullable=True)
batch_op.alter_column('format',
existing_type=sa.VARCHAR(length=32),
type_=sa.String(length=10),
existing_nullable=True)
batch_op.alter_column('camera_model',
existing_type=sa.VARCHAR(length=128),
type_=sa.String(length=255),
existing_nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('image_record', schema=None) as batch_op:
batch_op.alter_column('camera_model',
existing_type=sa.String(length=255),
type_=sa.VARCHAR(length=128),
existing_nullable=True)
batch_op.alter_column('format',
existing_type=sa.String(length=10),
type_=sa.VARCHAR(length=32),
existing_nullable=True)
batch_op.alter_column('artist',
existing_type=sa.String(length=255),
type_=sa.VARCHAR(length=128),
nullable=False)
batch_op.alter_column('filename',
existing_type=sa.String(length=255),
type_=sa.VARCHAR(length=256),
existing_nullable=False)
batch_op.drop_column('is_thumbnail')
batch_op.drop_column('perceptual_hash')
# ### end Alembic commands ###