-
Notifications
You must be signed in to change notification settings - Fork 798
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add observer_thought_id to artifacts table
- Loading branch information
1 parent
18762f5
commit d6185b9
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
alembic/versions/2024_12_06_1751-b2b7b23646e9_add_observer_thought_id_column_to_.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,39 @@ | ||
"""Add observer_thought_id column to artifacts table | ||
Revision ID: b2b7b23646e9 | ||
Revises: 4d51ed4719d5 | ||
Create Date: 2024-12-06 17:51:28.372085+00:00 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
import sqlalchemy as sa | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "b2b7b23646e9" | ||
down_revision: Union[str, None] = "4d51ed4719d5" | ||
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("artifacts", sa.Column("observer_thought_id", sa.String(), nullable=True)) | ||
op.create_foreign_key( | ||
"artifacts_observer_thought_id_fkey", | ||
"artifacts", | ||
"observer_thoughts", | ||
["observer_thought_id"], | ||
["observer_thought_id"], | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_constraint("artifacts_observer_thought_id_fkey", "artifacts", type_="foreignkey") | ||
op.drop_column("artifacts", "observer_thought_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