Skip to content

Commit ba77b9e

Browse files
nekomeowwwluoling8192
authored andcommitted
fix(server): database with duplicated index
1 parent fab6c20 commit ba77b9e

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

apps/server/docker-compose.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ services:
44
db:
55
image: ghcr.io/tensorchord/vchord-postgres:pg18-v1.0.0
66
environment:
7-
- POSTGRES_PASSWORD=example-P@ssw0rd-xHjDYR.b7N
7+
- POSTGRES_DB=postgres
8+
- POSTGRES_USER=postgres
9+
- POSTGRES_PASSWORD=example-PAssw0rd-xHjDYR.b7N
810
ports:
911
- '5432:5432'
1012
volumes:
@@ -25,7 +27,7 @@ services:
2527
condition: service_healthy
2628
environment:
2729
# Database
28-
- DATABASE_URL=postgresql://postgres:example-P@ssw0rd-xHjDYR.b7N@db:5432/postgres
30+
- DATABASE_URL=postgresql://postgres:example-PAssw0rd-xHjDYR.b7N@db:5432/postgres
2931
# Auth
3032
- AUTH_GOOGLE_CLIENT_ID
3133
- AUTH_GOOGLE_CLIENT_SECRET

apps/server/drizzle.config.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
import process from 'node:process'
1+
import { env } from 'node:process'
22

3-
export default {
3+
import { defineConfig } from 'drizzle-kit'
4+
5+
export default defineConfig({
46
schema: './src/schemas/**/*.ts',
57
out: './drizzle',
68
dialect: 'postgresql',
79
dbCredentials: {
8-
url: process.env.DATABASE_URL,
10+
url: env.DATABASE_URL!,
911
},
10-
}
12+
// https://github.com/drizzle-team/drizzle-orm/issues/4008
13+
tablesFilter: ['!vchordrq_sampled_queries'],
14+
})

apps/server/src/schemas/accounts.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { relations } from 'drizzle-orm'
2-
import { boolean, index, pgTable, text, timestamp } from 'drizzle-orm/pg-core'
2+
import { boolean, pgTable, text, timestamp } from 'drizzle-orm/pg-core'
33

44
export const user = pgTable('user', {
55
id: text('id').primaryKey(),
@@ -30,7 +30,6 @@ export const session = pgTable(
3030
.notNull()
3131
.references(() => user.id, { onDelete: 'cascade' }),
3232
},
33-
table => [index('session_userId_idx').on(table.userId)],
3433
)
3534

3635
export const account = pgTable(
@@ -54,7 +53,6 @@ export const account = pgTable(
5453
.$onUpdate(() => /* @__PURE__ */ new Date())
5554
.notNull(),
5655
},
57-
table => [index('account_userId_idx').on(table.userId)],
5856
)
5957

6058
export const verification = pgTable(
@@ -70,7 +68,6 @@ export const verification = pgTable(
7068
.$onUpdate(() => /* @__PURE__ */ new Date())
7169
.notNull(),
7270
},
73-
table => [index('verification_identifier_idx').on(table.identifier)],
7471
)
7572

7673
export const userRelations = relations(user, ({ many }) => ({

0 commit comments

Comments
 (0)