2025-05-16 15:54:17 +02:00
|
|
|
import { pgTable, timestamp, uuid, varchar } from "drizzle-orm/pg-core";
|
|
|
|
|
import { typeStorageEnum } from "./types";
|
|
|
|
|
import { createSelectSchema } from "drizzle-zod";
|
|
|
|
|
import { z } from "zod";
|
2025-08-29 15:31:23 +02:00
|
|
|
import {timestamps} from "@/db/schema/00_common";
|
2025-05-16 15:54:17 +02:00
|
|
|
|
|
|
|
|
export const setting = pgTable("settings", {
|
|
|
|
|
id: uuid("id").primaryKey().defaultRandom(),
|
|
|
|
|
storage: typeStorageEnum("storage").default("local").notNull(),
|
|
|
|
|
name: varchar("name", { length: 255 }).unique().notNull(),
|
|
|
|
|
s3EndPointUrl: varchar("s3_endpoint_url", { length: 255 }),
|
|
|
|
|
s3AccessKeyId: varchar("s3_access_key_id", { length: 255 }),
|
|
|
|
|
s3SecretAccessKey: varchar("s3_secret_access_key", { length: 255 }),
|
|
|
|
|
S3BucketName: varchar("s3_bucket_name", { length: 255 }),
|
|
|
|
|
smtpPassword: varchar("smtp_password", { length: 255 }),
|
|
|
|
|
smtpFrom: varchar("smtp_from", { length: 255 }),
|
|
|
|
|
smtpHost: varchar("smtp_host", { length: 255 }),
|
|
|
|
|
smtpPort: varchar("smtp_port", { length: 255 }),
|
|
|
|
|
smtpUser: varchar("smtp_user", { length: 255 }),
|
2025-08-29 15:31:23 +02:00
|
|
|
...timestamps
|
2025-05-16 15:54:17 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const settingSchema = createSelectSchema(setting);
|
|
|
|
|
export type Setting = z.infer<typeof settingSchema>;
|