diff --git a/alembic/versions/150ac8a20e59_change_schema.py b/alembic/versions/150ac8a20e59_change_schema.py new file mode 100644 index 00000000..22c9aeec --- /dev/null +++ b/alembic/versions/150ac8a20e59_change_schema.py @@ -0,0 +1,126 @@ +"""change schema + +Revision ID: 150ac8a20e59 +Revises: 7334713b30a6 +Create Date: 2025-07-29 12:44:15.804586 + +""" + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision = "150ac8a20e59" +down_revision = "7334713b30a6" +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table( + "sharepoint_property_sync", + sa.Column("id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("created_by", postgresql.UUID(as_uuid=True), nullable=True), + sa.Column("created_at", sa.DateTime(), nullable=True), + sa.Column("updated_at", sa.DateTime(), nullable=True), + sa.Column("integration_id", postgresql.UUID(as_uuid=True), nullable=True), + sa.Column("config", sa.JSON(), nullable=True), + sa.Column("logs", sa.ARRAY(sa.String()), nullable=True), + sa.Column("state", sa.String(), nullable=True), + sa.ForeignKeyConstraint(["created_by"], ["user.id"], ondelete="SET NULL"), + sa.ForeignKeyConstraint( + ["integration_id"], ["cognition.integration.id"], ondelete="CASCADE" + ), + sa.PrimaryKeyConstraint("id"), + schema="integration", + ) + op.create_index( + op.f("ix_integration_sharepoint_property_sync_created_by"), + "sharepoint_property_sync", + ["created_by"], + unique=False, + schema="integration", + ) + op.create_index( + op.f("ix_integration_sharepoint_property_sync_integration_id"), + "sharepoint_property_sync", + ["integration_id"], + unique=False, + schema="integration", + ) + op.drop_index( + "ix_sharepoint_property_sync_created_by", table_name="sharepoint_property_sync" + ) + op.drop_index( + "ix_sharepoint_property_sync_integration_id", + table_name="sharepoint_property_sync", + ) + op.drop_table("sharepoint_property_sync") + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table( + "sharepoint_property_sync", + sa.Column("id", postgresql.UUID(), autoincrement=False, nullable=False), + sa.Column("created_by", postgresql.UUID(), autoincrement=False, nullable=True), + sa.Column( + "created_at", postgresql.TIMESTAMP(), autoincrement=False, nullable=True + ), + sa.Column( + "updated_at", postgresql.TIMESTAMP(), autoincrement=False, nullable=True + ), + sa.Column( + "integration_id", postgresql.UUID(), autoincrement=False, nullable=True + ), + sa.Column( + "config", + postgresql.JSON(astext_type=sa.Text()), + autoincrement=False, + nullable=True, + ), + sa.Column( + "logs", postgresql.ARRAY(sa.VARCHAR()), autoincrement=False, nullable=True + ), + sa.Column("state", sa.VARCHAR(), autoincrement=False, nullable=True), + sa.ForeignKeyConstraint( + ["created_by"], + ["user.id"], + name="sharepoint_property_sync_created_by_fkey", + ondelete="SET NULL", + ), + sa.ForeignKeyConstraint( + ["integration_id"], + ["cognition.integration.id"], + name="sharepoint_property_sync_integration_id_fkey", + ondelete="CASCADE", + ), + sa.PrimaryKeyConstraint("id", name="sharepoint_property_sync_pkey"), + ) + op.create_index( + "ix_sharepoint_property_sync_integration_id", + "sharepoint_property_sync", + ["integration_id"], + unique=False, + ) + op.create_index( + "ix_sharepoint_property_sync_created_by", + "sharepoint_property_sync", + ["created_by"], + unique=False, + ) + op.drop_index( + op.f("ix_integration_sharepoint_property_sync_integration_id"), + table_name="sharepoint_property_sync", + schema="integration", + ) + op.drop_index( + op.f("ix_integration_sharepoint_property_sync_created_by"), + table_name="sharepoint_property_sync", + schema="integration", + ) + op.drop_table("sharepoint_property_sync", schema="integration") + # ### end Alembic commands ### diff --git a/alembic/versions/7334713b30a6_add_integration_sharepoint_property_sync.py b/alembic/versions/7334713b30a6_add_integration_sharepoint_property_sync.py new file mode 100644 index 00000000..3de02d80 --- /dev/null +++ b/alembic/versions/7334713b30a6_add_integration_sharepoint_property_sync.py @@ -0,0 +1,64 @@ +"""add integration sharepoint property sync + +Revision ID: 7334713b30a6 +Revises: 6868ac66ea92 +Create Date: 2025-07-29 12:31:04.171629 + +""" + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision = "7334713b30a6" +down_revision = "312568866ac4" +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table( + "sharepoint_property_sync", + sa.Column("id", postgresql.UUID(as_uuid=True), nullable=False), + sa.Column("created_by", postgresql.UUID(as_uuid=True), nullable=True), + sa.Column("created_at", sa.DateTime(), nullable=True), + sa.Column("updated_at", sa.DateTime(), nullable=True), + sa.Column("integration_id", postgresql.UUID(as_uuid=True), nullable=True), + sa.Column("config", sa.JSON(), nullable=True), + sa.Column("logs", sa.ARRAY(sa.String()), nullable=True), + sa.Column("state", sa.String(), nullable=True), + sa.ForeignKeyConstraint(["created_by"], ["user.id"], ondelete="SET NULL"), + sa.ForeignKeyConstraint( + ["integration_id"], ["cognition.integration.id"], ondelete="CASCADE" + ), + sa.PrimaryKeyConstraint("id"), + ) + op.create_index( + op.f("ix_sharepoint_property_sync_created_by"), + "sharepoint_property_sync", + ["created_by"], + unique=False, + ) + op.create_index( + op.f("ix_sharepoint_property_sync_integration_id"), + "sharepoint_property_sync", + ["integration_id"], + unique=False, + ) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_index( + op.f("ix_sharepoint_property_sync_integration_id"), + table_name="sharepoint_property_sync", + ) + op.drop_index( + op.f("ix_sharepoint_property_sync_created_by"), + table_name="sharepoint_property_sync", + ) + op.drop_table("sharepoint_property_sync") + # ### end Alembic commands ### diff --git a/controller/attribute/manager.py b/controller/attribute/manager.py index c9a2015a..3fb4ad3c 100644 --- a/controller/attribute/manager.py +++ b/controller/attribute/manager.py @@ -457,6 +457,8 @@ def calculate_user_attribute_sample_records( if ( attribute.get(project_id, attribute_id).data_type == DataTypes.EMBEDDING_LIST.value + or attribute.get(project_id, attribute_id).data_type + == DataTypes.TEXT_LIST.value ): # values are json serialized so they can be easily transferred to the frontend. # Since the return type is a list of strings, without json.dumps a str(xxxx) will be called diff --git a/service/search/search_helper.py b/service/search/search_helper.py index 44f7837b..a19c9480 100644 --- a/service/search/search_helper.py +++ b/service/search/search_helper.py @@ -280,6 +280,7 @@ def build_order_by_table_select( DataTypes.CATEGORY.value: "TEXT", DataTypes.TEXT.value: "TEXT", DataTypes.LLM_RESPONSE.value: "TEXT", + DataTypes.TEXT_LIST.value: "TEXT", } diff --git a/submodules/model b/submodules/model index b0516808..d5300f13 160000 --- a/submodules/model +++ b/submodules/model @@ -1 +1 @@ -Subproject commit b0516808a4fe6e0e07aa8bfb2c837657fb8afc88 +Subproject commit d5300f13c3b2cc6da16f36ffd6349795923b2c64