Personal-Digital-Asset-Manager/migrations/versions/ac1b5e061bd9_initial_migration.py
2025-05-24 10:38:21 -04:00

46 lines
1.4 KiB
Python

"""Initial migration
Revision ID: ac1b5e061bd9
Revises:
Create Date: 2025-05-24 09:23:49.162560
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ac1b5e061bd9'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('asset',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('title', sa.String(length=100), nullable=False),
sa.Column('description', sa.Text(), nullable=True),
sa.Column('featured_image', sa.String(length=200), nullable=True),
sa.Column('original_featured_image', sa.String(length=200), nullable=True),
sa.Column('license_key', sa.String(length=255), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_table('asset_file',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('filename', sa.String(length=200), nullable=False),
sa.Column('original_filename', sa.String(length=200), nullable=True),
sa.Column('asset_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['asset_id'], ['asset.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('asset_file')
op.drop_table('asset')
# ### end Alembic commands ###