-
Notifications
You must be signed in to change notification settings - Fork 5
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 #69 from mobiusml/edr/video_bugs
Edr/video bugs
- Loading branch information
Showing
21 changed files
with
450 additions
and
279 deletions.
There are no files selected for viewing
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
46 changes: 46 additions & 0 deletions
46
aana/alembic/versions/0918cb09ac67_name_constraints_fix_cascading_deletes.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,46 @@ | ||
"""Name constraints, fix cascading deletes. | ||
Revision ID: 0918cb09ac67 | ||
Revises: 86a31568e6c2 | ||
Create Date: 2024-03-07 12:56:36.129852 | ||
""" | ||
from collections.abc import Sequence | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "0918cb09ac67" | ||
down_revision: str | None = "86a31568e6c2" | ||
branch_labels: str | Sequence[str] | None = None | ||
depends_on: str | Sequence[str] | None = None | ||
|
||
|
||
def upgrade() -> None: | ||
"""Upgrade database to this revision from previous.""" | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("media", schema=None) as batch_op: | ||
batch_op.drop_constraint("fk_media_video_id_video", type_="foreignkey") | ||
batch_op.create_foreign_key( | ||
batch_op.f("fk_media_video_id_video"), | ||
"video", | ||
["video_id"], | ||
["id"], | ||
ondelete="CASCADE", | ||
) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
"""Downgrade database from this revision to previous.""" | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("media", schema=None) as batch_op: | ||
batch_op.drop_constraint( | ||
batch_op.f("fk_media_video_id_video"), type_="foreignkey" | ||
) | ||
batch_op.create_foreign_key( | ||
"fk_media_video_id_video", "video", ["video_id"], ["id"] | ||
) | ||
|
||
# ### end Alembic commands ### |
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
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.