mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Adding methods to delete backups on remote storage s3 and local. Some refactoring on models db and adding common.ts model with createdAt, updatedAt, and deletedAt.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { pgTable, timestamp, uuid, varchar } from "drizzle-orm/pg-core";
|
||||
import { typeStorageEnum } from "./types";
|
||||
import { createSelectSchema } from "drizzle-zod";
|
||||
import { z } from "zod";
|
||||
import {timestamps} from "@/db/schema/00_common";
|
||||
|
||||
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 }),
|
||||
...timestamps
|
||||
});
|
||||
|
||||
export const settingSchema = createSelectSchema(setting);
|
||||
export type Setting = z.infer<typeof settingSchema>;
|
||||
Reference in New Issue
Block a user