-
Notifications
You must be signed in to change notification settings - Fork 233
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 #1994 from Agenta-AI/feature/age-540-endpoint-for-…
…app-type [Enhancement]: Add 'app_type' column for AppDB model with updated API responses
- Loading branch information
Showing
12 changed files
with
146 additions
and
20 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
60 changes: 60 additions & 0 deletions
60
...end/migrations/postgres/versions/0f086ebc2f82_added_the_app_type_column_to_the_app_db_.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,60 @@ | ||
"""Added the 'app_type' column to the 'app_db' table | ||
Revision ID: 0f086ebc2f82 | ||
Revises: 78cde3fc549c | ||
Create Date: 2024-09-09 10:11:05.429116 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "0f086ebc2f82" | ||
down_revision: Union[str, None] = "847972cfa14a" | ||
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! ### | ||
|
||
# Create the enum type first | ||
app_enumtype = sa.Enum( | ||
"CHAT_TEMPLATE", | ||
"COMPLETION_TEMPLATE", | ||
"CUSTOM", | ||
name="app_enumtype", | ||
) | ||
app_enumtype.create(op.get_bind(), checkfirst=True) | ||
|
||
# Then add the column using the enum type | ||
op.add_column( | ||
"app_db", | ||
sa.Column( | ||
"app_type", | ||
app_enumtype, | ||
nullable=True, | ||
), | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
|
||
# Drop the column first | ||
op.drop_column("app_db", "app_type") | ||
|
||
# Then drop the enum type | ||
app_enumtype = sa.Enum( | ||
"CHAT_TEMPLATE", | ||
"COMPLETION_TEMPLATE", | ||
"CUSTOM", | ||
name="app_enumtype", | ||
) | ||
app_enumtype.drop(op.get_bind(), checkfirst=True) | ||
# ### 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
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