6ede33ccdb
Build and Push Docker Images / create_manifest (web, surfsense-web, , cpu) (push) Has been cancelled
Build and Push Docker Images / finalize_release (push) Has been cancelled
Obsidian Plugin Lint / lint (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_web, cpu, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-24.04-arm, linux/arm64, arm64, , runner, false, cpu) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_web, cpu, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-latest, linux/amd64, amd64, , runner, false, cpu) (push) Has been cancelled
Build and Push Docker Images / compute_version (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, cpu, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64, , production, false, cpu) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, cpu, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64, , production, false, cpu) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, cu126, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64, -cuda126, production, true, cuda126) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, cu126, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64, -cuda126, production, true, cuda126) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, cu128, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64, -cuda, production, true, cuda) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, cu128, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64, -cuda, production, true, cuda) (push) Has been cancelled
Build and Push Docker Images / verify_digests (push) Has been cancelled
Build and Push Docker Images / create_manifest (backend, surfsense-backend, , cpu) (push) Has been cancelled
Build and Push Docker Images / create_manifest (backend, surfsense-backend, -cuda, cuda) (push) Has been cancelled
Build and Push Docker Images / create_manifest (backend, surfsense-backend, -cuda126, cuda126) (push) Has been cancelled
46 lines
1.3 KiB
Python
46 lines
1.3 KiB
Python
"""Add LINKUP_API to SearchSourceConnectorType enum
|
|
|
|
Revision ID: 4
|
|
Revises: 3
|
|
Create Date: 2025-08-13
|
|
"""
|
|
|
|
from collections.abc import Sequence
|
|
|
|
from alembic import op
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = "4"
|
|
down_revision: str | None = "3"
|
|
branch_labels: str | Sequence[str] | None = None
|
|
depends_on: str | Sequence[str] | None = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
# Add enum value only if it doesn't already exist.
|
|
# Postgres will no-op with a NOTICE when the value is present.
|
|
op.execute(
|
|
"ALTER TYPE searchsourceconnectortype ADD VALUE IF NOT EXISTS 'LINKUP_API'"
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
# To "remove" an enum value in Postgres, we must recreate the type
|
|
# without that value, migrate the column, then drop the old type.
|
|
op.execute(
|
|
"ALTER TYPE searchsourceconnectortype RENAME TO searchsourceconnectortype_old"
|
|
)
|
|
op.execute(
|
|
"CREATE TYPE searchsourceconnectortype AS ENUM("
|
|
"'SERPER_API', 'TAVILY_API', 'SLACK_CONNECTOR', "
|
|
"'NOTION_CONNECTOR', 'GITHUB_CONNECTOR', 'LINEAR_CONNECTOR'"
|
|
")"
|
|
)
|
|
op.execute(
|
|
"ALTER TABLE search_source_connectors "
|
|
"ALTER COLUMN connector_type "
|
|
"TYPE searchsourceconnectortype "
|
|
"USING connector_type::text::searchsourceconnectortype"
|
|
)
|
|
op.execute("DROP TYPE searchsourceconnectortype_old")
|