initial functionality and styling pass
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,49 @@
|
||||
"""add is_admin
|
||||
|
||||
Revision ID: 426ed1b38bcf
|
||||
Revises: 79c2e82697ce
|
||||
Create Date: 2025-07-28 23:53:10.691918
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '426ed1b38bcf'
|
||||
down_revision = '79c2e82697ce'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('image_record',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('filename', sa.String(length=256), nullable=False),
|
||||
sa.Column('filepath', sa.String(length=512), nullable=False),
|
||||
sa.Column('hash', sa.String(length=64), nullable=False),
|
||||
sa.Column('artist', sa.String(length=128), nullable=False),
|
||||
sa.Column('file_size', sa.Integer(), nullable=True),
|
||||
sa.Column('width', sa.Integer(), nullable=True),
|
||||
sa.Column('height', sa.Integer(), nullable=True),
|
||||
sa.Column('format', sa.String(length=32), nullable=True),
|
||||
sa.Column('camera_model', sa.String(length=128), nullable=True),
|
||||
sa.Column('taken_at', sa.DateTime(), nullable=True),
|
||||
sa.Column('imported_at', sa.DateTime(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('hash')
|
||||
)
|
||||
with op.batch_alter_table('user', schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column('is_admin', sa.Boolean(), nullable=True))
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('user', schema=None) as batch_op:
|
||||
batch_op.drop_column('is_admin')
|
||||
|
||||
op.drop_table('image_record')
|
||||
# ### end Alembic commands ###
|
||||
@@ -0,0 +1,66 @@
|
||||
"""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 ###
|
||||
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user