mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-04-22 03:59:35 -04:00
19 lines
578 B
TypeScript
19 lines
578 B
TypeScript
import { sql } from "drizzle-orm";
|
|
import { index, integer, jsonb, uuid, varchar } from "drizzle-orm/pg-core";
|
|
import { schema, timestamp } from "./utils";
|
|
|
|
export const mqueue = schema.table(
|
|
"mqueue",
|
|
{
|
|
id: uuid().notNull().primaryKey().defaultRandom(),
|
|
kind: varchar({ length: 255 }).notNull(),
|
|
message: jsonb().notNull(),
|
|
priority: integer().notNull().default(0),
|
|
attempt: integer().notNull().default(0),
|
|
createdAt: timestamp({ withTimezone: true, mode: "iso" })
|
|
.notNull()
|
|
.default(sql`now()`),
|
|
},
|
|
(t) => [index("mqueue_created").on(t.createdAt)],
|
|
);
|