All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 2m39s
ref #23
35 lines
998 B
TypeScript
35 lines
998 B
TypeScript
import {
|
|
index,
|
|
integer,
|
|
jsonb,
|
|
pgTable,
|
|
text,
|
|
timestamp,
|
|
uuid,
|
|
} from "drizzle-orm/pg-core";
|
|
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
|
|
import type { z } from "zod";
|
|
|
|
export const opendockApt = pgTable(
|
|
"opendock_apt",
|
|
{
|
|
id: uuid("id").defaultRandom().primaryKey(),
|
|
release: integer("release").notNull().unique("opendock_apt_release_unique"),
|
|
openDockAptId: text("open_dock_apt_id").notNull(),
|
|
appointment: jsonb("appointment").notNull().default([]),
|
|
upd_date: timestamp("upd_date").notNull().defaultNow(),
|
|
createdAt: timestamp("created_at").notNull().defaultNow(),
|
|
},
|
|
(table) => ({
|
|
openDockAptIdIdx: index("opendock_apt_opendock_id_idx").on(
|
|
table.openDockAptId,
|
|
),
|
|
}),
|
|
);
|
|
|
|
export const opendockAptSchema = createSelectSchema(opendockApt);
|
|
export const newOpendockAptSchema = createInsertSchema(opendockApt);
|
|
|
|
export type OpendockApt = z.infer<typeof opendockAptSchema>;
|
|
export type NewOpendockApt = z.infer<typeof newOpendockAptSchema>;
|