mirror of
https://github.com/tropicoo/yt-dlp-bot.git
synced 2025-03-01 17:23:25 +08:00
49 lines
1.5 KiB
Python
49 lines
1.5 KiB
Python
"""empty message
|
|
|
|
Revision ID: da4a97a0fdb7
|
|
Revises: 6221c0018660
|
|
Create Date: 2022-03-19 10:46:57.624753
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
import sqlalchemy_utils
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = 'da4a97a0fdb7'
|
|
down_revision = '6221c0018660'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table(
|
|
'cache',
|
|
sa.Column('created', sa.DateTime(), nullable=False),
|
|
sa.Column('updated', sa.DateTime(), nullable=False),
|
|
sa.Column(
|
|
'id', sqlalchemy_utils.types.uuid.UUIDType(binary=False), nullable=False
|
|
),
|
|
sa.Column('cache_id', sa.String(), nullable=False),
|
|
sa.Column('cache_unique_id', sa.String(), nullable=False),
|
|
sa.Column('file_size', sa.Integer(), nullable=False),
|
|
sa.Column('date_timestamp', sa.DateTime(), nullable=False),
|
|
sa.Column(
|
|
'file_id',
|
|
sqlalchemy_utils.types.uuid.UUIDType(binary=False),
|
|
nullable=False,
|
|
),
|
|
sa.ForeignKeyConstraint(['file_id'], ['file.id'], ondelete='CASCADE'),
|
|
sa.PrimaryKeyConstraint('id'),
|
|
)
|
|
op.create_index(op.f('ix_cache_file_id'), 'cache', ['file_id'], unique=True)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_index(op.f('ix_cache_file_id'), table_name='cache')
|
|
op.drop_table('cache')
|
|
# ### end Alembic commands ###
|