35 lines
1.2 KiB
Python
35 lines
1.2 KiB
Python
"""rename images in user table
|
|
|
|
Revision ID: 3d51075b5ece
|
|
Revises: b1bd8ecc3251
|
|
Create Date: 2023-08-08 19:45:21.470315
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
from sqlalchemy.dialects import mysql
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '3d51075b5ece'
|
|
down_revision = 'b1bd8ecc3251'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.add_column('user', sa.Column('avatar_image_filename', sa.String(length=128), nullable=True))
|
|
op.add_column('user', sa.Column('title_image_filename', sa.String(length=128), nullable=True))
|
|
op.drop_column('user', 'title_image_url')
|
|
op.drop_column('user', 'avatar_image_url')
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.add_column('user', sa.Column('avatar_image_url', mysql.VARCHAR(length=128), nullable=True))
|
|
op.add_column('user', sa.Column('title_image_url', mysql.VARCHAR(length=128), nullable=True))
|
|
op.drop_column('user', 'title_image_filename')
|
|
op.drop_column('user', 'avatar_image_filename')
|
|
# ### end Alembic commands ###
|