Skip to content

Commit f485be2

Browse files
committed
update return structure in createQueueJobsTable function
1 parent 2133e8b commit f485be2

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

packages/adapter-drizzle/src/helpers.ts

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,30 @@ export const createQueueJobsTable = (tableName: string, schemaName?: string) =>
4343
const schema = schemaName ? pgSchema(schemaName) : undefined
4444

4545
if (isPgSchema(schema)) {
46-
return schema.table(tableName, columns, (table) => [
47-
index(`idx_${tableName}_status_priority`).on(
48-
table.queueName,
49-
table.status,
50-
table.priority,
51-
table.createdAt,
52-
),
53-
index(`idx_${tableName}_process_at`).on(table.processAt),
54-
])
46+
return {
47+
schema,
48+
table: schema.table(tableName, columns, (table) => [
49+
index(`idx_${tableName}_status_priority`).on(
50+
table.queueName,
51+
table.status,
52+
table.priority,
53+
table.createdAt,
54+
),
55+
index(`idx_${tableName}_process_at`).on(table.processAt),
56+
]),
57+
}
5558
} else {
56-
return pgTable(tableName, columns, (table) => [
57-
index(`idx_${tableName}_status_priority`).on(
58-
table.queueName,
59-
table.status,
60-
table.priority,
61-
table.createdAt,
62-
),
63-
index(`idx_${tableName}_process_at`).on(table.processAt),
64-
])
59+
return {
60+
schema: undefined,
61+
table: pgTable(tableName, columns, (table) => [
62+
index(`idx_${tableName}_status_priority`).on(
63+
table.queueName,
64+
table.status,
65+
table.priority,
66+
table.createdAt,
67+
),
68+
index(`idx_${tableName}_process_at`).on(table.processAt),
69+
]),
70+
}
6571
}
6672
}

0 commit comments

Comments
 (0)