0.2.0 initial commit
This commit is contained in:
commit
6f67d125af
38 changed files with 2051 additions and 0 deletions
77
alembic/versions/3bfaa1b74794_.py
Normal file
77
alembic/versions/3bfaa1b74794_.py
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
"""empty message
|
||||
|
||||
Revision ID: 3bfaa1b74794
|
||||
Revises:
|
||||
Create Date: 2023-11-19 15:50:38.211123
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '3bfaa1b74794'
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('image',
|
||||
sa.Column('id', sa.BigInteger(), nullable=False),
|
||||
sa.Column('type', sa.SmallInteger(), nullable=True),
|
||||
sa.Column('format', sa.SmallInteger(), nullable=True),
|
||||
sa.Column('name', sa.String(length=256), nullable=True),
|
||||
sa.Column('hash', sa.String(length=256), nullable=True),
|
||||
sa.Column('date', sa.DateTime(), nullable=True),
|
||||
sa.Column('size', sa.BigInteger(), nullable=True),
|
||||
sa.Column('pathname', sa.String(length=8192), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('pathname')
|
||||
)
|
||||
op.create_index(op.f('ix_image_date'), 'image', ['date'], unique=False)
|
||||
op.create_index(op.f('ix_image_hash'), 'image', ['hash'], unique=False)
|
||||
op.create_index(op.f('ix_image_name'), 'image', ['name'], unique=False)
|
||||
op.create_index(op.f('ix_image_type'), 'image', ['type'], unique=False)
|
||||
op.create_table('video',
|
||||
sa.Column('id', sa.BigInteger(), nullable=False),
|
||||
sa.Column('type', sa.SmallInteger(), nullable=True),
|
||||
sa.Column('format', sa.SmallInteger(), nullable=True),
|
||||
sa.Column('name', sa.String(length=256), nullable=True),
|
||||
sa.Column('duration', sa.Float(), nullable=True),
|
||||
sa.Column('date', sa.DateTime(), nullable=True),
|
||||
sa.Column('size', sa.BigInteger(), nullable=True),
|
||||
sa.Column('pathname', sa.String(length=8192), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('pathname')
|
||||
)
|
||||
op.create_index(op.f('ix_video_date'), 'video', ['date'], unique=False)
|
||||
op.create_index(op.f('ix_video_duration'), 'video', ['duration'], unique=False)
|
||||
op.create_index(op.f('ix_video_name'), 'video', ['name'], unique=False)
|
||||
op.create_index(op.f('ix_video_type'), 'video', ['type'], unique=False)
|
||||
op.create_table('imagetag',
|
||||
sa.Column('id', sa.BigInteger(), nullable=False),
|
||||
sa.Column('image_id', sa.BigInteger(), nullable=True),
|
||||
sa.Column('name', sa.String(length=64), nullable=True),
|
||||
sa.ForeignKeyConstraint(['image_id'], ['image.id'], ),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('image_id', 'name')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('imagetag')
|
||||
op.drop_index(op.f('ix_video_type'), table_name='video')
|
||||
op.drop_index(op.f('ix_video_name'), table_name='video')
|
||||
op.drop_index(op.f('ix_video_duration'), table_name='video')
|
||||
op.drop_index(op.f('ix_video_date'), table_name='video')
|
||||
op.drop_table('video')
|
||||
op.drop_index(op.f('ix_image_type'), table_name='image')
|
||||
op.drop_index(op.f('ix_image_name'), table_name='image')
|
||||
op.drop_index(op.f('ix_image_hash'), table_name='image')
|
||||
op.drop_index(op.f('ix_image_date'), table_name='image')
|
||||
op.drop_table('image')
|
||||
# ### end Alembic commands ###
|
||||
Loading…
Add table
Add a link
Reference in a new issue