mirror of
https://github.com/SrIzan10/spongebin.git
synced 2026-05-01 11:05:09 +00:00
19 lines
530 B
TypeScript
19 lines
530 B
TypeScript
import { jsonb, pgTable, text } from "drizzle-orm/pg-core";
|
|
import { customAlphabet } from "nanoid";
|
|
import type { PasteTab } from "~/utils/paste-tabs";
|
|
|
|
const nanoid = customAlphabet(
|
|
"1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
|
10,
|
|
);
|
|
|
|
export const paste = pgTable("paste", {
|
|
id: text("id")
|
|
.primaryKey()
|
|
.$defaultFn(() => nanoid()),
|
|
content: text("content").notNull(),
|
|
language: text("language").notNull(),
|
|
theme: text("theme").notNull(),
|
|
tabs: jsonb("tabs").$type<PasteTab[]>(),
|
|
});
|