Skip to content

Commit

Permalink
Update alembic_check.sh to use 'alembic upgrade head' instead of 'ale…
Browse files Browse the repository at this point in the history
…mbic stamp head'
  • Loading branch information
quang-ng committed Dec 4, 2024
1 parent 363af51 commit 0de9daa
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 245 deletions.
32 changes: 32 additions & 0 deletions alembic/versions/5128cc2fe488_remove_fk_in_document_able.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""remove fk in document able
Revision ID: 5128cc2fe488
Revises: 73817166f499
Create Date: 2024-12-04 17:14:10.177083
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '5128cc2fe488'
down_revision: Union[str, None] = '73817166f499'
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.drop_constraint('documents_work_id_fkey', 'documents', type_='foreignkey')
op.drop_column('documents', 'work_id')
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('documents', sa.Column('work_id', sa.INTEGER(), autoincrement=False, nullable=True))
op.create_foreign_key('documents_work_id_fkey', 'documents', 'works', ['work_id'], ['id'])
# ### end Alembic commands ###
244 changes: 0 additions & 244 deletions alembic/versions/529debf3992c_fix_cycle_issue_between_work_and_doc.py

This file was deleted.

2 changes: 1 addition & 1 deletion alembic_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ echo "=================================="

# Run alembic check
echo "Running alembic check..."
alembic stamp head
alembic upgrade head
alembic check

# Store the exit code
Expand Down

0 comments on commit 0de9daa

Please sign in to comment.