This repository has been archived by the owner on Dec 11, 2024. It is now read-only.
forked from onyx-dot-app/onyx
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #33 from mindvalley/chore/merge-upstream-20240512501
chore/merge upstream 20240512501
- Loading branch information
Showing
109 changed files
with
5,049 additions
and
1,057 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
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
68 changes: 68 additions & 0 deletions
68
backend/alembic/versions/70f00c45c0f2_more_descriptive_filestore.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,68 @@ | ||
"""More Descriptive Filestore | ||
Revision ID: 70f00c45c0f2 | ||
Revises: 3879338f8ba1 | ||
Create Date: 2024-05-17 17:51:41.926893 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "70f00c45c0f2" | ||
down_revision = "3879338f8ba1" | ||
branch_labels: None = None | ||
depends_on: None = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.add_column("file_store", sa.Column("display_name", sa.String(), nullable=True)) | ||
op.add_column( | ||
"file_store", | ||
sa.Column( | ||
"file_origin", | ||
sa.String(), | ||
nullable=False, | ||
server_default="connector", # Default to connector | ||
), | ||
) | ||
op.add_column( | ||
"file_store", | ||
sa.Column( | ||
"file_type", sa.String(), nullable=False, server_default="text/plain" | ||
), | ||
) | ||
op.add_column( | ||
"file_store", | ||
sa.Column( | ||
"file_metadata", | ||
postgresql.JSONB(astext_type=sa.Text()), | ||
nullable=True, | ||
), | ||
) | ||
|
||
op.execute( | ||
""" | ||
UPDATE file_store | ||
SET file_origin = CASE | ||
WHEN file_name LIKE 'chat__%' THEN 'chat_upload' | ||
ELSE 'connector' | ||
END, | ||
file_name = CASE | ||
WHEN file_name LIKE 'chat__%' THEN SUBSTR(file_name, 7) | ||
ELSE file_name | ||
END, | ||
file_type = CASE | ||
WHEN file_name LIKE 'chat__%' THEN 'image/png' | ||
ELSE 'text/plain' | ||
END | ||
""" | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
op.drop_column("file_store", "file_metadata") | ||
op.drop_column("file_store", "file_type") | ||
op.drop_column("file_store", "file_origin") | ||
op.drop_column("file_store", "display_name") |
31 changes: 31 additions & 0 deletions
31
backend/alembic/versions/ec85f2b3c544_remove_last_attempt_status_from_cc_pair.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,31 @@ | ||
"""Remove Last Attempt Status from CC Pair | ||
Revision ID: ec85f2b3c544 | ||
Revises: 3879338f8ba1 | ||
Create Date: 2024-05-23 21:39:46.126010 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "ec85f2b3c544" | ||
down_revision = "70f00c45c0f2" | ||
branch_labels: None = None | ||
depends_on: None = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.drop_column("connector_credential_pair", "last_attempt_status") | ||
|
||
|
||
def downgrade() -> None: | ||
op.add_column( | ||
"connector_credential_pair", | ||
sa.Column( | ||
"last_attempt_status", | ||
sa.VARCHAR(), | ||
autoincrement=False, | ||
nullable=True, | ||
), | ||
) |
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.