mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
chore: migration for the storage-backend feature
This commit is contained in:
+17
-14
@@ -1,22 +1,25 @@
|
||||
import { pgTable, timestamp, uuid, varchar } from "drizzle-orm/pg-core";
|
||||
import { typeStorageEnum } from "./types";
|
||||
import { createSelectSchema } from "drizzle-zod";
|
||||
import { z } from "zod";
|
||||
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";
|
||||
import {storageChannel} from "@/db/schema/12_storage-channel";
|
||||
|
||||
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 }),
|
||||
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}),
|
||||
defaultStorageChannelId: uuid('default_storage_channel_id')
|
||||
.references(() => storageChannel.id, {onDelete: "set null"}),
|
||||
...timestamps
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user