From 2785b4da23401040f9c15a00308b88d4b4138d26 Mon Sep 17 00:00:00 2001 From: Aamir Azad Date: Tue, 4 Jun 2024 21:56:32 -0400 Subject: [PATCH] Create user table --- src/server/db/schema.ts | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/src/server/db/schema.ts b/src/server/db/schema.ts index 7831dad..462c0b8 100644 --- a/src/server/db/schema.ts +++ b/src/server/db/schema.ts @@ -3,10 +3,8 @@ import { sql } from "drizzle-orm"; import { - index, pgTableCreator, serial, - timestamp, varchar, } from "drizzle-orm/pg-core"; @@ -16,19 +14,14 @@ import { * * @see https://orm.drizzle.team/docs/goodies#multi-project-schema */ -export const createTable = pgTableCreator((name) => `homelab-connector_${name}`); - -export const immich = createTable( - "post", - { - id: serial("id").primaryKey(), - name: varchar("name", { length: 256 }), - createdAt: timestamp("created_at", { withTimezone: true }) - .default(sql`CURRENT_TIMESTAMP`) - .notNull(), - updatedAt: timestamp("updatedAt", { withTimezone: true }), - }, - (example) => ({ - nameIndex: index("name_idx").on(example.name), - }) +export const createTable = pgTableCreator( + (name) => `homelab-connector_${name}`, ); + +export const users = createTable("users", { + id: serial("id").primaryKey(), + userId: varchar("userId", { length: 256 }).notNull(), + fullName: varchar("name", { length: 256 }), + paperlessURL: varchar("paperlessURL", { length: 256 }), + paperlessAPI: varchar("paperlessAPI", { length: 256 }), +});