-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from eoyilmaz/121-add-reviewversion-attribute
121 add reviewversion attribute
- Loading branch information
Showing
14 changed files
with
512 additions
and
127 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
alembic/versions/a2007ad7f535_added_review_version_id_column.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""Added Review.version_id column | ||
Revision ID: a2007ad7f535 | ||
Revises: 91ed52b72b82 | ||
Create Date: 2024-11-26 11:36:07.776169 | ||
""" | ||
|
||
from alembic import op | ||
|
||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "a2007ad7f535" | ||
down_revision = "91ed52b72b82" | ||
|
||
|
||
def upgrade(): | ||
"""Upgrade the tables.""" | ||
op.add_column("Reviews", sa.Column("version_id", sa.Integer(), nullable=True)) | ||
op.create_foreign_key( | ||
"Reviews_version_id_fkey", | ||
"Reviews", | ||
"Versions", | ||
["version_id"], | ||
["id"], | ||
) | ||
|
||
|
||
def downgrade(): | ||
"""Downgrade the tables.""" | ||
op.drop_constraint("Reviews_version_id_fkey", "Reviews", type_="foreignkey") | ||
op.drop_column("Reviews", "version_id") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.