[add] migration script
This commit is contained in:
32
api/migrations/versions/ef0787b85c35_202602061233.py
Normal file
32
api/migrations/versions/ef0787b85c35_202602061233.py
Normal file
@@ -0,0 +1,32 @@
|
||||
"""202602061233
|
||||
|
||||
Revision ID: ef0787b85c35
|
||||
Revises: 9b28b66cf8e8
|
||||
Create Date: 2026-02-06 12:33:26.114673
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'ef0787b85c35'
|
||||
down_revision: Union[str, None] = '9b28b66cf8e8'
|
||||
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.add_column('files', sa.Column('file_url', sa.String(), nullable=True, comment='file comes from a website url'))
|
||||
op.create_index(op.f('ix_files_file_url'), 'files', ['file_url'], unique=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f('ix_files_file_url'), table_name='files')
|
||||
op.drop_column('files', 'file_url')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user