mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-10-10 05:05:34 +02:00
Extension creation in MT migration
This commit is contained in:
@@ -27,9 +27,6 @@ depends_on = None
|
|||||||
|
|
||||||
def upgrade() -> None:
|
def upgrade() -> None:
|
||||||
|
|
||||||
# Enable pg_trgm extension if not already enabled
|
|
||||||
op.execute("CREATE EXTENSION IF NOT EXISTS pg_trgm")
|
|
||||||
|
|
||||||
# Create a new permission-less user to be later used for knowledge graph queries.
|
# Create a new permission-less user to be later used for knowledge graph queries.
|
||||||
# The user will later get temporary read priviledges for a specific view that will be
|
# The user will later get temporary read priviledges for a specific view that will be
|
||||||
# ad hoc generated specific to a knowledge graph query.
|
# ad hoc generated specific to a knowledge graph query.
|
||||||
@@ -38,6 +35,10 @@ def upgrade() -> None:
|
|||||||
# environment variables MUST be set. Otherwise, an exception will be raised.
|
# environment variables MUST be set. Otherwise, an exception will be raised.
|
||||||
|
|
||||||
if not MULTI_TENANT:
|
if not MULTI_TENANT:
|
||||||
|
|
||||||
|
# Enable pg_trgm extension if not already enabled
|
||||||
|
op.execute("CREATE EXTENSION IF NOT EXISTS pg_trgm")
|
||||||
|
|
||||||
# Create read-only db user here only in single tenant mode. For multi-tenant mode,
|
# Create read-only db user here only in single tenant mode. For multi-tenant mode,
|
||||||
# the user is created in the alembic_tenants migration.
|
# the user is created in the alembic_tenants migration.
|
||||||
if not (DB_READONLY_USER and DB_READONLY_PASSWORD):
|
if not (DB_READONLY_USER and DB_READONLY_PASSWORD):
|
||||||
|
@@ -23,6 +23,10 @@ depends_on = None
|
|||||||
|
|
||||||
def upgrade() -> None:
|
def upgrade() -> None:
|
||||||
if MULTI_TENANT:
|
if MULTI_TENANT:
|
||||||
|
|
||||||
|
# Enable pg_trgm extension if not already enabled
|
||||||
|
op.execute("CREATE EXTENSION IF NOT EXISTS pg_trgm")
|
||||||
|
|
||||||
# Create read-only db user here only in multi-tenant mode. For single-tenant mode,
|
# Create read-only db user here only in multi-tenant mode. For single-tenant mode,
|
||||||
# the user is created in the standard migration.
|
# the user is created in the standard migration.
|
||||||
if not (DB_READONLY_USER and DB_READONLY_PASSWORD):
|
if not (DB_READONLY_USER and DB_READONLY_PASSWORD):
|
||||||
|
Reference in New Issue
Block a user