mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-19 20:24:32 +02:00
Remove DocumentSource Enum from postgres (#1217)
This commit is contained in:
38
backend/alembic/versions/e50154680a5c_no_source_enum.py
Normal file
38
backend/alembic/versions/e50154680a5c_no_source_enum.py
Normal file
@@ -0,0 +1,38 @@
|
||||
"""No Source Enum
|
||||
|
||||
Revision ID: e50154680a5c
|
||||
Revises: fcd135795f21
|
||||
Create Date: 2024-03-14 18:06:08.523106
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from danswer.configs.constants import DocumentSource
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "e50154680a5c"
|
||||
down_revision = "fcd135795f21"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.alter_column(
|
||||
"search_doc",
|
||||
"source_type",
|
||||
type_=sa.String(length=50),
|
||||
existing_type=sa.Enum(DocumentSource, native_enum=False),
|
||||
existing_nullable=False,
|
||||
)
|
||||
op.execute("DROP TYPE IF EXISTS documentsource")
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.alter_column(
|
||||
"search_doc",
|
||||
"source_type",
|
||||
type_=sa.Enum(DocumentSource, native_enum=False),
|
||||
existing_type=sa.String(length=50),
|
||||
existing_nullable=False,
|
||||
)
|
Reference in New Issue
Block a user