42 lines
1.2 KiB
Python
42 lines
1.2 KiB
Python
|
|
"""
|
||
|
|
|
||
|
|
Revision ID: 2e92816ea461
|
||
|
|
Revises: 36eb607a5bf0
|
||
|
|
Create Date: 2026-06-14 19:54:48.977452
|
||
|
|
|
||
|
|
"""
|
||
|
|
from typing import Sequence, Union
|
||
|
|
|
||
|
|
from alembic import op
|
||
|
|
import sqlalchemy as sa
|
||
|
|
|
||
|
|
|
||
|
|
# revision identifiers, used by Alembic.
|
||
|
|
revision: str = '2e92816ea461'
|
||
|
|
down_revision: Union[str, Sequence[str], None] = '36eb607a5bf0'
|
||
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
||
|
|
depends_on: Union[str, Sequence[str], None] = None
|
||
|
|
|
||
|
|
|
||
|
|
def upgrade() -> None:
|
||
|
|
"""Upgrade schema."""
|
||
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
|
op.create_table('images',
|
||
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
||
|
|
sa.Column('entry_id', sa.Integer(), nullable=False),
|
||
|
|
sa.Column('path', sa.String(length=255), nullable=False),
|
||
|
|
sa.ForeignKeyConstraint(['entry_id'], ['entries.id'], ),
|
||
|
|
sa.PrimaryKeyConstraint('id'),
|
||
|
|
sa.UniqueConstraint('entry_id')
|
||
|
|
)
|
||
|
|
op.create_index(op.f('ix_images_id'), 'images', ['id'], unique=False)
|
||
|
|
# ### end Alembic commands ###
|
||
|
|
|
||
|
|
|
||
|
|
def downgrade() -> None:
|
||
|
|
"""Downgrade schema."""
|
||
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
||
|
|
op.drop_index(op.f('ix_images_id'), table_name='images')
|
||
|
|
op.drop_table('images')
|
||
|
|
# ### end Alembic commands ###
|