Spaces:
Running
Running
File size: 1,445 Bytes
77c2932 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
"""Making Changes
Revision ID: a0b8222b39de
Revises: 70948dfaa0fc
Create Date: 2024-08-31 04:33:49.475927
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = 'a0b8222b39de'
down_revision: Union[str, None] = '70948dfaa0fc'
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('recommendation_models',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('model', sa.LargeBinary(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_recommendation_models_id'), 'recommendation_models', ['id'], unique=False)
op.drop_index('ix_users_username', table_name='users')
op.drop_column('users', 'username')
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('users', sa.Column('username', sa.VARCHAR(), autoincrement=False, nullable=False))
op.create_index('ix_users_username', 'users', ['username'], unique=True)
op.drop_index(op.f('ix_recommendation_models_id'), table_name='recommendation_models')
op.drop_table('recommendation_models')
# ### end Alembic commands ###
|