"""add updated data Revision ID: 82908d30ae5a Revises: fcc0580a4769 Create Date: 2024-10-09 14:12:01.147393 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision: str = '82908d30ae5a' down_revision: Union[str, None] = 'fcc0580a4769' branch_labels: Union[str, Sequence[str], None] = None depends_on: Union[str, Sequence[str], None] = None def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.create_table('session_publisher', sa.Column('id', sa.String(length=36), nullable=False), sa.Column('user_id', sa.Integer(), nullable=True), sa.Column('metadata_id', sa.Integer(), nullable=True), sa.Column('created_at', sa.DateTime(), server_default=sa.text('CURRENT_TIMESTAMP'), nullable=False), sa.ForeignKeyConstraint(['metadata_id'], ['metadata.id'], ), sa.ForeignKeyConstraint(['user_id'], ['user.id'], ), sa.PrimaryKeyConstraint('id') ) op.create_index(op.f('ix_session_publisher_id'), 'session_publisher', ['id'], unique=False) op.add_column('metadata', sa.Column('thumbnail', sa.LargeBinary(), nullable=True)) op.add_column('planning', sa.Column('trials_id', sa.Integer(), nullable=True)) op.create_foreign_key(None, 'planning', 'trials', ['trials_id'], ['id']) op.drop_column('planning', 'token_planned') op.drop_column('planning', 'token_used') # ### end Alembic commands ### def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.add_column('planning', sa.Column('token_used', mysql.INTEGER(), autoincrement=False, nullable=False)) op.add_column('planning', sa.Column('token_planned', mysql.INTEGER(), autoincrement=False, nullable=False)) op.drop_constraint(None, 'planning', type_='foreignkey') op.drop_column('planning', 'trials_id') op.drop_column('metadata', 'thumbnail') op.drop_index(op.f('ix_session_publisher_id'), table_name='session_publisher') op.drop_table('session_publisher') # ### end Alembic commands ###