mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-01 12:26:19 -05:00
68 lines
2.4 KiB
Python
68 lines
2.4 KiB
Python
"""collections feature
|
|
|
|
Revision ID: f38cfe4b5cb2
|
|
Revises: add_unique_collection_name_kind
|
|
Create Date: 2025-11-29 16:51:34.222412
|
|
|
|
"""
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
from sqlalchemy.dialects import postgresql
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = 'f38cfe4b5cb2'
|
|
down_revision = 'add_unique_collection_name_kind'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.alter_column('archive', 'collection_id',
|
|
existing_type=sa.INTEGER(),
|
|
nullable=True)
|
|
op.alter_column('file_group', 'mimetype',
|
|
existing_type=sa.TEXT(),
|
|
nullable=True)
|
|
op.alter_column('tag_file', 'tag_id',
|
|
existing_type=sa.INTEGER(),
|
|
nullable=False)
|
|
op.alter_column('tag_file', 'file_group_id',
|
|
existing_type=sa.BIGINT(),
|
|
nullable=False)
|
|
op.alter_column('tag_zim', 'tag_id',
|
|
existing_type=sa.INTEGER(),
|
|
nullable=False)
|
|
op.alter_column('tag_zim', 'zim_id',
|
|
existing_type=sa.INTEGER(),
|
|
nullable=False)
|
|
op.drop_index('video_upload_date_idx', table_name='video')
|
|
op.drop_column('video', 'duration')
|
|
op.drop_column('video', 'upload_date')
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.add_column('video', sa.Column('upload_date', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True))
|
|
op.add_column('video', sa.Column('duration', sa.INTEGER(), autoincrement=False, nullable=True))
|
|
op.create_index('video_upload_date_idx', 'video', ['upload_date'], unique=False)
|
|
op.alter_column('tag_zim', 'zim_id',
|
|
existing_type=sa.INTEGER(),
|
|
nullable=True)
|
|
op.alter_column('tag_zim', 'tag_id',
|
|
existing_type=sa.INTEGER(),
|
|
nullable=True)
|
|
op.alter_column('tag_file', 'file_group_id',
|
|
existing_type=sa.BIGINT(),
|
|
nullable=True)
|
|
op.alter_column('tag_file', 'tag_id',
|
|
existing_type=sa.INTEGER(),
|
|
nullable=True)
|
|
op.alter_column('archive', 'collection_id',
|
|
existing_type=sa.INTEGER(),
|
|
nullable=False)
|
|
op.alter_column('file_group', 'mimetype',
|
|
existing_type=sa.TEXT(),
|
|
nullable=False)
|
|
# ### end Alembic commands ###
|