Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: uuid-ossp extension create failed in pgsql (#10)

John Wang2e1cd3db2879
diff --git a/api/migrations/versions/64b051264f32_init.py b/api/migrations/versions/64b051264f32_init.py
index 84e1f2af17a..d2160c128d8 100644
--- a/api/migrations/versions/64b051264f32_init.py
+++ b/api/migrations/versions/64b051264f32_init.py
@@ -18,6 +18,8 @@ depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
+ op.execute('CREATE EXTENSION IF NOT EXISTS "uuid-ossp";')
+
op.create_table('account_integrates',
sa.Column('id', postgresql.UUID(), server_default=sa.text('uuid_generate_v4()'), nullable=False),
sa.Column('account_id', postgresql.UUID(), nullable=False),
@@ -790,4 +792,6 @@ def downgrade():
op.drop_table('accounts')
op.drop_table('account_integrates')
+
+ op.execute('DROP EXTENSION IF EXISTS "uuid-ossp";')
# ### end Alembic commands ###
diff --git a/docker/docker-compose.middleware.yaml b/docker/docker-compose.middleware.yaml
index 09372ca2a39..7e029d663a7 100644
--- a/docker/docker-compose.middleware.yaml
+++ b/docker/docker-compose.middleware.yaml
@@ -13,7 +13,6 @@ services:
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- ./volumes/db/data:/var/lib/postgresql/data
- - ./volumes/db/scripts:/docker-entrypoint-initdb.d/
ports:
- "5432:5432"
diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml
index 7d1542fbca1..40935d29268 100644
--- a/docker/docker-compose.yaml
+++ b/docker/docker-compose.yaml
@@ -163,7 +163,6 @@ services:
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- ./volumes/db/data:/var/lib/postgresql/data
- - ./volumes/db/scripts:/docker-entrypoint-initdb.d/
ports:
- "5432:5432"
diff --git a/docker/volumes/db/scripts/init_extension.sh b/docker/volumes/db/scripts/init_extension.sh
index abad1e51821..e69de29bb2d 100644
--- a/docker/volumes/db/scripts/init_extension.sh
+++ b/docker/volumes/db/scripts/init_extension.sh
@@ -1 +0,0 @@
-psql -U postgres -d dify -c 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp";'
\ No newline at end of file