From 832fc184afcd0a078feb32d763571bf7e9aae3c5 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Fri, 3 May 2024 12:27:06 -0600 Subject: [PATCH 01/98] feat: add schema for registry and routes --- .../cluster/registry/add-docker-registry.tsx | 193 ++++++++++++++++++ .../cluster/registry/add-self-registry.tsx | 52 +++++ .../cluster/registry/show-registry.tsx | 62 ++++++ components/layouts/settings-layout.tsx | 7 + pages/dashboard/settings/cluster.tsx | 42 ++++ server/api/routers/registry.ts | 66 ++++++ server/api/services/registry.ts | 84 ++++++++ server/db/schema/admin.ts | 2 + server/db/schema/index.ts | 2 +- server/db/schema/registry.ts | 87 ++++++++ 10 files changed, 596 insertions(+), 1 deletion(-) create mode 100644 components/dashboard/settings/cluster/registry/add-docker-registry.tsx create mode 100644 components/dashboard/settings/cluster/registry/add-self-registry.tsx create mode 100644 components/dashboard/settings/cluster/registry/show-registry.tsx create mode 100644 pages/dashboard/settings/cluster.tsx create mode 100644 server/api/routers/registry.ts create mode 100644 server/api/services/registry.ts create mode 100644 server/db/schema/registry.ts diff --git a/components/dashboard/settings/cluster/registry/add-docker-registry.tsx b/components/dashboard/settings/cluster/registry/add-docker-registry.tsx new file mode 100644 index 000000000..efef6ca89 --- /dev/null +++ b/components/dashboard/settings/cluster/registry/add-docker-registry.tsx @@ -0,0 +1,193 @@ +import { Button } from "@/components/ui/button"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/dialog"; +import { + Form, + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@/components/ui/form"; +import { Input } from "@/components/ui/input"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { AlertTriangle, Container } from "lucide-react"; +import { useRouter } from "next/router"; +import { useEffect, useState } from "react"; +import { useForm } from "react-hook-form"; +import { z } from "zod"; + +const AddRegistrySchema = z.object({ + registryName: z.string().min(1, { + message: "Registry name is required", + }), + username: z.string().min(1, { + message: "Username is required", + }), + password: z.string().min(1, { + message: "Password is required", + }), + registryUrl: z.string().min(1, { + message: "Registry URL is required", + }), +}); + +type AddRegistry = z.infer; + +export const AddRegistry = () => { + const utils = api.useUtils(); + const [isOpen, setIsOpen] = useState(false); + const { mutateAsync, error, isError } = api.project.create.useMutation(); + const router = useRouter(); + const form = useForm({ + defaultValues: { + username: "", + password: "", + registryUrl: "", + }, + resolver: zodResolver(AddRegistrySchema), + }); + + useEffect(() => { + form.reset({ + username: "", + password: "", + registryUrl: "", + }); + }, [form, form.reset, form.formState.isSubmitSuccessful]); + + const onSubmit = async (data: AddRegistry) => { + // await mutateAsync({ + // name: data.name, + // description: data.description, + // }) + // .then(async (data) => { + // await utils.project.all.invalidate(); + // toast.success("Project Created"); + // setIsOpen(false); + // router.push(`/dashboard/project/${data.projectId}`); + // }) + // .catch(() => { + // toast.error("Error to create a project"); + // }); + }; + + return ( + + + + + + + Add a external registry + + Fill the next fields to add a external registry. + + + {isError && ( +
+ + + {error?.message} + +
+ )} +
+ +
+ ( + + Registry Name + + + + + + + )} + /> +
+
+ ( + + Username + + + + + + + )} + /> +
+
+ ( + + Password + + + + + + + )} + /> +
+
+ ( + + Registry URL + + + + + + + )} + /> +
+ + + +
+ +
+
+ ); +}; diff --git a/components/dashboard/settings/cluster/registry/add-self-registry.tsx b/components/dashboard/settings/cluster/registry/add-self-registry.tsx new file mode 100644 index 000000000..ee82487d5 --- /dev/null +++ b/components/dashboard/settings/cluster/registry/add-self-registry.tsx @@ -0,0 +1,52 @@ +import React from "react"; +import { + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, + AlertDialogTrigger, +} from "@/components/ui/alert-dialog"; +import { Button } from "@/components/ui/button"; +import { api } from "@/utils/api"; +import { toast } from "sonner"; + +export const AddSelfRegistry = () => { + return ( + + + + + + + Are you absolutely sure? + + This will setup a self hosted registry. + + + + Cancel + { + // await mutateAsync({ + // authId, + // }) + // .then(async () => { + // utils.user.all.invalidate(); + // toast.success("User delete succesfully"); + // }) + // .catch(() => { + // toast.error("Error to delete the user"); + // }); + }} + > + Confirm + + + + + ); +}; diff --git a/components/dashboard/settings/cluster/registry/show-registry.tsx b/components/dashboard/settings/cluster/registry/show-registry.tsx new file mode 100644 index 000000000..4e85c9946 --- /dev/null +++ b/components/dashboard/settings/cluster/registry/show-registry.tsx @@ -0,0 +1,62 @@ +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from "@/components/ui/card"; +import { api } from "@/utils/api"; +import { Server, ShieldCheck } from "lucide-react"; +import { AddRegistry } from "./add-docker-registry"; +import { AddSelfRegistry } from "./add-self-registry"; + +export const ShowRegistry = () => { + const { data } = api.certificates.all.useQuery(); + + return ( +
+ + + Clusters + Add cluster to your application. + + + {data?.length === 0 ? ( +
+ + + To create a cluster is required to set a registry. + + +
+ + +
+ + {/* */} +
+ ) : ( +
+ {data?.map((destination, index) => ( +
+ + {index + 1}. {destination.name} + +
+ {/* */} +
+
+ ))} +
{/* */}
+
+ )} +
+
+
+ ); +}; diff --git a/components/layouts/settings-layout.tsx b/components/layouts/settings-layout.tsx index 094bf40ea..8371814e3 100644 --- a/components/layouts/settings-layout.tsx +++ b/components/layouts/settings-layout.tsx @@ -59,6 +59,12 @@ export const SettingsLayout = ({ children }: Props) => { icon: Users, href: "/dashboard/settings/users", }, + { + title: "Cluster", + label: "", + icon: Server, + href: "/dashboard/settings/cluster", + }, ] : []), ]} @@ -75,6 +81,7 @@ import { Activity, Database, Route, + Server, ShieldCheck, User2, Users, diff --git a/pages/dashboard/settings/cluster.tsx b/pages/dashboard/settings/cluster.tsx new file mode 100644 index 000000000..98ce5cfe9 --- /dev/null +++ b/pages/dashboard/settings/cluster.tsx @@ -0,0 +1,42 @@ +import { ShowCertificates } from "@/components/dashboard/settings/certificates/show-certificates"; +import { ShowRegistry } from "@/components/dashboard/settings/cluster/registry/show-registry"; +import { DashboardLayout } from "@/components/layouts/dashboard-layout"; +import { SettingsLayout } from "@/components/layouts/settings-layout"; +import { validateRequest } from "@/server/auth/auth"; +import type { GetServerSidePropsContext } from "next"; +import React, { type ReactElement } from "react"; + +const Page = () => { + return ( +
+ +
+ ); +}; + +export default Page; + +Page.getLayout = (page: ReactElement) => { + return ( + + {page} + + ); +}; +export async function getServerSideProps( + ctx: GetServerSidePropsContext<{ serviceId: string }>, +) { + const { user, session } = await validateRequest(ctx.req, ctx.res); + if (!user || user.rol === "user") { + return { + redirect: { + permanent: true, + destination: "/", + }, + }; + } + + return { + props: {}, + }; +} diff --git a/server/api/routers/registry.ts b/server/api/routers/registry.ts new file mode 100644 index 000000000..725861c5f --- /dev/null +++ b/server/api/routers/registry.ts @@ -0,0 +1,66 @@ +import { + apiCreateRegistry, + apiEnableSelfHostedRegistry, + apiFindOneRegistry, + apiRemoveRegistry, + apiUpdateRegistry, +} from "@/server/db/schema"; +import { + createRegistry, + findRegistryById, + removeRegistry, + updaterRegistry, +} from "../services/registry"; +import { adminProcedure, createTRPCRouter, protectedProcedure } from "../trpc"; +import { TRPCError } from "@trpc/server"; + +export const registryRouter = createTRPCRouter({ + create: adminProcedure + .input(apiCreateRegistry) + .mutation(async ({ ctx, input }) => { + return await createRegistry(input); + }), + remove: adminProcedure + .input(apiRemoveRegistry) + .mutation(async ({ ctx, input }) => { + return await removeRegistry(input.registryId); + }), + update: protectedProcedure + .input(apiUpdateRegistry) + .mutation(async ({ input }) => { + const { registryId, ...rest } = input; + const application = await updaterRegistry(registryId, { + ...rest, + }); + + if (!application) { + throw new TRPCError({ + code: "BAD_REQUEST", + message: "Update: Error to update registry", + }); + } + + return true; + }), + findOne: adminProcedure.input(apiFindOneRegistry).query(async ({ input }) => { + return await findRegistryById(input.registryId); + }), + + enableSelfHostedRegistry: protectedProcedure + .input(apiEnableSelfHostedRegistry) + .mutation(async ({ input }) => { + // return await createRegistry({ + // username:"CUSTOM" + // adminId: input.adminId, + // }); + // const application = await findRegistryById(input.registryId); + // const result = await db + // .update(registry) + // .set({ + // selfHosted: true, + // }) + // .where(eq(registry.registryId, input.registryId)) + // .returning(); + // return result[0]; + }), +}); diff --git a/server/api/services/registry.ts b/server/api/services/registry.ts new file mode 100644 index 000000000..ac8f2080a --- /dev/null +++ b/server/api/services/registry.ts @@ -0,0 +1,84 @@ +import { type apiCreateRegistry, registry } from "@/server/db/schema"; +import { TRPCError } from "@trpc/server"; +import { db } from "@/server/db"; +import { eq } from "drizzle-orm"; + +export type Registry = typeof registry.$inferSelect; + +export const createRegistry = async (input: typeof apiCreateRegistry._type) => { + const newRegistry = await db + .insert(registry) + .values({ + ...input, + }) + .returning() + .then((value) => value[0]); + + if (!newRegistry) { + throw new TRPCError({ + code: "BAD_REQUEST", + message: "Error input: Inserting registry", + }); + } + return newRegistry; +}; + +export const removeRegistry = async (registryId: string) => { + try { + const response = await db + .delete(registry) + .where(eq(registry.registryId, registryId)) + .returning() + .then((res) => res[0]); + + if (!response) { + throw new TRPCError({ + code: "NOT_FOUND", + message: "Registry not found", + }); + } + + return response; + } catch (error) { + throw new TRPCError({ + code: "BAD_REQUEST", + message: "Error to remove this registry", + cause: error, + }); + } +}; + +export const updaterRegistry = async ( + registryId: string, + registryData: Partial, +) => { + try { + const response = await db + .update(registry) + .set({ + ...registryData, + }) + .where(eq(registry.registryId, registryId)) + .returning(); + + return response[0]; + } catch (error) { + throw new TRPCError({ + code: "BAD_REQUEST", + message: "Error to update this registry", + }); + } +}; + +export const findRegistryById = async (registryId: string) => { + const registryResponse = await db.query.registry.findFirst({ + where: eq(registry.registryId, registryId), + }); + if (!registryResponse) { + throw new TRPCError({ + code: "NOT_FOUND", + message: "Registry not found", + }); + } + return registryResponse; +}; diff --git a/server/db/schema/admin.ts b/server/db/schema/admin.ts index 83306d2f4..5ce3317e1 100644 --- a/server/db/schema/admin.ts +++ b/server/db/schema/admin.ts @@ -6,6 +6,7 @@ import { users } from "./user"; import { createInsertSchema } from "drizzle-zod"; import { z } from "zod"; import { certificateType } from "./shared"; +import { registry } from "./registry"; export const admins = pgTable("admin", { adminId: text("adminId") @@ -39,6 +40,7 @@ export const adminsRelations = relations(admins, ({ one, many }) => ({ references: [auth.id], }), users: many(users), + registry: many(registry), })); const createSchema = createInsertSchema(admins, { diff --git a/server/db/schema/index.ts b/server/db/schema/index.ts index fc1d412db..3fe43e1ae 100644 --- a/server/db/schema/index.ts +++ b/server/db/schema/index.ts @@ -1,6 +1,5 @@ export * from "./application"; export * from "./postgres"; - export * from "./user"; export * from "./admin"; export * from "./auth"; @@ -20,3 +19,4 @@ export * from "./security"; export * from "./port"; export * from "./redis"; export * from "./shared"; +export * from "./registry"; diff --git a/server/db/schema/registry.ts b/server/db/schema/registry.ts new file mode 100644 index 000000000..b502648a6 --- /dev/null +++ b/server/db/schema/registry.ts @@ -0,0 +1,87 @@ +import { createInsertSchema } from "drizzle-zod"; +import { nanoid } from "nanoid"; +import { relations, sql } from "drizzle-orm"; +import { boolean, pgEnum, pgTable, text, timestamp } from "drizzle-orm/pg-core"; +import { auth } from "./auth"; +import { admins } from "./admin"; +import { z } from "zod"; +/** + * This is an example of how to use the multi-project schema feature of Drizzle ORM. Use the same + * database instance for multiple projects. + * + * @see https://orm.drizzle.team/docs/goodies#multi-project-schema + */ +export const registryType = pgEnum("RegistryType", ["selfHosted", "cloud"]); + +export const registry = pgTable("registry", { + registryId: text("registryId") + .notNull() + .primaryKey() + .$defaultFn(() => nanoid()), + registryName: text("registryName").notNull(), + username: text("username").notNull(), + password: text("password").notNull(), + registryUrl: text("registryUrl").notNull(), + createdAt: text("createdAt") + .notNull() + .$defaultFn(() => new Date().toISOString()), + registryType: registryType("selfHosted").notNull().default("cloud"), + adminId: text("adminId") + .notNull() + .references(() => admins.adminId, { onDelete: "cascade" }), +}); + +export const registryRelations = relations(registry, ({ one }) => ({ + admin: one(admins, { + fields: [registry.adminId], + references: [admins.adminId], + }), +})); + +const createSchema = createInsertSchema(registry, { + registryName: z.string().min(1), + username: z.string().min(1), + password: z.string().min(1), + registryUrl: z.string().min(1), + adminId: z.string().min(1), + registryId: z.string().min(1), +}); + +export const apiCreateRegistry = createSchema + .pick({}) + .extend({ + registryName: z.string().min(1), + username: z.string().min(1), + password: z.string().min(1), + registryUrl: z.string().min(1), + adminId: z.string().min(1), + }) + .required(); + +export const apiRemoveRegistry = createSchema + .pick({ + registryId: true, + }) + .required(); + +export const apiFindOneRegistry = createSchema + .pick({ + registryId: true, + }) + .required(); + +export const apiUpdateRegistry = createSchema + .pick({ + password: true, + registryName: true, + username: true, + registryUrl: true, + registryId: true, + }) + .required(); + +export const apiEnableSelfHostedRegistry = createSchema + .pick({ + adminId: true, + }) + .required(); From eb055687989c5d3e8e1b490b4a1d61e0c6778811 Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Fri, 10 May 2024 07:29:06 +0800 Subject: [PATCH 02/98] Update README.md Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README.md | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 19e44df07..fde9339ab 100644 --- a/README.md +++ b/README.md @@ -11,35 +11,34 @@ -Dokploy is a free self-hostable Platform as a Service (PaaS) that simplifies the deployment and management of applications and databases using Docker and Traefik. Designed to enhance efficiency and security, Dokploy allows you to deploy your applications on any VPS. +Dokploy 是一个免费的可自行托管的平台即服务(PaaS),它使用 Docker 和 Traefik 简化了应用程序和数据库的部署和管理。 Dokploy 旨在提高效率和安全性,允许您在任何 VPS 上部署应用程序。 - -## 🌟 Features - -- **Applications**: Deploy any type of application (Node.js, PHP, Python, Go, Ruby, etc.) with ease. -- **Databases**: Create and manage databases with support for MySQL, PostgreSQL, MongoDB, MariaDB, Redis, and more. -- **Docker Management**: Easily deploy and manage Docker containers. -- **Traefik Integration**: Automatically integrates with Traefik for routing and load balancing. -- **Real-time Monitoring**: Monitor CPU, memory, storage, and network usage. -- **Database Backups**: Automate backups with support for multiple storage destinations. +## 🌟 特点 -## 🚀 Getting Started +- **应用**:轻松部署任何类型的应用程序(Node.js、PHP、Python、Go、Ruby 等)。 +- **数据库**:创建和管理数据库,支持 MySQL、PostgreSQL、MongoDB、MariaDB、Redis 等。 +- **Docker 管理**: 轻松部署和管理 Docker 容器。 +- **集成特拉菲克**: 自动与特拉菲克集成,用于路由选择和负载平衡。 +- **实时监控**: 监控 CPU、内存、存储和网络使用情况。 +- **数据库备份**: 支持多个存储目的地,实现自动备份。 -To get started run the following command in a VPS: +## 🚀 入门 + +要开始使用,请在 VPS 中运行以下命令: ```bash curl -sSL https://dokploy.com/install.sh | sh ``` -Tested Systems: +经过测试的系统: - Ubuntu 20.04 - Debian 11 -## 📄 Documentation +## 📄 文件 -For detailed documentation, visit [docs.dokploy.com/docs](https://docs.dokploy.com). +有关详细文档,请访问 [docs.dokploy.com/docs](https://docs.dokploy.com). From bd47b6f50ab37f7f4a0bdb846476c57ec6a708c9 Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Fri, 10 May 2024 07:35:09 +0800 Subject: [PATCH 03/98] Rename README.md to README zhCN .md Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README.md => README zhCN .md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README.md => README zhCN .md (100%) diff --git a/README.md b/README zhCN .md similarity index 100% rename from README.md rename to README zhCN .md From b6a088ac6b50b1527916e99e8e6df2fadfbad4f7 Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Fri, 10 May 2024 07:42:01 +0800 Subject: [PATCH 04/98] Create README.md Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 000000000..d3c0e2965 --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ + + +
+

Dokploy

+
+ +
+Reflex Logo +
+
+ + + +Dokploy 是一个免费的可自行托管的平台即服务(PaaS),它使用 Docker 和 Traefik 简化了应用程序和数据库的部署和管理。 Dokploy 旨在提高效率和安全性,允许您在任何 VPS 上部署应用程序。 + + +## 🌟 特点 + + +- **应用**:轻松部署任何类型的应用程序(Node.js、PHP、Python、Go、Ruby 等)。 +- **数据库**:创建和管理数据库,支持 MySQL、PostgreSQL、MongoDB、MariaDB、Redis 等。 +- **Docker 管理**: 轻松部署和管理 Docker 容器。 +- **集成特拉菲克**: 自动与特拉菲克集成,用于路由选择和负载平衡。 +- **实时监控**: 监控 CPU、内存、存储和网络使用情况。 +- **数据库备份**: 支持多个存储目的地,实现自动备份。 + +## 🚀 入门 + +要开始使用,请在 VPS 中运行以下命令: + + +```bash +curl -sSL https://dokploy.com/install.sh | sh +``` + +经过测试的系统: + +- Ubuntu 20.04 +- Debian 11 + +## 📄 文件 + +有关详细文档,请访问 [docs.dokploy.com/docs](https://docs.dokploy.com). From 824613cce9ff9a72bc6a3631359e0570191d9abe Mon Sep 17 00:00:00 2001 From: hehehai Date: Sat, 11 May 2024 16:58:55 +0800 Subject: [PATCH 05/98] docs: reset password command fix --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bbda3053c..67a8e3ece 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -107,7 +107,7 @@ pnpm run docker:push In the case you lost your password, you can reset it using the following command ```bash -pnpm run build-server +pnpm run reset-password ``` If you want to test the webhooks on development mode using localtunnel, make sure to install `localtunnel` @@ -150,4 +150,4 @@ curl -sSL "https://github.com/buildpacks/pack/releases/download/v0.32.1/pack-v0. - If your pull request fixes an open issue, please reference the issue in the pull request description. - Once your pull request is merged, you will be automatically added as a contributor to the project. -Thank you for your contribution! \ No newline at end of file +Thank you for your contribution! From 0a764fbc55a32d5241fa4612a4c5615603b06bbd Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Sat, 11 May 2024 17:06:42 +0800 Subject: [PATCH 06/98] Delete README zhCN .md Delete the file that is not part of the original md presentation file. Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README zhCN .md | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 README zhCN .md diff --git a/README zhCN .md b/README zhCN .md deleted file mode 100644 index fde9339ab..000000000 --- a/README zhCN .md +++ /dev/null @@ -1,44 +0,0 @@ - - -
-

Dokploy

-
- -
-Reflex Logo -
-
- - - -Dokploy 是一个免费的可自行托管的平台即服务(PaaS),它使用 Docker 和 Traefik 简化了应用程序和数据库的部署和管理。 Dokploy 旨在提高效率和安全性,允许您在任何 VPS 上部署应用程序。 - - -## 🌟 特点 - - -- **应用**:轻松部署任何类型的应用程序(Node.js、PHP、Python、Go、Ruby 等)。 -- **数据库**:创建和管理数据库,支持 MySQL、PostgreSQL、MongoDB、MariaDB、Redis 等。 -- **Docker 管理**: 轻松部署和管理 Docker 容器。 -- **集成特拉菲克**: 自动与特拉菲克集成,用于路由选择和负载平衡。 -- **实时监控**: 监控 CPU、内存、存储和网络使用情况。 -- **数据库备份**: 支持多个存储目的地,实现自动备份。 - -## 🚀 入门 - -要开始使用,请在 VPS 中运行以下命令: - - -```bash -curl -sSL https://dokploy.com/install.sh | sh -``` - -经过测试的系统: - -- Ubuntu 20.04 -- Debian 11 - -## 📄 文件 - -有关详细文档,请访问 [docs.dokploy.com/docs](https://docs.dokploy.com). - From 18a6e6ac8c11b73d98ef51cf1ad6b1590cd5ff3b Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Sat, 11 May 2024 17:23:26 +0800 Subject: [PATCH 07/98] Delete README.md Because of the renaming of the md introduction file in the second revision, it is the third revision and not part of the original file that was changed at the beginning, so that version of the file is deleted and only the original md file is kept. Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README.md | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index d3c0e2965..000000000 --- a/README.md +++ /dev/null @@ -1,43 +0,0 @@ - - -
-

Dokploy

-
- -
-Reflex Logo -
-
- - - -Dokploy 是一个免费的可自行托管的平台即服务(PaaS),它使用 Docker 和 Traefik 简化了应用程序和数据库的部署和管理。 Dokploy 旨在提高效率和安全性,允许您在任何 VPS 上部署应用程序。 - - -## 🌟 特点 - - -- **应用**:轻松部署任何类型的应用程序(Node.js、PHP、Python、Go、Ruby 等)。 -- **数据库**:创建和管理数据库,支持 MySQL、PostgreSQL、MongoDB、MariaDB、Redis 等。 -- **Docker 管理**: 轻松部署和管理 Docker 容器。 -- **集成特拉菲克**: 自动与特拉菲克集成,用于路由选择和负载平衡。 -- **实时监控**: 监控 CPU、内存、存储和网络使用情况。 -- **数据库备份**: 支持多个存储目的地,实现自动备份。 - -## 🚀 入门 - -要开始使用,请在 VPS 中运行以下命令: - - -```bash -curl -sSL https://dokploy.com/install.sh | sh -``` - -经过测试的系统: - -- Ubuntu 20.04 -- Debian 11 - -## 📄 文件 - -有关详细文档,请访问 [docs.dokploy.com/docs](https://docs.dokploy.com). From 6f05047d6c1cea47ed9a8b72846561a1fdfc89ca Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Sat, 11 May 2024 17:58:06 +0800 Subject: [PATCH 08/98] Create README-zh.md Chinese md introduction file final version Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README-zh.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 README-zh.md diff --git a/README-zh.md b/README-zh.md new file mode 100644 index 000000000..bf58f68e5 --- /dev/null +++ b/README-zh.md @@ -0,0 +1,36 @@ + + +
+

Dokploy

+
+ +
+Reflex Logo +
+
+ + + +Dokploy 是一个免费的自托管平台即服务 (PaaS),它使用 Docker 和 Traefik 简化了应用程序和数据库的部署和管理。 Dokploy 旨在提高效率和安全性,允许您在任何 VPS 上部署应用程序。 + +##🌟 功能 +-**应用程序**: 轻松部署任何类型的应用程序(Node.js、PHP、Python、Go、Ruby 等)。-数据库: 创建和管理数据库,支持 MySQL、PostgreSQL、MongoDB、MariaDB、Redis 等。 +-**Docker 管理**: 轻松部署和管理 Docker 容器。 +-**Traefik 集成**: 自动与 Traefik 集成,用于路由和负载均衡。 +实时监控: 监控 CPU、内存、存储和网络使用情况。 +数据库备份: 支持多种存储目的地自动备份。 +##🚀 入门 +要开始使用,请在 VPS 上运行以下命令: + +```bash +curl -sSL https://dokploy.com/install.sh | sh +``` + +经过测试的系统: + +- Ubuntu 20.04 +- Debian 11 + +## 📄 文档 + +如需查看详细的文档资料,请访问[docs.dokploy.com/docs](https://docs.dokploy.com). From 156cac288b6be162b125d291960b3cc7747d2f62 Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Sat, 11 May 2024 18:04:09 +0800 Subject: [PATCH 09/98] Update README-zh.md Modify display exceptions Forgot the space, so the two ### are not effective Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README-zh.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README-zh.md b/README-zh.md index bf58f68e5..6afe816fa 100644 --- a/README-zh.md +++ b/README-zh.md @@ -13,13 +13,14 @@ Dokploy 是一个免费的自托管平台即服务 (PaaS),它使用 Docker 和 Traefik 简化了应用程序和数据库的部署和管理。 Dokploy 旨在提高效率和安全性,允许您在任何 VPS 上部署应用程序。 -##🌟 功能 +## 🌟 功能 -**应用程序**: 轻松部署任何类型的应用程序(Node.js、PHP、Python、Go、Ruby 等)。-数据库: 创建和管理数据库,支持 MySQL、PostgreSQL、MongoDB、MariaDB、Redis 等。 -**Docker 管理**: 轻松部署和管理 Docker 容器。 -**Traefik 集成**: 自动与 Traefik 集成,用于路由和负载均衡。 实时监控: 监控 CPU、内存、存储和网络使用情况。 数据库备份: 支持多种存储目的地自动备份。 -##🚀 入门 + +## 🚀 入门 要开始使用,请在 VPS 上运行以下命令: ```bash @@ -30,7 +31,7 @@ curl -sSL https://dokploy.com/install.sh | sh - Ubuntu 20.04 - Debian 11 - +- ## 📄 文档 如需查看详细的文档资料,请访问[docs.dokploy.com/docs](https://docs.dokploy.com). From 5682cc12bc69296ef605929a0cebacd874f09a5f Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sat, 11 May 2024 16:27:27 -0600 Subject: [PATCH 10/98] chore: update terms and conditions --- TERMS_AND_CONDITIONS.md | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/TERMS_AND_CONDITIONS.md b/TERMS_AND_CONDITIONS.md index acf376cd0..56ef97fb1 100644 --- a/TERMS_AND_CONDITIONS.md +++ b/TERMS_AND_CONDITIONS.md @@ -1,25 +1,22 @@ # Terms & Conditions +**Dokploy core** is a free and open-source solution intended as an alternative to established cloud platforms like Vercel and Netlify. -Dokploy core is a free and open-source program alternative to Vercel, Netlify, and other cloud services. +The Dokploy team endeavors to mitigate potential defects and issues through stringent testing and adherence to principles of clean coding. Dokploy is provided "AS IS" without any warranties, express or implied. Refer to the [License](https://github.com/Dokploy/Dokploy/blob/main/LICENSE) for details on permissions and restrictions. -Developers of Dokploy do their best to prevent bugs and issues through rigorous testing processes and clean code principles. Dokploy is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and limitations under the [License](https://github.com/Dokploy/Dokploy/blob/main/LICENSE). - -By using Dokploy you agree to Terms and Conditions, and the license of Dokploy. ### Description of Service: -Dokploy core is an open-source program designed to streamline application deployment processes for personal and commercial use. Users are free to install, modify, and run Dokploy on their own machines or within their organizations to enhance their development and deployment workflows. While Dokploy encourages a wide range of uses to foster innovation and efficiency, it is crucial to note that selling Dokploy itself as a service or repackaging it as part of a commercial offering without explicit permission is strictly prohibited. This ensures that the open-source nature of Dokploy remains intact and benefits the community as a whole. +**Dokploy core** is an open-source tool designed to simplify the deployment of applications for both personal and business use. Users are permitted to install, modify, and operate Dokploy independently or within their organizations to improve their development and deployment operations. It is important to note that any commercial resale or redistribution of Dokploy as a service is strictly forbidden without explicit consent. This prohibition ensures the preservation of Dokploy's open-source character for the benefit of the entire community. ### Our Responsibility -Dokploy developers will do their best to ensure that Dokploy remains functional and major bugs are resolved quickly. If you have a feature request, you are more than welcome to open a request for it, but the ultimate decision whether or not the feature will be added is taken by Dokploy's core developers. +The Dokploy development team commits to maintaining the functionality of the software and addressing major issues promptly. While we welcome suggestions for new features, the decision to include them rests solely with the core developers of Dokploy. ### Usage Data -Dokploy doesn't collect any usage data. It is a free and open-source program, and it is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +**Dokploy** does not collect any user data. It is distributed as a free and open-source tool under the terms of "AS IS", without any implied warranties or conditions. -### Future changes +### Future Changes -Terms of Service / Terms & Conditions may change at any point without a prior notice. \ No newline at end of file +The Terms of Service and Terms & Conditions are subject to change without prior notice. From 71f9e7bbd1ed5fe2d24cf7f12bf8d14c30bbec0f Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sat, 11 May 2024 16:27:34 -0600 Subject: [PATCH 11/98] chore: update license --- LICENSE.MD | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/LICENSE.MD b/LICENSE.MD index abf659ebf..9b02d8669 100644 --- a/LICENSE.MD +++ b/LICENSE.MD @@ -1,4 +1,4 @@ -Copyright 2024-2024 Mauricio Siu. +Copyright 2024 Mauricio Siu. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -13,23 +13,12 @@ See the License for the specific language governing permissions and limitations under the License. Appendix: -In case of a conflict, the terms of this appendix supersede the general apache license. -- Unless provided with a written agreement or permission, the paid features of Dokploy (as a service) cannot be modified. -- Unless provided with a written agreement or permission, no persons are permitted to redistribute another paid version of Dokploy. -- Unless provided with a written agreement or permission, no persons are permitted to create the same paid version of Dokploy. -- Furthermore, any modifications of free features of Dokploy should be distributed as free & opensource software. - -Appendix B: - -- **Prohibition of Resale Without Permission:** Notwithstanding any provisions in the main body of the Apache License, Version 2.0, no party is permitted to sell, resell, or otherwise distribute for commercial gain, the software or any of its components, including both original and modified versions, through any form of commercial distribution channels, including but not limited to online marketplaces, software as a service (SaaS) platforms, or physical media distribution, without prior written consent from the copyright holder. - -- **Commercial Distribution:** Any form of distribution of Dokploy, whether for direct profit or indirect financial benefit, through commercial channels is strictly prohibited without a separate commercial agreement negotiated with the copyright holder. This includes but is not limited to, offerings on software marketplaces or through third-party distributors. - -- **Modification of Paid Features:** The paid features of Dokploy (as a service) may not be modified, integrated into other software, or redistributed in any form without explicit written permission from the copyright holder. - -- **Open Source Distribution of Free Features:** Any modifications to the free features of Dokploy must be distributed freely and must not be included in any paid or commercial package without complying with the open-source license terms stipulated in this agreement. - -If you have any questions, please feel free to reach out to us. +In cases of conflict, the provisions in this appendix supersede those in the general Apache License. +- **Modification of Paid Features:** Written consent or a formal agreement is required for modifying any paid features of Dokploy. +- **Prohibition of Unauthorized Resale:** No party is permitted to sell, resell, or otherwise distribute for commercial gain, the software or any of its components, including both original and modified versions, without prior written consent from the copyright holder. +- **Commercial Distribution:** Any distribution of Dokploy, whether for direct profit or indirect financial benefit, through commercial channels is strictly prohibited without a separate commercial agreement negotiated with the copyright holder. +- **Open Source Distribution of Free Features:** Any modifications to the free features of Dokploy must be distributed freely and must not be included in any paid or commercial package unless they comply with the license and appendix terms specified in this agreement. +For further inquiries or permissions, please contact us directly. From 9dffef71e57f5a1fec185a8eb4bbcebd5deb36c2 Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Sun, 12 May 2024 09:36:31 +0800 Subject: [PATCH 12/98] Update README-zh.md Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README-zh.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/README-zh.md b/README-zh.md index 6afe816fa..c10b38b51 100644 --- a/README-zh.md +++ b/README-zh.md @@ -13,15 +13,27 @@ Dokploy 是一个免费的自托管平台即服务 (PaaS),它使用 Docker 和 Traefik 简化了应用程序和数据库的部署和管理。 Dokploy 旨在提高效率和安全性,允许您在任何 VPS 上部署应用程序。 +## 语言 +**English**: + +[github.com/Dokploy/dokploy/blob/canary/README.md] +(https://github.com/Dokploy/dokploy/blob/canary/README.md) + +**Chinese**:[github.com/fxazkwxm/dokploy/blob/canary/README-zh.md](https://github.com/fxazkwxm/dokploy/blob/canary/README-zh.md) + + + + + ## 🌟 功能 --**应用程序**: 轻松部署任何类型的应用程序(Node.js、PHP、Python、Go、Ruby 等)。-数据库: 创建和管理数据库,支持 MySQL、PostgreSQL、MongoDB、MariaDB、Redis 等。 +**应用程序**: 轻松部署任何类型的应用程序(Node.js、PHP、Python、Go、Ruby 等)。-数据库: 创建和管理数据库,支持 MySQL、PostgreSQL、MongoDB、MariaDB、Redis 等。 -**Docker 管理**: 轻松部署和管理 Docker 容器。 -**Traefik 集成**: 自动与 Traefik 集成,用于路由和负载均衡。 实时监控: 监控 CPU、内存、存储和网络使用情况。 数据库备份: 支持多种存储目的地自动备份。 ## 🚀 入门 -要开始使用,请在 VPS 上运行以下命令: +要开始使用 请在VPS 上运行以下命令: ```bash curl -sSL https://dokploy.com/install.sh | sh From 6989047cbed4b8d43c829d332dcc082aa3fca925 Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Sun, 12 May 2024 09:53:26 +0800 Subject: [PATCH 13/98] Create README.md Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 000000000..19e44df07 --- /dev/null +++ b/README.md @@ -0,0 +1,45 @@ + + +
+

Dokploy

+
+ +
+Reflex Logo +
+
+ + + +Dokploy is a free self-hostable Platform as a Service (PaaS) that simplifies the deployment and management of applications and databases using Docker and Traefik. Designed to enhance efficiency and security, Dokploy allows you to deploy your applications on any VPS. + + + +## 🌟 Features + +- **Applications**: Deploy any type of application (Node.js, PHP, Python, Go, Ruby, etc.) with ease. +- **Databases**: Create and manage databases with support for MySQL, PostgreSQL, MongoDB, MariaDB, Redis, and more. +- **Docker Management**: Easily deploy and manage Docker containers. +- **Traefik Integration**: Automatically integrates with Traefik for routing and load balancing. +- **Real-time Monitoring**: Monitor CPU, memory, storage, and network usage. +- **Database Backups**: Automate backups with support for multiple storage destinations. + + +## 🚀 Getting Started + +To get started run the following command in a VPS: + + +```bash +curl -sSL https://dokploy.com/install.sh | sh +``` + +Tested Systems: + +- Ubuntu 20.04 +- Debian 11 + +## 📄 Documentation + +For detailed documentation, visit [docs.dokploy.com/docs](https://docs.dokploy.com). + From e8d50f3c29d7ed13ad40914cb54afb22a5e62e87 Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Sun, 12 May 2024 09:55:11 +0800 Subject: [PATCH 14/98] Update README.md Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 19e44df07..a1c4708a9 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,12 @@ Dokploy is a free self-hostable Platform as a Service (PaaS) that simplifies the +## Explanation +[English](README.md) | [中文](README-zh.md) + + + + ## 🌟 Features - **Applications**: Deploy any type of application (Node.js, PHP, Python, Go, Ruby, etc.) with ease. From 0d41e7d0ef25f1df55523505084cf7fcb6fc40aa Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Sun, 12 May 2024 09:56:40 +0800 Subject: [PATCH 15/98] Update README-zh.md Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README-zh.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README-zh.md b/README-zh.md index c10b38b51..5331065be 100644 --- a/README-zh.md +++ b/README-zh.md @@ -14,12 +14,8 @@ Dokploy 是一个免费的自托管平台即服务 (PaaS),它使用 Docker 和 Traefik 简化了应用程序和数据库的部署和管理。 Dokploy 旨在提高效率和安全性,允许您在任何 VPS 上部署应用程序。 ## 语言 -**English**: - -[github.com/Dokploy/dokploy/blob/canary/README.md] -(https://github.com/Dokploy/dokploy/blob/canary/README.md) - -**Chinese**:[github.com/fxazkwxm/dokploy/blob/canary/README-zh.md](https://github.com/fxazkwxm/dokploy/blob/canary/README-zh.md) +[English](README.md) +[中文](README-zh.md) From 704d682e3da0790b4fe62f30f102de291e563201 Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Sun, 12 May 2024 09:57:08 +0800 Subject: [PATCH 16/98] Update README-zh.md Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README-zh.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README-zh.md b/README-zh.md index 5331065be..8b291f369 100644 --- a/README-zh.md +++ b/README-zh.md @@ -15,6 +15,7 @@ Dokploy 是一个免费的自托管平台即服务 (PaaS),它使用 Docker 和 ## 语言 [English](README.md) + [中文](README-zh.md) From c1f48578f04f074cfea0a8b71e7329a7fb1cb2c3 Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Sun, 12 May 2024 10:00:57 +0800 Subject: [PATCH 17/98] Update README-zh.md Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README-zh.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-zh.md b/README-zh.md index 8b291f369..7b9522b63 100644 --- a/README-zh.md +++ b/README-zh.md @@ -40,7 +40,7 @@ curl -sSL https://dokploy.com/install.sh | sh - Ubuntu 20.04 - Debian 11 -- + ## 📄 文档 如需查看详细的文档资料,请访问[docs.dokploy.com/docs](https://docs.dokploy.com). From 1ac69fb81c4155ca9989ba4bba5f7edbe22764a2 Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Sun, 12 May 2024 10:04:15 +0800 Subject: [PATCH 18/98] Update README-zh.md Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README-zh.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-zh.md b/README-zh.md index 7b9522b63..60d91f97e 100644 --- a/README-zh.md +++ b/README-zh.md @@ -43,4 +43,4 @@ curl -sSL https://dokploy.com/install.sh | sh ## 📄 文档 -如需查看详细的文档资料,请访问[docs.dokploy.com/docs](https://docs.dokploy.com). +如需查看详细的文档资料 请访问[docs.dokploy.com/docs](https://docs.dokploy.com) From ff1cb7d6aeaf0cda503309723008d8d1d627f8ab Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Sun, 12 May 2024 10:07:09 +0800 Subject: [PATCH 19/98] Update README-zh.md Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README-zh.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README-zh.md b/README-zh.md index 60d91f97e..2f0c25a0c 100644 --- a/README-zh.md +++ b/README-zh.md @@ -23,8 +23,11 @@ Dokploy 是一个免费的自托管平台即服务 (PaaS),它使用 Docker 和 ## 🌟 功能 + **应用程序**: 轻松部署任何类型的应用程序(Node.js、PHP、Python、Go、Ruby 等)。-数据库: 创建和管理数据库,支持 MySQL、PostgreSQL、MongoDB、MariaDB、Redis 等。 + -**Docker 管理**: 轻松部署和管理 Docker 容器。 + -**Traefik 集成**: 自动与 Traefik 集成,用于路由和负载均衡。 实时监控: 监控 CPU、内存、存储和网络使用情况。 数据库备份: 支持多种存储目的地自动备份。 From 45de9a879dde5c299a40cc079ed1dcdf2a1968a2 Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Sun, 12 May 2024 10:09:35 +0800 Subject: [PATCH 20/98] Update README-zh.md Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README-zh.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README-zh.md b/README-zh.md index 2f0c25a0c..2f5c30c1e 100644 --- a/README-zh.md +++ b/README-zh.md @@ -24,11 +24,9 @@ Dokploy 是一个免费的自托管平台即服务 (PaaS),它使用 Docker 和 ## 🌟 功能 -**应用程序**: 轻松部署任何类型的应用程序(Node.js、PHP、Python、Go、Ruby 等)。-数据库: 创建和管理数据库,支持 MySQL、PostgreSQL、MongoDB、MariaDB、Redis 等。 - --**Docker 管理**: 轻松部署和管理 Docker 容器。 - --**Traefik 集成**: 自动与 Traefik 集成,用于路由和负载均衡。 +- **应用程序**: 轻松部署任何类型的应用程序(Node.js、PHP、Python、Go、Ruby 等)。-数据库: 创建和管理数据库,支持 MySQL、PostgreSQL、MongoDB、MariaDB、Redis 等。 +- **Docker 管理**: 轻松部署和管理 Docker 容器。 +- **Traefik 集成**: 自动与 Traefik 集成,用于路由和负载均衡。 实时监控: 监控 CPU、内存、存储和网络使用情况。 数据库备份: 支持多种存储目的地自动备份。 From ddc3274f385725ee3d60e39ef1e09778458ddb9f Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Sun, 12 May 2024 10:17:14 +0800 Subject: [PATCH 21/98] Update README-zh.md Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README-zh.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README-zh.md b/README-zh.md index 2f5c30c1e..ce2fa87f2 100644 --- a/README-zh.md +++ b/README-zh.md @@ -27,8 +27,8 @@ Dokploy 是一个免费的自托管平台即服务 (PaaS),它使用 Docker 和 - **应用程序**: 轻松部署任何类型的应用程序(Node.js、PHP、Python、Go、Ruby 等)。-数据库: 创建和管理数据库,支持 MySQL、PostgreSQL、MongoDB、MariaDB、Redis 等。 - **Docker 管理**: 轻松部署和管理 Docker 容器。 - **Traefik 集成**: 自动与 Traefik 集成,用于路由和负载均衡。 -实时监控: 监控 CPU、内存、存储和网络使用情况。 -数据库备份: 支持多种存储目的地自动备份。 +- **实时监控**: 监控 CPU,内存,存储和网络使用情况。 +- **数据库备份**: 支持多种存储目的地自动备份。 ## 🚀 入门 要开始使用 请在VPS 上运行以下命令: From c7e3b10eb37cf596a86f2fd684384c73a6bbc5b4 Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Sun, 12 May 2024 10:21:20 +0800 Subject: [PATCH 22/98] Update README-zh.md Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README-zh.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README-zh.md b/README-zh.md index ce2fa87f2..05675f011 100644 --- a/README-zh.md +++ b/README-zh.md @@ -27,8 +27,8 @@ Dokploy 是一个免费的自托管平台即服务 (PaaS),它使用 Docker 和 - **应用程序**: 轻松部署任何类型的应用程序(Node.js、PHP、Python、Go、Ruby 等)。-数据库: 创建和管理数据库,支持 MySQL、PostgreSQL、MongoDB、MariaDB、Redis 等。 - **Docker 管理**: 轻松部署和管理 Docker 容器。 - **Traefik 集成**: 自动与 Traefik 集成,用于路由和负载均衡。 -- **实时监控**: 监控 CPU,内存,存储和网络使用情况。 -- **数据库备份**: 支持多种存储目的地自动备份。 +- **实时监控**: 监控 CPU,内存,存储和网络使用情况。 +- **数据库备份**: 支持多种存储目的地自动备份。 ## 🚀 入门 要开始使用 请在VPS 上运行以下命令: From 26e1d65c36e5f2c1eac818931da8faae2848f506 Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Sun, 12 May 2024 10:23:28 +0800 Subject: [PATCH 23/98] Update README-zh.md Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README-zh.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README-zh.md b/README-zh.md index 05675f011..ce2fa87f2 100644 --- a/README-zh.md +++ b/README-zh.md @@ -27,8 +27,8 @@ Dokploy 是一个免费的自托管平台即服务 (PaaS),它使用 Docker 和 - **应用程序**: 轻松部署任何类型的应用程序(Node.js、PHP、Python、Go、Ruby 等)。-数据库: 创建和管理数据库,支持 MySQL、PostgreSQL、MongoDB、MariaDB、Redis 等。 - **Docker 管理**: 轻松部署和管理 Docker 容器。 - **Traefik 集成**: 自动与 Traefik 集成,用于路由和负载均衡。 -- **实时监控**: 监控 CPU,内存,存储和网络使用情况。 -- **数据库备份**: 支持多种存储目的地自动备份。 +- **实时监控**: 监控 CPU,内存,存储和网络使用情况。 +- **数据库备份**: 支持多种存储目的地自动备份。 ## 🚀 入门 要开始使用 请在VPS 上运行以下命令: From 428156579ddb88bccf9a33931d6ec7c10367fbe6 Mon Sep 17 00:00:00 2001 From: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> Date: Sun, 12 May 2024 10:26:29 +0800 Subject: [PATCH 24/98] Update README-zh.md Signed-off-by: AndroidEnthusiast <85106891+kwxmxb@users.noreply.github.com> --- README-zh.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-zh.md b/README-zh.md index ce2fa87f2..0e4982e08 100644 --- a/README-zh.md +++ b/README-zh.md @@ -24,7 +24,7 @@ Dokploy 是一个免费的自托管平台即服务 (PaaS),它使用 Docker 和 ## 🌟 功能 -- **应用程序**: 轻松部署任何类型的应用程序(Node.js、PHP、Python、Go、Ruby 等)。-数据库: 创建和管理数据库,支持 MySQL、PostgreSQL、MongoDB、MariaDB、Redis 等。 +- **应用程序**: 轻松部署任何类型的应用程序(Node.js,PHP,Python,Go、Ruby 等)。数据库: 创建和管理数据库,支持 MySQL,PostgreSQL,MongoDB、MariaDB、Redis 等。 - **Docker 管理**: 轻松部署和管理 Docker 容器。 - **Traefik 集成**: 自动与 Traefik 集成,用于路由和负载均衡。 - **实时监控**: 监控 CPU,内存,存储和网络使用情况。 From 6c792564aefd19ad9a3b55575ba3b22f77f62080 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Mon, 13 May 2024 01:18:27 -0600 Subject: [PATCH 25/98] feat: add docker registry upload --- .../cluster/show-cluster-settings.tsx | 199 ++ .../cluster/registry/add-docker-registry.tsx | 94 +- .../registry/add-self-docker-registry.tsx | 179 ++ ...-self-registry.tsx => delete-registry.tsx} | 35 +- .../cluster/registry/show-registry.tsx | 46 +- drizzle/0005_cute_terror.sql | 22 + drizzle/0006_oval_jimmy_woo.sql | 6 + drizzle/0007_cute_guardsmen.sql | 1 + drizzle/0008_lazy_sage.sql | 7 + drizzle/0009_majestic_spencer_smythe.sql | 1 + drizzle/0010_lean_black_widow.sql | 1 + drizzle/0011_petite_calypso.sql | 1 + drizzle/meta/0000_snapshot.json | 394 +-- drizzle/meta/0001_snapshot.json | 394 +-- drizzle/meta/0002_snapshot.json | 394 +-- drizzle/meta/0003_snapshot.json | 394 +-- drizzle/meta/0004_snapshot.json | 394 +-- drizzle/meta/0005_snapshot.json | 2295 ++++++++++++++++ drizzle/meta/0006_snapshot.json | 2331 ++++++++++++++++ drizzle/meta/0007_snapshot.json | 2338 ++++++++++++++++ drizzle/meta/0008_snapshot.json | 2338 ++++++++++++++++ drizzle/meta/0009_snapshot.json | 2338 ++++++++++++++++ drizzle/meta/0010_snapshot.json | 2344 +++++++++++++++++ drizzle/meta/0011_snapshot.json | 2344 +++++++++++++++++ drizzle/meta/_journal.json | 49 + package.json | 8 +- .../services/application/[applicationId].tsx | 2 + pnpm-lock.yaml | 42 +- server/api/root.ts | 2 + server/api/routers/registry.ts | 48 +- server/api/services/application.ts | 1 + server/api/services/registry.ts | 16 + server/constants/index.ts | 1 + server/db/drizzle.config.ts | 17 +- server/db/schema/application.ts | 9 + server/db/schema/registry.ts | 16 +- server/setup/registry-setup.ts | 89 + server/utils/builders/index.ts | 10 +- server/utils/cluster/upload.ts | 67 + server/utils/traefik/domain.ts | 5 +- server/utils/traefik/registry.ts | 67 + 41 files changed, 18267 insertions(+), 1072 deletions(-) create mode 100644 components/dashboard/application/advanced/cluster/show-cluster-settings.tsx create mode 100644 components/dashboard/settings/cluster/registry/add-self-docker-registry.tsx rename components/dashboard/settings/cluster/registry/{add-self-registry.tsx => delete-registry.tsx} (55%) create mode 100644 drizzle/0005_cute_terror.sql create mode 100644 drizzle/0006_oval_jimmy_woo.sql create mode 100644 drizzle/0007_cute_guardsmen.sql create mode 100644 drizzle/0008_lazy_sage.sql create mode 100644 drizzle/0009_majestic_spencer_smythe.sql create mode 100644 drizzle/0010_lean_black_widow.sql create mode 100644 drizzle/0011_petite_calypso.sql create mode 100644 drizzle/meta/0005_snapshot.json create mode 100644 drizzle/meta/0006_snapshot.json create mode 100644 drizzle/meta/0007_snapshot.json create mode 100644 drizzle/meta/0008_snapshot.json create mode 100644 drizzle/meta/0009_snapshot.json create mode 100644 drizzle/meta/0010_snapshot.json create mode 100644 drizzle/meta/0011_snapshot.json create mode 100644 server/setup/registry-setup.ts create mode 100644 server/utils/cluster/upload.ts create mode 100644 server/utils/traefik/registry.ts diff --git a/components/dashboard/application/advanced/cluster/show-cluster-settings.tsx b/components/dashboard/application/advanced/cluster/show-cluster-settings.tsx new file mode 100644 index 000000000..187c350f3 --- /dev/null +++ b/components/dashboard/application/advanced/cluster/show-cluster-settings.tsx @@ -0,0 +1,199 @@ +import React from "react"; +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from "@/components/ui/card"; +import { api } from "@/utils/api"; +import { z } from "zod"; +import { + Form, + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@/components/ui/form"; +import { toast } from "sonner"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { useForm } from "react-hook-form"; +import { useEffect } from "react"; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectLabel, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; +import Link from "next/link"; +import { Server } from "lucide-react"; + +interface Props { + applicationId: string; +} + +const AddRedirectchema = z.object({ + replicas: z.number(), + registryId: z.string(), +}); + +type AddCommand = z.infer; + +export const ShowClusterSettings = ({ applicationId }: Props) => { + const { data } = api.application.one.useQuery( + { + applicationId, + }, + { enabled: !!applicationId }, + ); + + const { data: registries } = api.registry.all.useQuery(); + + const utils = api.useUtils(); + + const { mutateAsync, isLoading } = api.application.update.useMutation(); + + const form = useForm({ + defaultValues: { + registryId: data?.registryId || "", + replicas: data?.replicas || 1, + }, + resolver: zodResolver(AddRedirectchema), + }); + + useEffect(() => { + if (data?.command) { + form.reset({ + registryId: data?.registryId || "", + replicas: data?.replicas || 1, + }); + } + }, [form, form.reset, form.formState.isSubmitSuccessful, data?.command]); + + const onSubmit = async (data: AddCommand) => { + await mutateAsync({ + applicationId, + registryId: data?.registryId, + replicas: data?.replicas, + }) + .then(async () => { + toast.success("Command Updated"); + await utils.application.one.invalidate({ + applicationId, + }); + }) + .catch(() => { + toast.error("Error to update the command"); + }); + }; + + return ( + + +
+ Cluster Settings + + Add the registry and the replicas of the application + +
+
+ +
+ +
+ ( + + Replicas + + { + field.onChange(Number(e.target.value)); + }} + type="number" + /> + + + + + )} + /> +
+ + {registries && registries?.length === 0 ? ( +
+
+ + + To use a cluster feature, you need to configure at least a + registry first. Please, go to{" "} + + Settings + {" "} + to do so. + +
+
+ ) : ( + <> + ( + + Select a registry + + + )} + /> + + )} +
+ +
+ + +
+
+ ); +}; diff --git a/components/dashboard/settings/cluster/registry/add-docker-registry.tsx b/components/dashboard/settings/cluster/registry/add-docker-registry.tsx index efef6ca89..c5cf228da 100644 --- a/components/dashboard/settings/cluster/registry/add-docker-registry.tsx +++ b/components/dashboard/settings/cluster/registry/add-docker-registry.tsx @@ -23,6 +23,7 @@ import { AlertTriangle, Container } from "lucide-react"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; +import { toast } from "sonner"; import { z } from "zod"; const AddRegistrySchema = z.object({ @@ -38,6 +39,7 @@ const AddRegistrySchema = z.object({ registryUrl: z.string().min(1, { message: "Registry URL is required", }), + imagePrefix: z.string(), }); type AddRegistry = z.infer; @@ -45,39 +47,55 @@ type AddRegistry = z.infer; export const AddRegistry = () => { const utils = api.useUtils(); const [isOpen, setIsOpen] = useState(false); - const { mutateAsync, error, isError } = api.project.create.useMutation(); + const { mutateAsync, error, isError } = api.registry.create.useMutation(); + const { mutateAsync: testRegistry, isLoading } = + api.registry.testRegistry.useMutation(); const router = useRouter(); const form = useForm({ defaultValues: { username: "", password: "", registryUrl: "", + imagePrefix: "", + registryName: "", }, resolver: zodResolver(AddRegistrySchema), }); + console.log(form.formState.errors); + + const password = form.watch("password"); + const username = form.watch("username"); + const registryUrl = form.watch("registryUrl"); + const registryName = form.watch("registryName"); + const imagePrefix = form.watch("imagePrefix"); + useEffect(() => { form.reset({ username: "", password: "", registryUrl: "", + imagePrefix: "", }); }, [form, form.reset, form.formState.isSubmitSuccessful]); const onSubmit = async (data: AddRegistry) => { - // await mutateAsync({ - // name: data.name, - // description: data.description, - // }) - // .then(async (data) => { - // await utils.project.all.invalidate(); - // toast.success("Project Created"); - // setIsOpen(false); - // router.push(`/dashboard/project/${data.projectId}`); - // }) - // .catch(() => { - // toast.error("Error to create a project"); - // }); + await mutateAsync({ + password: data.password, + registryName: data.registryName, + username: data.username, + registryUrl: data.registryUrl, + registryType: "cloud", + imagePrefix: data.imagePrefix, + }) + .then(async (data) => { + await utils.registry.all.invalidate(); + toast.success("Registry added"); + setIsOpen(false); + }) + .catch(() => { + toast.error("Error to add a registry"); + }); }; return ( @@ -160,6 +178,22 @@ export const AddRegistry = () => { )} /> +
+ ( + + Image Prefix + + + + + + + )} + /> +
{ Registry URL @@ -180,7 +213,34 @@ export const AddRegistry = () => { )} />
- + + diff --git a/components/dashboard/settings/cluster/registry/add-self-docker-registry.tsx b/components/dashboard/settings/cluster/registry/add-self-docker-registry.tsx new file mode 100644 index 000000000..78a8d5008 --- /dev/null +++ b/components/dashboard/settings/cluster/registry/add-self-docker-registry.tsx @@ -0,0 +1,179 @@ +import { Button } from "@/components/ui/button"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/dialog"; +import { + Form, + FormControl, + FormDescription, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@/components/ui/form"; +import { Input } from "@/components/ui/input"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { AlertTriangle, Container } from "lucide-react"; +import { useRouter } from "next/router"; +import { useEffect, useState } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; + +const AddRegistrySchema = z.object({ + username: z.string().min(1, { + message: "Username is required", + }), + password: z.string().min(1, { + message: "Password is required", + }), + registryUrl: z.string().min(1, { + message: "Registry URL is required", + }), +}); + +type AddRegistry = z.infer; + +export const AddSelfHostedRegistry = () => { + const utils = api.useUtils(); + const [isOpen, setIsOpen] = useState(false); + const { mutateAsync, error, isError, isLoading } = + api.registry.enableSelfHostedRegistry.useMutation(); + const router = useRouter(); + const form = useForm({ + defaultValues: { + username: "siumauricio", + password: "Password123", + registryUrl: "https://registry.dokploy.com", + }, + resolver: zodResolver(AddRegistrySchema), + }); + + useEffect(() => { + form.reset({ + registryUrl: "https://registry.dokploy.com", + username: "siumauricio", + password: "Password123", + }); + }, [form, form.reset, form.formState.isSubmitSuccessful]); + + const onSubmit = async (data: AddRegistry) => { + await mutateAsync({ + registryUrl: data.registryUrl, + username: data.username, + password: data.password, + }) + .then(async (data) => { + await utils.registry.all.invalidate(); + toast.success("Self Hosted Registry Created"); + setIsOpen(false); + }) + .catch(() => { + toast.error("Error to create a self hosted registry"); + }); + }; + + return ( + + + + + + + Add a self hosted registry + + Fill the next fields to add a self hosted registry. + + + {isError && ( +
+ + + {error?.message} + +
+ )} +
+ +
+ ( + + Username + + + + + + + )} + /> +
+
+ ( + + Password + + + + + + + )} + /> +
+
+ ( + + Registry URL + + + + + Point a DNS record to the VPS IP address. + + + + + )} + /> +
+ + + +
+ +
+
+ ); +}; diff --git a/components/dashboard/settings/cluster/registry/add-self-registry.tsx b/components/dashboard/settings/cluster/registry/delete-registry.tsx similarity index 55% rename from components/dashboard/settings/cluster/registry/add-self-registry.tsx rename to components/dashboard/settings/cluster/registry/delete-registry.tsx index ee82487d5..a87f2e4e4 100644 --- a/components/dashboard/settings/cluster/registry/add-self-registry.tsx +++ b/components/dashboard/settings/cluster/registry/delete-registry.tsx @@ -12,35 +12,44 @@ import { } from "@/components/ui/alert-dialog"; import { Button } from "@/components/ui/button"; import { api } from "@/utils/api"; +import { TrashIcon } from "lucide-react"; import { toast } from "sonner"; -export const AddSelfRegistry = () => { +interface Props { + registryId: string; +} +export const DeleteRegistry = ({ registryId }: Props) => { + const { mutateAsync, isLoading } = api.registry.remove.useMutation(); + const utils = api.useUtils(); return ( - + Are you absolutely sure? - This will setup a self hosted registry. + This action cannot be undone. This will permanently delete the + registry. Cancel { - // await mutateAsync({ - // authId, - // }) - // .then(async () => { - // utils.user.all.invalidate(); - // toast.success("User delete succesfully"); - // }) - // .catch(() => { - // toast.error("Error to delete the user"); - // }); + await mutateAsync({ + registryId, + }) + .then(async () => { + utils.registry.all.invalidate(); + toast.success("Registry deleted"); + }) + .catch(() => { + toast.error("Error to delete the registry"); + }); }} > Confirm diff --git a/components/dashboard/settings/cluster/registry/show-registry.tsx b/components/dashboard/settings/cluster/registry/show-registry.tsx index 4e85c9946..3bfc3bada 100644 --- a/components/dashboard/settings/cluster/registry/show-registry.tsx +++ b/components/dashboard/settings/cluster/registry/show-registry.tsx @@ -6,19 +6,36 @@ import { CardTitle, } from "@/components/ui/card"; import { api } from "@/utils/api"; -import { Server, ShieldCheck } from "lucide-react"; +import { Server } from "lucide-react"; import { AddRegistry } from "./add-docker-registry"; -import { AddSelfRegistry } from "./add-self-registry"; +import { AddSelfHostedRegistry } from "./add-self-docker-registry"; +import { DeleteRegistry } from "./delete-registry"; export const ShowRegistry = () => { - const { data } = api.certificates.all.useQuery(); + const { data } = api.registry.all.useQuery(); + + const haveSelfHostedRegistry = data?.some( + (registry) => registry.registryType === "selfHosted", + ); return (
- - Clusters - Add cluster to your application. + +
+ Clusters + Add cluster to your application. +
+ +
+ {data && data?.length > 0 && ( + <> + {!haveSelfHostedRegistry && } + + + + )} +
{data?.length === 0 ? ( @@ -29,29 +46,28 @@ export const ShowRegistry = () => {
- +
{/* */}
) : ( -
- {data?.map((destination, index) => ( +
+ {data?.map((registry, index) => (
- {index + 1}. {destination.name} + {index + 1}. {registry.registryName}
- {/* */} +
))} +
{/* */}
)} diff --git a/drizzle/0005_cute_terror.sql b/drizzle/0005_cute_terror.sql new file mode 100644 index 000000000..70756b4d6 --- /dev/null +++ b/drizzle/0005_cute_terror.sql @@ -0,0 +1,22 @@ +DO $$ BEGIN + CREATE TYPE "RegistryType" AS ENUM('selfHosted', 'cloud'); +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "registry" ( + "registryId" text PRIMARY KEY NOT NULL, + "registryName" text NOT NULL, + "username" text NOT NULL, + "password" text NOT NULL, + "registryUrl" text NOT NULL, + "createdAt" text NOT NULL, + "selfHosted" "RegistryType" DEFAULT 'cloud' NOT NULL, + "adminId" text NOT NULL +); +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "registry" ADD CONSTRAINT "registry_adminId_admin_adminId_fk" FOREIGN KEY ("adminId") REFERENCES "admin"("adminId") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; diff --git a/drizzle/0006_oval_jimmy_woo.sql b/drizzle/0006_oval_jimmy_woo.sql new file mode 100644 index 000000000..e5eb2800f --- /dev/null +++ b/drizzle/0006_oval_jimmy_woo.sql @@ -0,0 +1,6 @@ +ALTER TABLE "application" ADD COLUMN "registryId" text;--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "application" ADD CONSTRAINT "application_registryId_registry_registryId_fk" FOREIGN KEY ("registryId") REFERENCES "public"."registry"("registryId") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; diff --git a/drizzle/0007_cute_guardsmen.sql b/drizzle/0007_cute_guardsmen.sql new file mode 100644 index 000000000..39b38c436 --- /dev/null +++ b/drizzle/0007_cute_guardsmen.sql @@ -0,0 +1 @@ +ALTER TABLE "application" ADD COLUMN "replicas" integer DEFAULT 1; \ No newline at end of file diff --git a/drizzle/0008_lazy_sage.sql b/drizzle/0008_lazy_sage.sql new file mode 100644 index 000000000..409ef784b --- /dev/null +++ b/drizzle/0008_lazy_sage.sql @@ -0,0 +1,7 @@ +ALTER TABLE "application" DROP CONSTRAINT "application_registryId_registry_registryId_fk"; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "application" ADD CONSTRAINT "application_registryId_registry_registryId_fk" FOREIGN KEY ("registryId") REFERENCES "public"."registry"("registryId") ON DELETE set null ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; diff --git a/drizzle/0009_majestic_spencer_smythe.sql b/drizzle/0009_majestic_spencer_smythe.sql new file mode 100644 index 000000000..1b0523931 --- /dev/null +++ b/drizzle/0009_majestic_spencer_smythe.sql @@ -0,0 +1 @@ +ALTER TABLE "application" ALTER COLUMN "replicas" SET NOT NULL; \ No newline at end of file diff --git a/drizzle/0010_lean_black_widow.sql b/drizzle/0010_lean_black_widow.sql new file mode 100644 index 000000000..95c675cec --- /dev/null +++ b/drizzle/0010_lean_black_widow.sql @@ -0,0 +1 @@ +ALTER TABLE "registry" ADD COLUMN "imagePrefix" text NOT NULL; \ No newline at end of file diff --git a/drizzle/0011_petite_calypso.sql b/drizzle/0011_petite_calypso.sql new file mode 100644 index 000000000..f6588550a --- /dev/null +++ b/drizzle/0011_petite_calypso.sql @@ -0,0 +1 @@ +ALTER TABLE "registry" ALTER COLUMN "imagePrefix" DROP NOT NULL; \ No newline at end of file diff --git a/drizzle/meta/0000_snapshot.json b/drizzle/meta/0000_snapshot.json index 7e9c52484..28f27722f 100644 --- a/drizzle/meta/0000_snapshot.json +++ b/drizzle/meta/0000_snapshot.json @@ -1,10 +1,8 @@ { - "id": "c6215051-7cd1-412d-b8df-b50d58acacff", - "prevId": "00000000-0000-0000-0000-000000000000", - "version": "5", - "dialect": "pg", + "version": "6", + "dialect": "postgresql", "tables": { - "application": { + "public.application": { "name": "application", "schema": "", "columns": { @@ -234,29 +232,29 @@ "application_projectId_project_projectId_fk": { "name": "application_projectId_project_projectId_fk", "tableFrom": "application", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "application_appName_unique": { "name": "application_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "postgres": { + "public.postgres": { "name": "postgres", "schema": "", "columns": { @@ -375,29 +373,29 @@ "postgres_projectId_project_projectId_fk": { "name": "postgres_projectId_project_projectId_fk", "tableFrom": "postgres", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "postgres_appName_unique": { "name": "postgres_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -499,34 +497,34 @@ "user_adminId_admin_adminId_fk": { "name": "user_adminId_admin_adminId_fk", "tableFrom": "user", - "tableTo": "admin", "columnsFrom": [ "adminId" ], + "tableTo": "admin", "columnsTo": [ "adminId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "user_authId_auth_id_fk": { "name": "user_authId_auth_id_fk", "tableFrom": "user", - "tableTo": "auth", "columnsFrom": [ "authId" ], + "tableTo": "auth", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "admin": { + "public.admin": { "name": "admin", "schema": "", "columns": { @@ -628,21 +626,21 @@ "admin_authId_auth_id_fk": { "name": "admin_authId_auth_id_fk", "tableFrom": "admin", - "tableTo": "auth", "columnsFrom": [ "authId" ], + "tableTo": "auth", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "auth": { + "public.auth": { "name": "auth", "schema": "", "columns": { @@ -689,14 +687,14 @@ "uniqueConstraints": { "auth_email_unique": { "name": "auth_email_unique", - "nullsNotDistinct": false, "columns": [ "email" - ] + ], + "nullsNotDistinct": false } } }, - "project": { + "public.project": { "name": "project", "schema": "", "columns": { @@ -736,21 +734,21 @@ "project_adminId_admin_adminId_fk": { "name": "project_adminId_admin_adminId_fk", "tableFrom": "project", - "tableTo": "admin", "columnsFrom": [ "adminId" ], + "tableTo": "admin", "columnsTo": [ "adminId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "domain": { + "public.domain": { "name": "domain", "schema": "", "columns": { @@ -818,21 +816,21 @@ "domain_applicationId_application_applicationId_fk": { "name": "domain_applicationId_application_applicationId_fk", "tableFrom": "domain", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "mariadb": { + "public.mariadb": { "name": "mariadb", "schema": "", "columns": { @@ -957,29 +955,29 @@ "mariadb_projectId_project_projectId_fk": { "name": "mariadb_projectId_project_projectId_fk", "tableFrom": "mariadb", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "mariadb_appName_unique": { "name": "mariadb_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "mongo": { + "public.mongo": { "name": "mongo", "schema": "", "columns": { @@ -1092,29 +1090,29 @@ "mongo_projectId_project_projectId_fk": { "name": "mongo_projectId_project_projectId_fk", "tableFrom": "mongo", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "mongo_appName_unique": { "name": "mongo_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "mysql": { + "public.mysql": { "name": "mysql", "schema": "", "columns": { @@ -1239,29 +1237,29 @@ "mysql_projectId_project_projectId_fk": { "name": "mysql_projectId_project_projectId_fk", "tableFrom": "mysql", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "mysql_appName_unique": { "name": "mysql_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "backup": { + "public.backup": { "name": "backup", "schema": "", "columns": { @@ -1337,73 +1335,73 @@ "backup_destinationId_destination_destinationId_fk": { "name": "backup_destinationId_destination_destinationId_fk", "tableFrom": "backup", - "tableTo": "destination", "columnsFrom": [ "destinationId" ], + "tableTo": "destination", "columnsTo": [ "destinationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_postgresId_postgres_postgresId_fk": { "name": "backup_postgresId_postgres_postgresId_fk", "tableFrom": "backup", - "tableTo": "postgres", "columnsFrom": [ "postgresId" ], + "tableTo": "postgres", "columnsTo": [ "postgresId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_mariadbId_mariadb_mariadbId_fk": { "name": "backup_mariadbId_mariadb_mariadbId_fk", "tableFrom": "backup", - "tableTo": "mariadb", "columnsFrom": [ "mariadbId" ], + "tableTo": "mariadb", "columnsTo": [ "mariadbId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_mysqlId_mysql_mysqlId_fk": { "name": "backup_mysqlId_mysql_mysqlId_fk", "tableFrom": "backup", - "tableTo": "mysql", "columnsFrom": [ "mysqlId" ], + "tableTo": "mysql", "columnsTo": [ "mysqlId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_mongoId_mongo_mongoId_fk": { "name": "backup_mongoId_mongo_mongoId_fk", "tableFrom": "backup", - "tableTo": "mongo", "columnsFrom": [ "mongoId" ], + "tableTo": "mongo", "columnsTo": [ "mongoId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "destination": { + "public.destination": { "name": "destination", "schema": "", "columns": { @@ -1461,21 +1459,21 @@ "destination_adminId_admin_adminId_fk": { "name": "destination_adminId_admin_adminId_fk", "tableFrom": "destination", - "tableTo": "admin", "columnsFrom": [ "adminId" ], + "tableTo": "admin", "columnsTo": [ "adminId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "deployment": { + "public.deployment": { "name": "deployment", "schema": "", "columns": { @@ -1522,21 +1520,21 @@ "deployment_applicationId_application_applicationId_fk": { "name": "deployment_applicationId_application_applicationId_fk", "tableFrom": "deployment", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "mount": { + "public.mount": { "name": "mount", "schema": "", "columns": { @@ -1625,86 +1623,86 @@ "mount_applicationId_application_applicationId_fk": { "name": "mount_applicationId_application_applicationId_fk", "tableFrom": "mount", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_postgresId_postgres_postgresId_fk": { "name": "mount_postgresId_postgres_postgresId_fk", "tableFrom": "mount", - "tableTo": "postgres", "columnsFrom": [ "postgresId" ], + "tableTo": "postgres", "columnsTo": [ "postgresId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_mariadbId_mariadb_mariadbId_fk": { "name": "mount_mariadbId_mariadb_mariadbId_fk", "tableFrom": "mount", - "tableTo": "mariadb", "columnsFrom": [ "mariadbId" ], + "tableTo": "mariadb", "columnsTo": [ "mariadbId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_mongoId_mongo_mongoId_fk": { "name": "mount_mongoId_mongo_mongoId_fk", "tableFrom": "mount", - "tableTo": "mongo", "columnsFrom": [ "mongoId" ], + "tableTo": "mongo", "columnsTo": [ "mongoId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_mysqlId_mysql_mysqlId_fk": { "name": "mount_mysqlId_mysql_mysqlId_fk", "tableFrom": "mount", - "tableTo": "mysql", "columnsFrom": [ "mysqlId" ], + "tableTo": "mysql", "columnsTo": [ "mysqlId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_redisId_redis_redisId_fk": { "name": "mount_redisId_redis_redisId_fk", "tableFrom": "mount", - "tableTo": "redis", "columnsFrom": [ "redisId" ], + "tableTo": "redis", "columnsTo": [ "redisId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "certificate": { + "public.certificate": { "name": "certificate", "schema": "", "columns": { @@ -1751,14 +1749,14 @@ "uniqueConstraints": { "certificate_certificatePath_unique": { "name": "certificate_certificatePath_unique", - "nullsNotDistinct": false, "columns": [ "certificatePath" - ] + ], + "nullsNotDistinct": false } } }, - "session": { + "public.session": { "name": "session", "schema": "", "columns": { @@ -1786,21 +1784,21 @@ "session_user_id_auth_id_fk": { "name": "session_user_id_auth_id_fk", "tableFrom": "session", - "tableTo": "auth", "columnsFrom": [ "user_id" ], + "tableTo": "auth", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "redirect": { + "public.redirect": { "name": "redirect", "schema": "", "columns": { @@ -1853,21 +1851,21 @@ "redirect_applicationId_application_applicationId_fk": { "name": "redirect_applicationId_application_applicationId_fk", "tableFrom": "redirect", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "security": { + "public.security": { "name": "security", "schema": "", "columns": { @@ -1907,30 +1905,30 @@ "security_applicationId_application_applicationId_fk": { "name": "security_applicationId_application_applicationId_fk", "tableFrom": "security", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "security_username_applicationId_unique": { "name": "security_username_applicationId_unique", - "nullsNotDistinct": false, "columns": [ "username", "applicationId" - ] + ], + "nullsNotDistinct": false } } }, - "port": { + "public.port": { "name": "port", "schema": "", "columns": { @@ -1970,21 +1968,21 @@ "port_applicationId_application_applicationId_fk": { "name": "port_applicationId_application_applicationId_fk", "tableFrom": "port", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "redis": { + "public.redis": { "name": "redis", "schema": "", "columns": { @@ -2091,118 +2089,130 @@ "redis_projectId_project_projectId_fk": { "name": "redis_projectId_project_projectId_fk", "tableFrom": "redis", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "redis_appName_unique": { "name": "redis_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } } }, "enums": { - "buildType": { + "public.buildType": { "name": "buildType", - "values": { - "dockerfile": "dockerfile", - "heroku_buildpacks": "heroku_buildpacks", - "paketo_buildpacks": "paketo_buildpacks", - "nixpacks": "nixpacks" - } + "schema": "public", + "values": [ + "dockerfile", + "heroku_buildpacks", + "paketo_buildpacks", + "nixpacks" + ] }, - "sourceType": { + "public.sourceType": { "name": "sourceType", - "values": { - "docker": "docker", - "git": "git", - "github": "github" - } + "schema": "public", + "values": [ + "docker", + "git", + "github" + ] }, - "Roles": { + "public.Roles": { "name": "Roles", - "values": { - "admin": "admin", - "user": "user" - } + "schema": "public", + "values": [ + "admin", + "user" + ] }, - "databaseType": { + "public.databaseType": { "name": "databaseType", - "values": { - "postgres": "postgres", - "mariadb": "mariadb", - "mysql": "mysql", - "mongo": "mongo" - } + "schema": "public", + "values": [ + "postgres", + "mariadb", + "mysql", + "mongo" + ] }, - "deploymentStatus": { + "public.deploymentStatus": { "name": "deploymentStatus", - "values": { - "running": "running", - "done": "done", - "error": "error" - } + "schema": "public", + "values": [ + "running", + "done", + "error" + ] }, - "mountType": { + "public.mountType": { "name": "mountType", - "values": { - "bind": "bind", - "volume": "volume", - "file": "file" - } + "schema": "public", + "values": [ + "bind", + "volume", + "file" + ] }, - "serviceType": { + "public.serviceType": { "name": "serviceType", - "values": { - "application": "application", - "postgres": "postgres", - "mysql": "mysql", - "mariadb": "mariadb", - "mongo": "mongo", - "redis": "redis" - } + "schema": "public", + "values": [ + "application", + "postgres", + "mysql", + "mariadb", + "mongo", + "redis" + ] }, - "protocolType": { + "public.protocolType": { "name": "protocolType", - "values": { - "tcp": "tcp", - "udp": "udp" - } + "schema": "public", + "values": [ + "tcp", + "udp" + ] }, - "applicationStatus": { + "public.applicationStatus": { "name": "applicationStatus", - "values": { - "idle": "idle", - "running": "running", - "done": "done", - "error": "error" - } + "schema": "public", + "values": [ + "idle", + "running", + "done", + "error" + ] }, - "certificateType": { + "public.certificateType": { "name": "certificateType", - "values": { - "letsencrypt": "letsencrypt", - "none": "none" - } + "schema": "public", + "values": [ + "letsencrypt", + "none" + ] } }, "schemas": {}, "_meta": { - "columns": {}, "schemas": {}, - "tables": {} - } + "tables": {}, + "columns": {} + }, + "id": "c6215051-7cd1-412d-b8df-b50d58acacff", + "prevId": "00000000-0000-0000-0000-000000000000" } \ No newline at end of file diff --git a/drizzle/meta/0001_snapshot.json b/drizzle/meta/0001_snapshot.json index e8842a191..17cfe8ef3 100644 --- a/drizzle/meta/0001_snapshot.json +++ b/drizzle/meta/0001_snapshot.json @@ -1,10 +1,8 @@ { - "id": "3a4dfad7-ae33-4ae3-b60e-4f40f44f5652", - "prevId": "c6215051-7cd1-412d-b8df-b50d58acacff", - "version": "5", - "dialect": "pg", + "version": "6", + "dialect": "postgresql", "tables": { - "application": { + "public.application": { "name": "application", "schema": "", "columns": { @@ -234,29 +232,29 @@ "application_projectId_project_projectId_fk": { "name": "application_projectId_project_projectId_fk", "tableFrom": "application", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "application_appName_unique": { "name": "application_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "postgres": { + "public.postgres": { "name": "postgres", "schema": "", "columns": { @@ -375,29 +373,29 @@ "postgres_projectId_project_projectId_fk": { "name": "postgres_projectId_project_projectId_fk", "tableFrom": "postgres", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "postgres_appName_unique": { "name": "postgres_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -499,34 +497,34 @@ "user_adminId_admin_adminId_fk": { "name": "user_adminId_admin_adminId_fk", "tableFrom": "user", - "tableTo": "admin", "columnsFrom": [ "adminId" ], + "tableTo": "admin", "columnsTo": [ "adminId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "user_authId_auth_id_fk": { "name": "user_authId_auth_id_fk", "tableFrom": "user", - "tableTo": "auth", "columnsFrom": [ "authId" ], + "tableTo": "auth", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "admin": { + "public.admin": { "name": "admin", "schema": "", "columns": { @@ -628,21 +626,21 @@ "admin_authId_auth_id_fk": { "name": "admin_authId_auth_id_fk", "tableFrom": "admin", - "tableTo": "auth", "columnsFrom": [ "authId" ], + "tableTo": "auth", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "auth": { + "public.auth": { "name": "auth", "schema": "", "columns": { @@ -695,14 +693,14 @@ "uniqueConstraints": { "auth_email_unique": { "name": "auth_email_unique", - "nullsNotDistinct": false, "columns": [ "email" - ] + ], + "nullsNotDistinct": false } } }, - "project": { + "public.project": { "name": "project", "schema": "", "columns": { @@ -742,21 +740,21 @@ "project_adminId_admin_adminId_fk": { "name": "project_adminId_admin_adminId_fk", "tableFrom": "project", - "tableTo": "admin", "columnsFrom": [ "adminId" ], + "tableTo": "admin", "columnsTo": [ "adminId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "domain": { + "public.domain": { "name": "domain", "schema": "", "columns": { @@ -824,21 +822,21 @@ "domain_applicationId_application_applicationId_fk": { "name": "domain_applicationId_application_applicationId_fk", "tableFrom": "domain", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "mariadb": { + "public.mariadb": { "name": "mariadb", "schema": "", "columns": { @@ -963,29 +961,29 @@ "mariadb_projectId_project_projectId_fk": { "name": "mariadb_projectId_project_projectId_fk", "tableFrom": "mariadb", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "mariadb_appName_unique": { "name": "mariadb_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "mongo": { + "public.mongo": { "name": "mongo", "schema": "", "columns": { @@ -1098,29 +1096,29 @@ "mongo_projectId_project_projectId_fk": { "name": "mongo_projectId_project_projectId_fk", "tableFrom": "mongo", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "mongo_appName_unique": { "name": "mongo_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "mysql": { + "public.mysql": { "name": "mysql", "schema": "", "columns": { @@ -1245,29 +1243,29 @@ "mysql_projectId_project_projectId_fk": { "name": "mysql_projectId_project_projectId_fk", "tableFrom": "mysql", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "mysql_appName_unique": { "name": "mysql_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "backup": { + "public.backup": { "name": "backup", "schema": "", "columns": { @@ -1343,73 +1341,73 @@ "backup_destinationId_destination_destinationId_fk": { "name": "backup_destinationId_destination_destinationId_fk", "tableFrom": "backup", - "tableTo": "destination", "columnsFrom": [ "destinationId" ], + "tableTo": "destination", "columnsTo": [ "destinationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_postgresId_postgres_postgresId_fk": { "name": "backup_postgresId_postgres_postgresId_fk", "tableFrom": "backup", - "tableTo": "postgres", "columnsFrom": [ "postgresId" ], + "tableTo": "postgres", "columnsTo": [ "postgresId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_mariadbId_mariadb_mariadbId_fk": { "name": "backup_mariadbId_mariadb_mariadbId_fk", "tableFrom": "backup", - "tableTo": "mariadb", "columnsFrom": [ "mariadbId" ], + "tableTo": "mariadb", "columnsTo": [ "mariadbId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_mysqlId_mysql_mysqlId_fk": { "name": "backup_mysqlId_mysql_mysqlId_fk", "tableFrom": "backup", - "tableTo": "mysql", "columnsFrom": [ "mysqlId" ], + "tableTo": "mysql", "columnsTo": [ "mysqlId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_mongoId_mongo_mongoId_fk": { "name": "backup_mongoId_mongo_mongoId_fk", "tableFrom": "backup", - "tableTo": "mongo", "columnsFrom": [ "mongoId" ], + "tableTo": "mongo", "columnsTo": [ "mongoId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "destination": { + "public.destination": { "name": "destination", "schema": "", "columns": { @@ -1467,21 +1465,21 @@ "destination_adminId_admin_adminId_fk": { "name": "destination_adminId_admin_adminId_fk", "tableFrom": "destination", - "tableTo": "admin", "columnsFrom": [ "adminId" ], + "tableTo": "admin", "columnsTo": [ "adminId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "deployment": { + "public.deployment": { "name": "deployment", "schema": "", "columns": { @@ -1528,21 +1526,21 @@ "deployment_applicationId_application_applicationId_fk": { "name": "deployment_applicationId_application_applicationId_fk", "tableFrom": "deployment", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "mount": { + "public.mount": { "name": "mount", "schema": "", "columns": { @@ -1631,86 +1629,86 @@ "mount_applicationId_application_applicationId_fk": { "name": "mount_applicationId_application_applicationId_fk", "tableFrom": "mount", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_postgresId_postgres_postgresId_fk": { "name": "mount_postgresId_postgres_postgresId_fk", "tableFrom": "mount", - "tableTo": "postgres", "columnsFrom": [ "postgresId" ], + "tableTo": "postgres", "columnsTo": [ "postgresId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_mariadbId_mariadb_mariadbId_fk": { "name": "mount_mariadbId_mariadb_mariadbId_fk", "tableFrom": "mount", - "tableTo": "mariadb", "columnsFrom": [ "mariadbId" ], + "tableTo": "mariadb", "columnsTo": [ "mariadbId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_mongoId_mongo_mongoId_fk": { "name": "mount_mongoId_mongo_mongoId_fk", "tableFrom": "mount", - "tableTo": "mongo", "columnsFrom": [ "mongoId" ], + "tableTo": "mongo", "columnsTo": [ "mongoId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_mysqlId_mysql_mysqlId_fk": { "name": "mount_mysqlId_mysql_mysqlId_fk", "tableFrom": "mount", - "tableTo": "mysql", "columnsFrom": [ "mysqlId" ], + "tableTo": "mysql", "columnsTo": [ "mysqlId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_redisId_redis_redisId_fk": { "name": "mount_redisId_redis_redisId_fk", "tableFrom": "mount", - "tableTo": "redis", "columnsFrom": [ "redisId" ], + "tableTo": "redis", "columnsTo": [ "redisId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "certificate": { + "public.certificate": { "name": "certificate", "schema": "", "columns": { @@ -1757,14 +1755,14 @@ "uniqueConstraints": { "certificate_certificatePath_unique": { "name": "certificate_certificatePath_unique", - "nullsNotDistinct": false, "columns": [ "certificatePath" - ] + ], + "nullsNotDistinct": false } } }, - "session": { + "public.session": { "name": "session", "schema": "", "columns": { @@ -1792,21 +1790,21 @@ "session_user_id_auth_id_fk": { "name": "session_user_id_auth_id_fk", "tableFrom": "session", - "tableTo": "auth", "columnsFrom": [ "user_id" ], + "tableTo": "auth", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "redirect": { + "public.redirect": { "name": "redirect", "schema": "", "columns": { @@ -1859,21 +1857,21 @@ "redirect_applicationId_application_applicationId_fk": { "name": "redirect_applicationId_application_applicationId_fk", "tableFrom": "redirect", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "security": { + "public.security": { "name": "security", "schema": "", "columns": { @@ -1913,30 +1911,30 @@ "security_applicationId_application_applicationId_fk": { "name": "security_applicationId_application_applicationId_fk", "tableFrom": "security", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "security_username_applicationId_unique": { "name": "security_username_applicationId_unique", - "nullsNotDistinct": false, "columns": [ "username", "applicationId" - ] + ], + "nullsNotDistinct": false } } }, - "port": { + "public.port": { "name": "port", "schema": "", "columns": { @@ -1976,21 +1974,21 @@ "port_applicationId_application_applicationId_fk": { "name": "port_applicationId_application_applicationId_fk", "tableFrom": "port", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "redis": { + "public.redis": { "name": "redis", "schema": "", "columns": { @@ -2097,118 +2095,130 @@ "redis_projectId_project_projectId_fk": { "name": "redis_projectId_project_projectId_fk", "tableFrom": "redis", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "redis_appName_unique": { "name": "redis_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } } }, "enums": { - "buildType": { + "public.buildType": { "name": "buildType", - "values": { - "dockerfile": "dockerfile", - "heroku_buildpacks": "heroku_buildpacks", - "paketo_buildpacks": "paketo_buildpacks", - "nixpacks": "nixpacks" - } + "schema": "public", + "values": [ + "dockerfile", + "heroku_buildpacks", + "paketo_buildpacks", + "nixpacks" + ] }, - "sourceType": { + "public.sourceType": { "name": "sourceType", - "values": { - "docker": "docker", - "git": "git", - "github": "github" - } + "schema": "public", + "values": [ + "docker", + "git", + "github" + ] }, - "Roles": { + "public.Roles": { "name": "Roles", - "values": { - "admin": "admin", - "user": "user" - } + "schema": "public", + "values": [ + "admin", + "user" + ] }, - "databaseType": { + "public.databaseType": { "name": "databaseType", - "values": { - "postgres": "postgres", - "mariadb": "mariadb", - "mysql": "mysql", - "mongo": "mongo" - } + "schema": "public", + "values": [ + "postgres", + "mariadb", + "mysql", + "mongo" + ] }, - "deploymentStatus": { + "public.deploymentStatus": { "name": "deploymentStatus", - "values": { - "running": "running", - "done": "done", - "error": "error" - } + "schema": "public", + "values": [ + "running", + "done", + "error" + ] }, - "mountType": { + "public.mountType": { "name": "mountType", - "values": { - "bind": "bind", - "volume": "volume", - "file": "file" - } + "schema": "public", + "values": [ + "bind", + "volume", + "file" + ] }, - "serviceType": { + "public.serviceType": { "name": "serviceType", - "values": { - "application": "application", - "postgres": "postgres", - "mysql": "mysql", - "mariadb": "mariadb", - "mongo": "mongo", - "redis": "redis" - } + "schema": "public", + "values": [ + "application", + "postgres", + "mysql", + "mariadb", + "mongo", + "redis" + ] }, - "protocolType": { + "public.protocolType": { "name": "protocolType", - "values": { - "tcp": "tcp", - "udp": "udp" - } + "schema": "public", + "values": [ + "tcp", + "udp" + ] }, - "applicationStatus": { + "public.applicationStatus": { "name": "applicationStatus", - "values": { - "idle": "idle", - "running": "running", - "done": "done", - "error": "error" - } + "schema": "public", + "values": [ + "idle", + "running", + "done", + "error" + ] }, - "certificateType": { + "public.certificateType": { "name": "certificateType", - "values": { - "letsencrypt": "letsencrypt", - "none": "none" - } + "schema": "public", + "values": [ + "letsencrypt", + "none" + ] } }, "schemas": {}, "_meta": { - "columns": {}, "schemas": {}, - "tables": {} - } + "tables": {}, + "columns": {} + }, + "id": "3a4dfad7-ae33-4ae3-b60e-4f40f44f5652", + "prevId": "c6215051-7cd1-412d-b8df-b50d58acacff" } \ No newline at end of file diff --git a/drizzle/meta/0002_snapshot.json b/drizzle/meta/0002_snapshot.json index fb4f267d0..0f2f9870c 100644 --- a/drizzle/meta/0002_snapshot.json +++ b/drizzle/meta/0002_snapshot.json @@ -1,10 +1,8 @@ { - "id": "665483bd-5123-4c2b-beef-bfa9b91b9356", - "prevId": "3a4dfad7-ae33-4ae3-b60e-4f40f44f5652", - "version": "5", - "dialect": "pg", + "version": "6", + "dialect": "postgresql", "tables": { - "application": { + "public.application": { "name": "application", "schema": "", "columns": { @@ -234,29 +232,29 @@ "application_projectId_project_projectId_fk": { "name": "application_projectId_project_projectId_fk", "tableFrom": "application", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "application_appName_unique": { "name": "application_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "postgres": { + "public.postgres": { "name": "postgres", "schema": "", "columns": { @@ -375,29 +373,29 @@ "postgres_projectId_project_projectId_fk": { "name": "postgres_projectId_project_projectId_fk", "tableFrom": "postgres", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "postgres_appName_unique": { "name": "postgres_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -499,34 +497,34 @@ "user_adminId_admin_adminId_fk": { "name": "user_adminId_admin_adminId_fk", "tableFrom": "user", - "tableTo": "admin", "columnsFrom": [ "adminId" ], + "tableTo": "admin", "columnsTo": [ "adminId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "user_authId_auth_id_fk": { "name": "user_authId_auth_id_fk", "tableFrom": "user", - "tableTo": "auth", "columnsFrom": [ "authId" ], + "tableTo": "auth", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "admin": { + "public.admin": { "name": "admin", "schema": "", "columns": { @@ -628,21 +626,21 @@ "admin_authId_auth_id_fk": { "name": "admin_authId_auth_id_fk", "tableFrom": "admin", - "tableTo": "auth", "columnsFrom": [ "authId" ], + "tableTo": "auth", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "auth": { + "public.auth": { "name": "auth", "schema": "", "columns": { @@ -702,14 +700,14 @@ "uniqueConstraints": { "auth_email_unique": { "name": "auth_email_unique", - "nullsNotDistinct": false, "columns": [ "email" - ] + ], + "nullsNotDistinct": false } } }, - "project": { + "public.project": { "name": "project", "schema": "", "columns": { @@ -749,21 +747,21 @@ "project_adminId_admin_adminId_fk": { "name": "project_adminId_admin_adminId_fk", "tableFrom": "project", - "tableTo": "admin", "columnsFrom": [ "adminId" ], + "tableTo": "admin", "columnsTo": [ "adminId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "domain": { + "public.domain": { "name": "domain", "schema": "", "columns": { @@ -831,21 +829,21 @@ "domain_applicationId_application_applicationId_fk": { "name": "domain_applicationId_application_applicationId_fk", "tableFrom": "domain", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "mariadb": { + "public.mariadb": { "name": "mariadb", "schema": "", "columns": { @@ -970,29 +968,29 @@ "mariadb_projectId_project_projectId_fk": { "name": "mariadb_projectId_project_projectId_fk", "tableFrom": "mariadb", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "mariadb_appName_unique": { "name": "mariadb_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "mongo": { + "public.mongo": { "name": "mongo", "schema": "", "columns": { @@ -1105,29 +1103,29 @@ "mongo_projectId_project_projectId_fk": { "name": "mongo_projectId_project_projectId_fk", "tableFrom": "mongo", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "mongo_appName_unique": { "name": "mongo_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "mysql": { + "public.mysql": { "name": "mysql", "schema": "", "columns": { @@ -1252,29 +1250,29 @@ "mysql_projectId_project_projectId_fk": { "name": "mysql_projectId_project_projectId_fk", "tableFrom": "mysql", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "mysql_appName_unique": { "name": "mysql_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "backup": { + "public.backup": { "name": "backup", "schema": "", "columns": { @@ -1350,73 +1348,73 @@ "backup_destinationId_destination_destinationId_fk": { "name": "backup_destinationId_destination_destinationId_fk", "tableFrom": "backup", - "tableTo": "destination", "columnsFrom": [ "destinationId" ], + "tableTo": "destination", "columnsTo": [ "destinationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_postgresId_postgres_postgresId_fk": { "name": "backup_postgresId_postgres_postgresId_fk", "tableFrom": "backup", - "tableTo": "postgres", "columnsFrom": [ "postgresId" ], + "tableTo": "postgres", "columnsTo": [ "postgresId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_mariadbId_mariadb_mariadbId_fk": { "name": "backup_mariadbId_mariadb_mariadbId_fk", "tableFrom": "backup", - "tableTo": "mariadb", "columnsFrom": [ "mariadbId" ], + "tableTo": "mariadb", "columnsTo": [ "mariadbId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_mysqlId_mysql_mysqlId_fk": { "name": "backup_mysqlId_mysql_mysqlId_fk", "tableFrom": "backup", - "tableTo": "mysql", "columnsFrom": [ "mysqlId" ], + "tableTo": "mysql", "columnsTo": [ "mysqlId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_mongoId_mongo_mongoId_fk": { "name": "backup_mongoId_mongo_mongoId_fk", "tableFrom": "backup", - "tableTo": "mongo", "columnsFrom": [ "mongoId" ], + "tableTo": "mongo", "columnsTo": [ "mongoId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "destination": { + "public.destination": { "name": "destination", "schema": "", "columns": { @@ -1474,21 +1472,21 @@ "destination_adminId_admin_adminId_fk": { "name": "destination_adminId_admin_adminId_fk", "tableFrom": "destination", - "tableTo": "admin", "columnsFrom": [ "adminId" ], + "tableTo": "admin", "columnsTo": [ "adminId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "deployment": { + "public.deployment": { "name": "deployment", "schema": "", "columns": { @@ -1535,21 +1533,21 @@ "deployment_applicationId_application_applicationId_fk": { "name": "deployment_applicationId_application_applicationId_fk", "tableFrom": "deployment", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "mount": { + "public.mount": { "name": "mount", "schema": "", "columns": { @@ -1638,86 +1636,86 @@ "mount_applicationId_application_applicationId_fk": { "name": "mount_applicationId_application_applicationId_fk", "tableFrom": "mount", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_postgresId_postgres_postgresId_fk": { "name": "mount_postgresId_postgres_postgresId_fk", "tableFrom": "mount", - "tableTo": "postgres", "columnsFrom": [ "postgresId" ], + "tableTo": "postgres", "columnsTo": [ "postgresId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_mariadbId_mariadb_mariadbId_fk": { "name": "mount_mariadbId_mariadb_mariadbId_fk", "tableFrom": "mount", - "tableTo": "mariadb", "columnsFrom": [ "mariadbId" ], + "tableTo": "mariadb", "columnsTo": [ "mariadbId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_mongoId_mongo_mongoId_fk": { "name": "mount_mongoId_mongo_mongoId_fk", "tableFrom": "mount", - "tableTo": "mongo", "columnsFrom": [ "mongoId" ], + "tableTo": "mongo", "columnsTo": [ "mongoId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_mysqlId_mysql_mysqlId_fk": { "name": "mount_mysqlId_mysql_mysqlId_fk", "tableFrom": "mount", - "tableTo": "mysql", "columnsFrom": [ "mysqlId" ], + "tableTo": "mysql", "columnsTo": [ "mysqlId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_redisId_redis_redisId_fk": { "name": "mount_redisId_redis_redisId_fk", "tableFrom": "mount", - "tableTo": "redis", "columnsFrom": [ "redisId" ], + "tableTo": "redis", "columnsTo": [ "redisId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "certificate": { + "public.certificate": { "name": "certificate", "schema": "", "columns": { @@ -1764,14 +1762,14 @@ "uniqueConstraints": { "certificate_certificatePath_unique": { "name": "certificate_certificatePath_unique", - "nullsNotDistinct": false, "columns": [ "certificatePath" - ] + ], + "nullsNotDistinct": false } } }, - "session": { + "public.session": { "name": "session", "schema": "", "columns": { @@ -1799,21 +1797,21 @@ "session_user_id_auth_id_fk": { "name": "session_user_id_auth_id_fk", "tableFrom": "session", - "tableTo": "auth", "columnsFrom": [ "user_id" ], + "tableTo": "auth", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "redirect": { + "public.redirect": { "name": "redirect", "schema": "", "columns": { @@ -1866,21 +1864,21 @@ "redirect_applicationId_application_applicationId_fk": { "name": "redirect_applicationId_application_applicationId_fk", "tableFrom": "redirect", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "security": { + "public.security": { "name": "security", "schema": "", "columns": { @@ -1920,30 +1918,30 @@ "security_applicationId_application_applicationId_fk": { "name": "security_applicationId_application_applicationId_fk", "tableFrom": "security", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "security_username_applicationId_unique": { "name": "security_username_applicationId_unique", - "nullsNotDistinct": false, "columns": [ "username", "applicationId" - ] + ], + "nullsNotDistinct": false } } }, - "port": { + "public.port": { "name": "port", "schema": "", "columns": { @@ -1983,21 +1981,21 @@ "port_applicationId_application_applicationId_fk": { "name": "port_applicationId_application_applicationId_fk", "tableFrom": "port", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "redis": { + "public.redis": { "name": "redis", "schema": "", "columns": { @@ -2104,118 +2102,130 @@ "redis_projectId_project_projectId_fk": { "name": "redis_projectId_project_projectId_fk", "tableFrom": "redis", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "redis_appName_unique": { "name": "redis_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } } }, "enums": { - "buildType": { + "public.buildType": { "name": "buildType", - "values": { - "dockerfile": "dockerfile", - "heroku_buildpacks": "heroku_buildpacks", - "paketo_buildpacks": "paketo_buildpacks", - "nixpacks": "nixpacks" - } + "schema": "public", + "values": [ + "dockerfile", + "heroku_buildpacks", + "paketo_buildpacks", + "nixpacks" + ] }, - "sourceType": { + "public.sourceType": { "name": "sourceType", - "values": { - "docker": "docker", - "git": "git", - "github": "github" - } + "schema": "public", + "values": [ + "docker", + "git", + "github" + ] }, - "Roles": { + "public.Roles": { "name": "Roles", - "values": { - "admin": "admin", - "user": "user" - } + "schema": "public", + "values": [ + "admin", + "user" + ] }, - "databaseType": { + "public.databaseType": { "name": "databaseType", - "values": { - "postgres": "postgres", - "mariadb": "mariadb", - "mysql": "mysql", - "mongo": "mongo" - } + "schema": "public", + "values": [ + "postgres", + "mariadb", + "mysql", + "mongo" + ] }, - "deploymentStatus": { + "public.deploymentStatus": { "name": "deploymentStatus", - "values": { - "running": "running", - "done": "done", - "error": "error" - } + "schema": "public", + "values": [ + "running", + "done", + "error" + ] }, - "mountType": { + "public.mountType": { "name": "mountType", - "values": { - "bind": "bind", - "volume": "volume", - "file": "file" - } + "schema": "public", + "values": [ + "bind", + "volume", + "file" + ] }, - "serviceType": { + "public.serviceType": { "name": "serviceType", - "values": { - "application": "application", - "postgres": "postgres", - "mysql": "mysql", - "mariadb": "mariadb", - "mongo": "mongo", - "redis": "redis" - } + "schema": "public", + "values": [ + "application", + "postgres", + "mysql", + "mariadb", + "mongo", + "redis" + ] }, - "protocolType": { + "public.protocolType": { "name": "protocolType", - "values": { - "tcp": "tcp", - "udp": "udp" - } + "schema": "public", + "values": [ + "tcp", + "udp" + ] }, - "applicationStatus": { + "public.applicationStatus": { "name": "applicationStatus", - "values": { - "idle": "idle", - "running": "running", - "done": "done", - "error": "error" - } + "schema": "public", + "values": [ + "idle", + "running", + "done", + "error" + ] }, - "certificateType": { + "public.certificateType": { "name": "certificateType", - "values": { - "letsencrypt": "letsencrypt", - "none": "none" - } + "schema": "public", + "values": [ + "letsencrypt", + "none" + ] } }, "schemas": {}, "_meta": { - "columns": {}, "schemas": {}, - "tables": {} - } + "tables": {}, + "columns": {} + }, + "id": "665483bd-5123-4c2b-beef-bfa9b91b9356", + "prevId": "3a4dfad7-ae33-4ae3-b60e-4f40f44f5652" } \ No newline at end of file diff --git a/drizzle/meta/0003_snapshot.json b/drizzle/meta/0003_snapshot.json index cc29060f3..de0fd49c6 100644 --- a/drizzle/meta/0003_snapshot.json +++ b/drizzle/meta/0003_snapshot.json @@ -1,10 +1,8 @@ { - "id": "5a1d3f2b-9c31-4125-9645-015170550b51", - "prevId": "665483bd-5123-4c2b-beef-bfa9b91b9356", - "version": "5", - "dialect": "pg", + "version": "6", + "dialect": "postgresql", "tables": { - "application": { + "public.application": { "name": "application", "schema": "", "columns": { @@ -234,29 +232,29 @@ "application_projectId_project_projectId_fk": { "name": "application_projectId_project_projectId_fk", "tableFrom": "application", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "application_appName_unique": { "name": "application_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "postgres": { + "public.postgres": { "name": "postgres", "schema": "", "columns": { @@ -375,29 +373,29 @@ "postgres_projectId_project_projectId_fk": { "name": "postgres_projectId_project_projectId_fk", "tableFrom": "postgres", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "postgres_appName_unique": { "name": "postgres_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -506,34 +504,34 @@ "user_adminId_admin_adminId_fk": { "name": "user_adminId_admin_adminId_fk", "tableFrom": "user", - "tableTo": "admin", "columnsFrom": [ "adminId" ], + "tableTo": "admin", "columnsTo": [ "adminId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "user_authId_auth_id_fk": { "name": "user_authId_auth_id_fk", "tableFrom": "user", - "tableTo": "auth", "columnsFrom": [ "authId" ], + "tableTo": "auth", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "admin": { + "public.admin": { "name": "admin", "schema": "", "columns": { @@ -635,21 +633,21 @@ "admin_authId_auth_id_fk": { "name": "admin_authId_auth_id_fk", "tableFrom": "admin", - "tableTo": "auth", "columnsFrom": [ "authId" ], + "tableTo": "auth", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "auth": { + "public.auth": { "name": "auth", "schema": "", "columns": { @@ -709,14 +707,14 @@ "uniqueConstraints": { "auth_email_unique": { "name": "auth_email_unique", - "nullsNotDistinct": false, "columns": [ "email" - ] + ], + "nullsNotDistinct": false } } }, - "project": { + "public.project": { "name": "project", "schema": "", "columns": { @@ -756,21 +754,21 @@ "project_adminId_admin_adminId_fk": { "name": "project_adminId_admin_adminId_fk", "tableFrom": "project", - "tableTo": "admin", "columnsFrom": [ "adminId" ], + "tableTo": "admin", "columnsTo": [ "adminId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "domain": { + "public.domain": { "name": "domain", "schema": "", "columns": { @@ -838,21 +836,21 @@ "domain_applicationId_application_applicationId_fk": { "name": "domain_applicationId_application_applicationId_fk", "tableFrom": "domain", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "mariadb": { + "public.mariadb": { "name": "mariadb", "schema": "", "columns": { @@ -977,29 +975,29 @@ "mariadb_projectId_project_projectId_fk": { "name": "mariadb_projectId_project_projectId_fk", "tableFrom": "mariadb", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "mariadb_appName_unique": { "name": "mariadb_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "mongo": { + "public.mongo": { "name": "mongo", "schema": "", "columns": { @@ -1112,29 +1110,29 @@ "mongo_projectId_project_projectId_fk": { "name": "mongo_projectId_project_projectId_fk", "tableFrom": "mongo", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "mongo_appName_unique": { "name": "mongo_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "mysql": { + "public.mysql": { "name": "mysql", "schema": "", "columns": { @@ -1259,29 +1257,29 @@ "mysql_projectId_project_projectId_fk": { "name": "mysql_projectId_project_projectId_fk", "tableFrom": "mysql", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "mysql_appName_unique": { "name": "mysql_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "backup": { + "public.backup": { "name": "backup", "schema": "", "columns": { @@ -1357,73 +1355,73 @@ "backup_destinationId_destination_destinationId_fk": { "name": "backup_destinationId_destination_destinationId_fk", "tableFrom": "backup", - "tableTo": "destination", "columnsFrom": [ "destinationId" ], + "tableTo": "destination", "columnsTo": [ "destinationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_postgresId_postgres_postgresId_fk": { "name": "backup_postgresId_postgres_postgresId_fk", "tableFrom": "backup", - "tableTo": "postgres", "columnsFrom": [ "postgresId" ], + "tableTo": "postgres", "columnsTo": [ "postgresId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_mariadbId_mariadb_mariadbId_fk": { "name": "backup_mariadbId_mariadb_mariadbId_fk", "tableFrom": "backup", - "tableTo": "mariadb", "columnsFrom": [ "mariadbId" ], + "tableTo": "mariadb", "columnsTo": [ "mariadbId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_mysqlId_mysql_mysqlId_fk": { "name": "backup_mysqlId_mysql_mysqlId_fk", "tableFrom": "backup", - "tableTo": "mysql", "columnsFrom": [ "mysqlId" ], + "tableTo": "mysql", "columnsTo": [ "mysqlId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_mongoId_mongo_mongoId_fk": { "name": "backup_mongoId_mongo_mongoId_fk", "tableFrom": "backup", - "tableTo": "mongo", "columnsFrom": [ "mongoId" ], + "tableTo": "mongo", "columnsTo": [ "mongoId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "destination": { + "public.destination": { "name": "destination", "schema": "", "columns": { @@ -1481,21 +1479,21 @@ "destination_adminId_admin_adminId_fk": { "name": "destination_adminId_admin_adminId_fk", "tableFrom": "destination", - "tableTo": "admin", "columnsFrom": [ "adminId" ], + "tableTo": "admin", "columnsTo": [ "adminId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "deployment": { + "public.deployment": { "name": "deployment", "schema": "", "columns": { @@ -1542,21 +1540,21 @@ "deployment_applicationId_application_applicationId_fk": { "name": "deployment_applicationId_application_applicationId_fk", "tableFrom": "deployment", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "mount": { + "public.mount": { "name": "mount", "schema": "", "columns": { @@ -1645,86 +1643,86 @@ "mount_applicationId_application_applicationId_fk": { "name": "mount_applicationId_application_applicationId_fk", "tableFrom": "mount", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_postgresId_postgres_postgresId_fk": { "name": "mount_postgresId_postgres_postgresId_fk", "tableFrom": "mount", - "tableTo": "postgres", "columnsFrom": [ "postgresId" ], + "tableTo": "postgres", "columnsTo": [ "postgresId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_mariadbId_mariadb_mariadbId_fk": { "name": "mount_mariadbId_mariadb_mariadbId_fk", "tableFrom": "mount", - "tableTo": "mariadb", "columnsFrom": [ "mariadbId" ], + "tableTo": "mariadb", "columnsTo": [ "mariadbId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_mongoId_mongo_mongoId_fk": { "name": "mount_mongoId_mongo_mongoId_fk", "tableFrom": "mount", - "tableTo": "mongo", "columnsFrom": [ "mongoId" ], + "tableTo": "mongo", "columnsTo": [ "mongoId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_mysqlId_mysql_mysqlId_fk": { "name": "mount_mysqlId_mysql_mysqlId_fk", "tableFrom": "mount", - "tableTo": "mysql", "columnsFrom": [ "mysqlId" ], + "tableTo": "mysql", "columnsTo": [ "mysqlId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_redisId_redis_redisId_fk": { "name": "mount_redisId_redis_redisId_fk", "tableFrom": "mount", - "tableTo": "redis", "columnsFrom": [ "redisId" ], + "tableTo": "redis", "columnsTo": [ "redisId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "certificate": { + "public.certificate": { "name": "certificate", "schema": "", "columns": { @@ -1771,14 +1769,14 @@ "uniqueConstraints": { "certificate_certificatePath_unique": { "name": "certificate_certificatePath_unique", - "nullsNotDistinct": false, "columns": [ "certificatePath" - ] + ], + "nullsNotDistinct": false } } }, - "session": { + "public.session": { "name": "session", "schema": "", "columns": { @@ -1806,21 +1804,21 @@ "session_user_id_auth_id_fk": { "name": "session_user_id_auth_id_fk", "tableFrom": "session", - "tableTo": "auth", "columnsFrom": [ "user_id" ], + "tableTo": "auth", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "redirect": { + "public.redirect": { "name": "redirect", "schema": "", "columns": { @@ -1873,21 +1871,21 @@ "redirect_applicationId_application_applicationId_fk": { "name": "redirect_applicationId_application_applicationId_fk", "tableFrom": "redirect", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "security": { + "public.security": { "name": "security", "schema": "", "columns": { @@ -1927,30 +1925,30 @@ "security_applicationId_application_applicationId_fk": { "name": "security_applicationId_application_applicationId_fk", "tableFrom": "security", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "security_username_applicationId_unique": { "name": "security_username_applicationId_unique", - "nullsNotDistinct": false, "columns": [ "username", "applicationId" - ] + ], + "nullsNotDistinct": false } } }, - "port": { + "public.port": { "name": "port", "schema": "", "columns": { @@ -1990,21 +1988,21 @@ "port_applicationId_application_applicationId_fk": { "name": "port_applicationId_application_applicationId_fk", "tableFrom": "port", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "redis": { + "public.redis": { "name": "redis", "schema": "", "columns": { @@ -2111,118 +2109,130 @@ "redis_projectId_project_projectId_fk": { "name": "redis_projectId_project_projectId_fk", "tableFrom": "redis", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "redis_appName_unique": { "name": "redis_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } } }, "enums": { - "buildType": { + "public.buildType": { "name": "buildType", - "values": { - "dockerfile": "dockerfile", - "heroku_buildpacks": "heroku_buildpacks", - "paketo_buildpacks": "paketo_buildpacks", - "nixpacks": "nixpacks" - } + "schema": "public", + "values": [ + "dockerfile", + "heroku_buildpacks", + "paketo_buildpacks", + "nixpacks" + ] }, - "sourceType": { + "public.sourceType": { "name": "sourceType", - "values": { - "docker": "docker", - "git": "git", - "github": "github" - } + "schema": "public", + "values": [ + "docker", + "git", + "github" + ] }, - "Roles": { + "public.Roles": { "name": "Roles", - "values": { - "admin": "admin", - "user": "user" - } + "schema": "public", + "values": [ + "admin", + "user" + ] }, - "databaseType": { + "public.databaseType": { "name": "databaseType", - "values": { - "postgres": "postgres", - "mariadb": "mariadb", - "mysql": "mysql", - "mongo": "mongo" - } + "schema": "public", + "values": [ + "postgres", + "mariadb", + "mysql", + "mongo" + ] }, - "deploymentStatus": { + "public.deploymentStatus": { "name": "deploymentStatus", - "values": { - "running": "running", - "done": "done", - "error": "error" - } + "schema": "public", + "values": [ + "running", + "done", + "error" + ] }, - "mountType": { + "public.mountType": { "name": "mountType", - "values": { - "bind": "bind", - "volume": "volume", - "file": "file" - } + "schema": "public", + "values": [ + "bind", + "volume", + "file" + ] }, - "serviceType": { + "public.serviceType": { "name": "serviceType", - "values": { - "application": "application", - "postgres": "postgres", - "mysql": "mysql", - "mariadb": "mariadb", - "mongo": "mongo", - "redis": "redis" - } + "schema": "public", + "values": [ + "application", + "postgres", + "mysql", + "mariadb", + "mongo", + "redis" + ] }, - "protocolType": { + "public.protocolType": { "name": "protocolType", - "values": { - "tcp": "tcp", - "udp": "udp" - } + "schema": "public", + "values": [ + "tcp", + "udp" + ] }, - "applicationStatus": { + "public.applicationStatus": { "name": "applicationStatus", - "values": { - "idle": "idle", - "running": "running", - "done": "done", - "error": "error" - } + "schema": "public", + "values": [ + "idle", + "running", + "done", + "error" + ] }, - "certificateType": { + "public.certificateType": { "name": "certificateType", - "values": { - "letsencrypt": "letsencrypt", - "none": "none" - } + "schema": "public", + "values": [ + "letsencrypt", + "none" + ] } }, "schemas": {}, "_meta": { - "columns": {}, "schemas": {}, - "tables": {} - } + "tables": {}, + "columns": {} + }, + "id": "5a1d3f2b-9c31-4125-9645-015170550b51", + "prevId": "665483bd-5123-4c2b-beef-bfa9b91b9356" } \ No newline at end of file diff --git a/drizzle/meta/0004_snapshot.json b/drizzle/meta/0004_snapshot.json index 150db8266..0e0cf4572 100644 --- a/drizzle/meta/0004_snapshot.json +++ b/drizzle/meta/0004_snapshot.json @@ -1,10 +1,8 @@ { - "id": "7bb4bbcf-791c-4888-919e-f74bc0528b5f", - "prevId": "5a1d3f2b-9c31-4125-9645-015170550b51", - "version": "5", - "dialect": "pg", + "version": "6", + "dialect": "postgresql", "tables": { - "application": { + "public.application": { "name": "application", "schema": "", "columns": { @@ -210,29 +208,29 @@ "application_projectId_project_projectId_fk": { "name": "application_projectId_project_projectId_fk", "tableFrom": "application", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "application_appName_unique": { "name": "application_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "postgres": { + "public.postgres": { "name": "postgres", "schema": "", "columns": { @@ -351,29 +349,29 @@ "postgres_projectId_project_projectId_fk": { "name": "postgres_projectId_project_projectId_fk", "tableFrom": "postgres", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "postgres_appName_unique": { "name": "postgres_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -482,34 +480,34 @@ "user_adminId_admin_adminId_fk": { "name": "user_adminId_admin_adminId_fk", "tableFrom": "user", - "tableTo": "admin", "columnsFrom": [ "adminId" ], + "tableTo": "admin", "columnsTo": [ "adminId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "user_authId_auth_id_fk": { "name": "user_authId_auth_id_fk", "tableFrom": "user", - "tableTo": "auth", "columnsFrom": [ "authId" ], + "tableTo": "auth", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "admin": { + "public.admin": { "name": "admin", "schema": "", "columns": { @@ -611,21 +609,21 @@ "admin_authId_auth_id_fk": { "name": "admin_authId_auth_id_fk", "tableFrom": "admin", - "tableTo": "auth", "columnsFrom": [ "authId" ], + "tableTo": "auth", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "auth": { + "public.auth": { "name": "auth", "schema": "", "columns": { @@ -685,14 +683,14 @@ "uniqueConstraints": { "auth_email_unique": { "name": "auth_email_unique", - "nullsNotDistinct": false, "columns": [ "email" - ] + ], + "nullsNotDistinct": false } } }, - "project": { + "public.project": { "name": "project", "schema": "", "columns": { @@ -732,21 +730,21 @@ "project_adminId_admin_adminId_fk": { "name": "project_adminId_admin_adminId_fk", "tableFrom": "project", - "tableTo": "admin", "columnsFrom": [ "adminId" ], + "tableTo": "admin", "columnsTo": [ "adminId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "domain": { + "public.domain": { "name": "domain", "schema": "", "columns": { @@ -814,21 +812,21 @@ "domain_applicationId_application_applicationId_fk": { "name": "domain_applicationId_application_applicationId_fk", "tableFrom": "domain", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "mariadb": { + "public.mariadb": { "name": "mariadb", "schema": "", "columns": { @@ -953,29 +951,29 @@ "mariadb_projectId_project_projectId_fk": { "name": "mariadb_projectId_project_projectId_fk", "tableFrom": "mariadb", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "mariadb_appName_unique": { "name": "mariadb_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "mongo": { + "public.mongo": { "name": "mongo", "schema": "", "columns": { @@ -1088,29 +1086,29 @@ "mongo_projectId_project_projectId_fk": { "name": "mongo_projectId_project_projectId_fk", "tableFrom": "mongo", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "mongo_appName_unique": { "name": "mongo_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "mysql": { + "public.mysql": { "name": "mysql", "schema": "", "columns": { @@ -1235,29 +1233,29 @@ "mysql_projectId_project_projectId_fk": { "name": "mysql_projectId_project_projectId_fk", "tableFrom": "mysql", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "mysql_appName_unique": { "name": "mysql_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } }, - "backup": { + "public.backup": { "name": "backup", "schema": "", "columns": { @@ -1333,73 +1331,73 @@ "backup_destinationId_destination_destinationId_fk": { "name": "backup_destinationId_destination_destinationId_fk", "tableFrom": "backup", - "tableTo": "destination", "columnsFrom": [ "destinationId" ], + "tableTo": "destination", "columnsTo": [ "destinationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_postgresId_postgres_postgresId_fk": { "name": "backup_postgresId_postgres_postgresId_fk", "tableFrom": "backup", - "tableTo": "postgres", "columnsFrom": [ "postgresId" ], + "tableTo": "postgres", "columnsTo": [ "postgresId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_mariadbId_mariadb_mariadbId_fk": { "name": "backup_mariadbId_mariadb_mariadbId_fk", "tableFrom": "backup", - "tableTo": "mariadb", "columnsFrom": [ "mariadbId" ], + "tableTo": "mariadb", "columnsTo": [ "mariadbId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_mysqlId_mysql_mysqlId_fk": { "name": "backup_mysqlId_mysql_mysqlId_fk", "tableFrom": "backup", - "tableTo": "mysql", "columnsFrom": [ "mysqlId" ], + "tableTo": "mysql", "columnsTo": [ "mysqlId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "backup_mongoId_mongo_mongoId_fk": { "name": "backup_mongoId_mongo_mongoId_fk", "tableFrom": "backup", - "tableTo": "mongo", "columnsFrom": [ "mongoId" ], + "tableTo": "mongo", "columnsTo": [ "mongoId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "destination": { + "public.destination": { "name": "destination", "schema": "", "columns": { @@ -1457,21 +1455,21 @@ "destination_adminId_admin_adminId_fk": { "name": "destination_adminId_admin_adminId_fk", "tableFrom": "destination", - "tableTo": "admin", "columnsFrom": [ "adminId" ], + "tableTo": "admin", "columnsTo": [ "adminId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "deployment": { + "public.deployment": { "name": "deployment", "schema": "", "columns": { @@ -1518,21 +1516,21 @@ "deployment_applicationId_application_applicationId_fk": { "name": "deployment_applicationId_application_applicationId_fk", "tableFrom": "deployment", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "mount": { + "public.mount": { "name": "mount", "schema": "", "columns": { @@ -1621,86 +1619,86 @@ "mount_applicationId_application_applicationId_fk": { "name": "mount_applicationId_application_applicationId_fk", "tableFrom": "mount", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_postgresId_postgres_postgresId_fk": { "name": "mount_postgresId_postgres_postgresId_fk", "tableFrom": "mount", - "tableTo": "postgres", "columnsFrom": [ "postgresId" ], + "tableTo": "postgres", "columnsTo": [ "postgresId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_mariadbId_mariadb_mariadbId_fk": { "name": "mount_mariadbId_mariadb_mariadbId_fk", "tableFrom": "mount", - "tableTo": "mariadb", "columnsFrom": [ "mariadbId" ], + "tableTo": "mariadb", "columnsTo": [ "mariadbId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_mongoId_mongo_mongoId_fk": { "name": "mount_mongoId_mongo_mongoId_fk", "tableFrom": "mount", - "tableTo": "mongo", "columnsFrom": [ "mongoId" ], + "tableTo": "mongo", "columnsTo": [ "mongoId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_mysqlId_mysql_mysqlId_fk": { "name": "mount_mysqlId_mysql_mysqlId_fk", "tableFrom": "mount", - "tableTo": "mysql", "columnsFrom": [ "mysqlId" ], + "tableTo": "mysql", "columnsTo": [ "mysqlId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "mount_redisId_redis_redisId_fk": { "name": "mount_redisId_redis_redisId_fk", "tableFrom": "mount", - "tableTo": "redis", "columnsFrom": [ "redisId" ], + "tableTo": "redis", "columnsTo": [ "redisId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "certificate": { + "public.certificate": { "name": "certificate", "schema": "", "columns": { @@ -1747,14 +1745,14 @@ "uniqueConstraints": { "certificate_certificatePath_unique": { "name": "certificate_certificatePath_unique", - "nullsNotDistinct": false, "columns": [ "certificatePath" - ] + ], + "nullsNotDistinct": false } } }, - "session": { + "public.session": { "name": "session", "schema": "", "columns": { @@ -1782,21 +1780,21 @@ "session_user_id_auth_id_fk": { "name": "session_user_id_auth_id_fk", "tableFrom": "session", - "tableTo": "auth", "columnsFrom": [ "user_id" ], + "tableTo": "auth", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "redirect": { + "public.redirect": { "name": "redirect", "schema": "", "columns": { @@ -1849,21 +1847,21 @@ "redirect_applicationId_application_applicationId_fk": { "name": "redirect_applicationId_application_applicationId_fk", "tableFrom": "redirect", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "security": { + "public.security": { "name": "security", "schema": "", "columns": { @@ -1903,30 +1901,30 @@ "security_applicationId_application_applicationId_fk": { "name": "security_applicationId_application_applicationId_fk", "tableFrom": "security", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "security_username_applicationId_unique": { "name": "security_username_applicationId_unique", - "nullsNotDistinct": false, "columns": [ "username", "applicationId" - ] + ], + "nullsNotDistinct": false } } }, - "port": { + "public.port": { "name": "port", "schema": "", "columns": { @@ -1966,21 +1964,21 @@ "port_applicationId_application_applicationId_fk": { "name": "port_applicationId_application_applicationId_fk", "tableFrom": "port", - "tableTo": "application", "columnsFrom": [ "applicationId" ], + "tableTo": "application", "columnsTo": [ "applicationId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {} }, - "redis": { + "public.redis": { "name": "redis", "schema": "", "columns": { @@ -2087,118 +2085,130 @@ "redis_projectId_project_projectId_fk": { "name": "redis_projectId_project_projectId_fk", "tableFrom": "redis", - "tableTo": "project", "columnsFrom": [ "projectId" ], + "tableTo": "project", "columnsTo": [ "projectId" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "redis_appName_unique": { "name": "redis_appName_unique", - "nullsNotDistinct": false, "columns": [ "appName" - ] + ], + "nullsNotDistinct": false } } } }, "enums": { - "buildType": { + "public.buildType": { "name": "buildType", - "values": { - "dockerfile": "dockerfile", - "heroku_buildpacks": "heroku_buildpacks", - "paketo_buildpacks": "paketo_buildpacks", - "nixpacks": "nixpacks" - } + "schema": "public", + "values": [ + "dockerfile", + "heroku_buildpacks", + "paketo_buildpacks", + "nixpacks" + ] }, - "sourceType": { + "public.sourceType": { "name": "sourceType", - "values": { - "docker": "docker", - "git": "git", - "github": "github" - } + "schema": "public", + "values": [ + "docker", + "git", + "github" + ] }, - "Roles": { + "public.Roles": { "name": "Roles", - "values": { - "admin": "admin", - "user": "user" - } + "schema": "public", + "values": [ + "admin", + "user" + ] }, - "databaseType": { + "public.databaseType": { "name": "databaseType", - "values": { - "postgres": "postgres", - "mariadb": "mariadb", - "mysql": "mysql", - "mongo": "mongo" - } + "schema": "public", + "values": [ + "postgres", + "mariadb", + "mysql", + "mongo" + ] }, - "deploymentStatus": { + "public.deploymentStatus": { "name": "deploymentStatus", - "values": { - "running": "running", - "done": "done", - "error": "error" - } + "schema": "public", + "values": [ + "running", + "done", + "error" + ] }, - "mountType": { + "public.mountType": { "name": "mountType", - "values": { - "bind": "bind", - "volume": "volume", - "file": "file" - } + "schema": "public", + "values": [ + "bind", + "volume", + "file" + ] }, - "serviceType": { + "public.serviceType": { "name": "serviceType", - "values": { - "application": "application", - "postgres": "postgres", - "mysql": "mysql", - "mariadb": "mariadb", - "mongo": "mongo", - "redis": "redis" - } + "schema": "public", + "values": [ + "application", + "postgres", + "mysql", + "mariadb", + "mongo", + "redis" + ] }, - "protocolType": { + "public.protocolType": { "name": "protocolType", - "values": { - "tcp": "tcp", - "udp": "udp" - } + "schema": "public", + "values": [ + "tcp", + "udp" + ] }, - "applicationStatus": { + "public.applicationStatus": { "name": "applicationStatus", - "values": { - "idle": "idle", - "running": "running", - "done": "done", - "error": "error" - } + "schema": "public", + "values": [ + "idle", + "running", + "done", + "error" + ] }, - "certificateType": { + "public.certificateType": { "name": "certificateType", - "values": { - "letsencrypt": "letsencrypt", - "none": "none" - } + "schema": "public", + "values": [ + "letsencrypt", + "none" + ] } }, "schemas": {}, "_meta": { - "columns": {}, "schemas": {}, - "tables": {} - } + "tables": {}, + "columns": {} + }, + "id": "7bb4bbcf-791c-4888-919e-f74bc0528b5f", + "prevId": "5a1d3f2b-9c31-4125-9645-015170550b51" } \ No newline at end of file diff --git a/drizzle/meta/0005_snapshot.json b/drizzle/meta/0005_snapshot.json new file mode 100644 index 000000000..30ac2bb33 --- /dev/null +++ b/drizzle/meta/0005_snapshot.json @@ -0,0 +1,2295 @@ +{ + "version": "6", + "dialect": "postgresql", + "tables": { + "public.application": { + "name": "application", + "schema": "", + "columns": { + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "subtitle": { + "name": "subtitle", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refreshToken": { + "name": "refreshToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sourceType": { + "name": "sourceType", + "type": "sourceType", + "primaryKey": false, + "notNull": true, + "default": "'github'" + }, + "repository": { + "name": "repository", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "owner": { + "name": "owner", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "branch": { + "name": "branch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "buildPath": { + "name": "buildPath", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "autoDeploy": { + "name": "autoDeploy", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitUrl": { + "name": "customGitUrl", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitBranch": { + "name": "customGitBranch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitBuildPath": { + "name": "customGitBuildPath", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitSSHKey": { + "name": "customGitSSHKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerfile": { + "name": "dockerfile", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "buildType": { + "name": "buildType", + "type": "buildType", + "primaryKey": false, + "notNull": true, + "default": "'nixpacks'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "application_projectId_project_projectId_fk": { + "name": "application_projectId_project_projectId_fk", + "tableFrom": "application", + "columnsFrom": [ + "projectId" + ], + "tableTo": "project", + "columnsTo": [ + "projectId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "application_appName_unique": { + "name": "application_appName_unique", + "columns": [ + "appName" + ], + "nullsNotDistinct": false + } + } + }, + "public.postgres": { + "name": "postgres", + "schema": "", + "columns": { + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "postgres_projectId_project_projectId_fk": { + "name": "postgres_projectId_project_projectId_fk", + "tableFrom": "postgres", + "columnsFrom": [ + "projectId" + ], + "tableTo": "project", + "columnsTo": [ + "projectId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "postgres_appName_unique": { + "name": "postgres_appName_unique", + "columns": [ + "appName" + ], + "nullsNotDistinct": false + } + } + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "userId": { + "name": "userId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "isRegistered": { + "name": "isRegistered", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "expirationDate": { + "name": "expirationDate", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "canCreateProjects": { + "name": "canCreateProjects", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canCreateServices": { + "name": "canCreateServices", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canDeleteProjects": { + "name": "canDeleteProjects", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canDeleteServices": { + "name": "canDeleteServices", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canAccessToDocker": { + "name": "canAccessToDocker", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canAccessToTraefikFiles": { + "name": "canAccessToTraefikFiles", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "accesedProjects": { + "name": "accesedProjects", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::text[]" + }, + "accesedServices": { + "name": "accesedServices", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::text[]" + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "authId": { + "name": "authId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "user_adminId_admin_adminId_fk": { + "name": "user_adminId_admin_adminId_fk", + "tableFrom": "user", + "columnsFrom": [ + "adminId" + ], + "tableTo": "admin", + "columnsTo": [ + "adminId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "user_authId_auth_id_fk": { + "name": "user_authId_auth_id_fk", + "tableFrom": "user", + "columnsFrom": [ + "authId" + ], + "tableTo": "auth", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.admin": { + "name": "admin", + "schema": "", + "columns": { + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "githubAppId": { + "name": "githubAppId", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "githubAppName": { + "name": "githubAppName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serverIp": { + "name": "serverIp", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "certificateType": { + "name": "certificateType", + "type": "certificateType", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "host": { + "name": "host", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubClientId": { + "name": "githubClientId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubClientSecret": { + "name": "githubClientSecret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubInstallationId": { + "name": "githubInstallationId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubPrivateKey": { + "name": "githubPrivateKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "letsEncryptEmail": { + "name": "letsEncryptEmail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sshPrivateKey": { + "name": "sshPrivateKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enableDockerCleanup": { + "name": "enableDockerCleanup", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "authId": { + "name": "authId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "admin_authId_auth_id_fk": { + "name": "admin_authId_auth_id_fk", + "tableFrom": "admin", + "columnsFrom": [ + "authId" + ], + "tableTo": "auth", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.auth": { + "name": "auth", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rol": { + "name": "rol", + "type": "Roles", + "primaryKey": false, + "notNull": true + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secret": { + "name": "secret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is2FAEnabled": { + "name": "is2FAEnabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "auth_email_unique": { + "name": "auth_email_unique", + "columns": [ + "email" + ], + "nullsNotDistinct": false + } + } + }, + "public.project": { + "name": "project", + "schema": "", + "columns": { + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "project_adminId_admin_adminId_fk": { + "name": "project_adminId_admin_adminId_fk", + "tableFrom": "project", + "columnsFrom": [ + "adminId" + ], + "tableTo": "admin", + "columnsTo": [ + "adminId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.domain": { + "name": "domain", + "schema": "", + "columns": { + "domainId": { + "name": "domainId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "host": { + "name": "host", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "https": { + "name": "https", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "port": { + "name": "port", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 80 + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "uniqueConfigKey": { + "name": "uniqueConfigKey", + "type": "serial", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificateType": { + "name": "certificateType", + "type": "certificateType", + "primaryKey": false, + "notNull": true, + "default": "'none'" + } + }, + "indexes": {}, + "foreignKeys": { + "domain_applicationId_application_applicationId_fk": { + "name": "domain_applicationId_application_applicationId_fk", + "tableFrom": "domain", + "columnsFrom": [ + "applicationId" + ], + "tableTo": "application", + "columnsTo": [ + "applicationId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.mariadb": { + "name": "mariadb", + "schema": "", + "columns": { + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rootPassword": { + "name": "rootPassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mariadb_projectId_project_projectId_fk": { + "name": "mariadb_projectId_project_projectId_fk", + "tableFrom": "mariadb", + "columnsFrom": [ + "projectId" + ], + "tableTo": "project", + "columnsTo": [ + "projectId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mariadb_appName_unique": { + "name": "mariadb_appName_unique", + "columns": [ + "appName" + ], + "nullsNotDistinct": false + } + } + }, + "public.mongo": { + "name": "mongo", + "schema": "", + "columns": { + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mongo_projectId_project_projectId_fk": { + "name": "mongo_projectId_project_projectId_fk", + "tableFrom": "mongo", + "columnsFrom": [ + "projectId" + ], + "tableTo": "project", + "columnsTo": [ + "projectId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mongo_appName_unique": { + "name": "mongo_appName_unique", + "columns": [ + "appName" + ], + "nullsNotDistinct": false + } + } + }, + "public.mysql": { + "name": "mysql", + "schema": "", + "columns": { + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rootPassword": { + "name": "rootPassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mysql_projectId_project_projectId_fk": { + "name": "mysql_projectId_project_projectId_fk", + "tableFrom": "mysql", + "columnsFrom": [ + "projectId" + ], + "tableTo": "project", + "columnsTo": [ + "projectId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mysql_appName_unique": { + "name": "mysql_appName_unique", + "columns": [ + "appName" + ], + "nullsNotDistinct": false + } + } + }, + "public.backup": { + "name": "backup", + "schema": "", + "columns": { + "backupId": { + "name": "backupId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "schedule": { + "name": "schedule", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "database": { + "name": "database", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prefix": { + "name": "prefix", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "destinationId": { + "name": "destinationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseType": { + "name": "databaseType", + "type": "databaseType", + "primaryKey": false, + "notNull": true + }, + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "backup_destinationId_destination_destinationId_fk": { + "name": "backup_destinationId_destination_destinationId_fk", + "tableFrom": "backup", + "columnsFrom": [ + "destinationId" + ], + "tableTo": "destination", + "columnsTo": [ + "destinationId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "backup_postgresId_postgres_postgresId_fk": { + "name": "backup_postgresId_postgres_postgresId_fk", + "tableFrom": "backup", + "columnsFrom": [ + "postgresId" + ], + "tableTo": "postgres", + "columnsTo": [ + "postgresId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "backup_mariadbId_mariadb_mariadbId_fk": { + "name": "backup_mariadbId_mariadb_mariadbId_fk", + "tableFrom": "backup", + "columnsFrom": [ + "mariadbId" + ], + "tableTo": "mariadb", + "columnsTo": [ + "mariadbId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "backup_mysqlId_mysql_mysqlId_fk": { + "name": "backup_mysqlId_mysql_mysqlId_fk", + "tableFrom": "backup", + "columnsFrom": [ + "mysqlId" + ], + "tableTo": "mysql", + "columnsTo": [ + "mysqlId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "backup_mongoId_mongo_mongoId_fk": { + "name": "backup_mongoId_mongo_mongoId_fk", + "tableFrom": "backup", + "columnsFrom": [ + "mongoId" + ], + "tableTo": "mongo", + "columnsTo": [ + "mongoId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.destination": { + "name": "destination", + "schema": "", + "columns": { + "destinationId": { + "name": "destinationId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "accessKey": { + "name": "accessKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "secretAccessKey": { + "name": "secretAccessKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "bucket": { + "name": "bucket", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "region": { + "name": "region", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "destination_adminId_admin_adminId_fk": { + "name": "destination_adminId_admin_adminId_fk", + "tableFrom": "destination", + "columnsFrom": [ + "adminId" + ], + "tableTo": "admin", + "columnsTo": [ + "adminId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.deployment": { + "name": "deployment", + "schema": "", + "columns": { + "deploymentId": { + "name": "deploymentId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "deploymentStatus", + "primaryKey": false, + "notNull": false, + "default": "'running'" + }, + "logPath": { + "name": "logPath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "deployment_applicationId_application_applicationId_fk": { + "name": "deployment_applicationId_application_applicationId_fk", + "tableFrom": "deployment", + "columnsFrom": [ + "applicationId" + ], + "tableTo": "application", + "columnsTo": [ + "applicationId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.mount": { + "name": "mount", + "schema": "", + "columns": { + "mountId": { + "name": "mountId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "mountType", + "primaryKey": false, + "notNull": true + }, + "hostPath": { + "name": "hostPath", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "volumeName": { + "name": "volumeName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serviceType": { + "name": "serviceType", + "type": "serviceType", + "primaryKey": false, + "notNull": true, + "default": "'application'" + }, + "mountPath": { + "name": "mountPath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "redisId": { + "name": "redisId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "mount_applicationId_application_applicationId_fk": { + "name": "mount_applicationId_application_applicationId_fk", + "tableFrom": "mount", + "columnsFrom": [ + "applicationId" + ], + "tableTo": "application", + "columnsTo": [ + "applicationId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "mount_postgresId_postgres_postgresId_fk": { + "name": "mount_postgresId_postgres_postgresId_fk", + "tableFrom": "mount", + "columnsFrom": [ + "postgresId" + ], + "tableTo": "postgres", + "columnsTo": [ + "postgresId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "mount_mariadbId_mariadb_mariadbId_fk": { + "name": "mount_mariadbId_mariadb_mariadbId_fk", + "tableFrom": "mount", + "columnsFrom": [ + "mariadbId" + ], + "tableTo": "mariadb", + "columnsTo": [ + "mariadbId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "mount_mongoId_mongo_mongoId_fk": { + "name": "mount_mongoId_mongo_mongoId_fk", + "tableFrom": "mount", + "columnsFrom": [ + "mongoId" + ], + "tableTo": "mongo", + "columnsTo": [ + "mongoId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "mount_mysqlId_mysql_mysqlId_fk": { + "name": "mount_mysqlId_mysql_mysqlId_fk", + "tableFrom": "mount", + "columnsFrom": [ + "mysqlId" + ], + "tableTo": "mysql", + "columnsTo": [ + "mysqlId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "mount_redisId_redis_redisId_fk": { + "name": "mount_redisId_redis_redisId_fk", + "tableFrom": "mount", + "columnsFrom": [ + "redisId" + ], + "tableTo": "redis", + "columnsTo": [ + "redisId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.certificate": { + "name": "certificate", + "schema": "", + "columns": { + "certificateId": { + "name": "certificateId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificateData": { + "name": "certificateData", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "privateKey": { + "name": "privateKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificatePath": { + "name": "certificatePath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "autoRenew": { + "name": "autoRenew", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "certificate_certificatePath_unique": { + "name": "certificate_certificatePath_unique", + "columns": [ + "certificatePath" + ], + "nullsNotDistinct": false + } + } + }, + "public.session": { + "name": "session", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "session_user_id_auth_id_fk": { + "name": "session_user_id_auth_id_fk", + "tableFrom": "session", + "columnsFrom": [ + "user_id" + ], + "tableTo": "auth", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.redirect": { + "name": "redirect", + "schema": "", + "columns": { + "redirectId": { + "name": "redirectId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "regex": { + "name": "regex", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "replacement": { + "name": "replacement", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "permanent": { + "name": "permanent", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "uniqueConfigKey": { + "name": "uniqueConfigKey", + "type": "serial", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "redirect_applicationId_application_applicationId_fk": { + "name": "redirect_applicationId_application_applicationId_fk", + "tableFrom": "redirect", + "columnsFrom": [ + "applicationId" + ], + "tableTo": "application", + "columnsTo": [ + "applicationId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.security": { + "name": "security", + "schema": "", + "columns": { + "securityId": { + "name": "securityId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "security_applicationId_application_applicationId_fk": { + "name": "security_applicationId_application_applicationId_fk", + "tableFrom": "security", + "columnsFrom": [ + "applicationId" + ], + "tableTo": "application", + "columnsTo": [ + "applicationId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "security_username_applicationId_unique": { + "name": "security_username_applicationId_unique", + "columns": [ + "username", + "applicationId" + ], + "nullsNotDistinct": false + } + } + }, + "public.port": { + "name": "port", + "schema": "", + "columns": { + "portId": { + "name": "portId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "publishedPort": { + "name": "publishedPort", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "targetPort": { + "name": "targetPort", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "protocol": { + "name": "protocol", + "type": "protocolType", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "port_applicationId_application_applicationId_fk": { + "name": "port_applicationId_application_applicationId_fk", + "tableFrom": "port", + "columnsFrom": [ + "applicationId" + ], + "tableTo": "application", + "columnsTo": [ + "applicationId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.redis": { + "name": "redis", + "schema": "", + "columns": { + "redisId": { + "name": "redisId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "redis_projectId_project_projectId_fk": { + "name": "redis_projectId_project_projectId_fk", + "tableFrom": "redis", + "columnsFrom": [ + "projectId" + ], + "tableTo": "project", + "columnsTo": [ + "projectId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "redis_appName_unique": { + "name": "redis_appName_unique", + "columns": [ + "appName" + ], + "nullsNotDistinct": false + } + } + }, + "public.registry": { + "name": "registry", + "schema": "", + "columns": { + "registryId": { + "name": "registryId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "registryName": { + "name": "registryName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "registryUrl": { + "name": "registryUrl", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "selfHosted": { + "name": "selfHosted", + "type": "RegistryType", + "primaryKey": false, + "notNull": true, + "default": "'cloud'" + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "registry_adminId_admin_adminId_fk": { + "name": "registry_adminId_admin_adminId_fk", + "tableFrom": "registry", + "columnsFrom": [ + "adminId" + ], + "tableTo": "admin", + "columnsTo": [ + "adminId" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + } + }, + "enums": { + "public.buildType": { + "name": "buildType", + "schema": "public", + "values": [ + "dockerfile", + "heroku_buildpacks", + "paketo_buildpacks", + "nixpacks" + ] + }, + "public.sourceType": { + "name": "sourceType", + "schema": "public", + "values": [ + "docker", + "git", + "github" + ] + }, + "public.Roles": { + "name": "Roles", + "schema": "public", + "values": [ + "admin", + "user" + ] + }, + "public.databaseType": { + "name": "databaseType", + "schema": "public", + "values": [ + "postgres", + "mariadb", + "mysql", + "mongo" + ] + }, + "public.deploymentStatus": { + "name": "deploymentStatus", + "schema": "public", + "values": [ + "running", + "done", + "error" + ] + }, + "public.mountType": { + "name": "mountType", + "schema": "public", + "values": [ + "bind", + "volume", + "file" + ] + }, + "public.serviceType": { + "name": "serviceType", + "schema": "public", + "values": [ + "application", + "postgres", + "mysql", + "mariadb", + "mongo", + "redis" + ] + }, + "public.protocolType": { + "name": "protocolType", + "schema": "public", + "values": [ + "tcp", + "udp" + ] + }, + "public.applicationStatus": { + "name": "applicationStatus", + "schema": "public", + "values": [ + "idle", + "running", + "done", + "error" + ] + }, + "public.certificateType": { + "name": "certificateType", + "schema": "public", + "values": [ + "letsencrypt", + "none" + ] + }, + "public.RegistryType": { + "name": "RegistryType", + "schema": "public", + "values": [ + "selfHosted", + "cloud" + ] + } + }, + "schemas": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "id": "92c75e26-64ef-484f-a7d2-72a9422c119f", + "prevId": "7bb4bbcf-791c-4888-919e-f74bc0528b5f" +} \ No newline at end of file diff --git a/drizzle/meta/0006_snapshot.json b/drizzle/meta/0006_snapshot.json new file mode 100644 index 000000000..37764831a --- /dev/null +++ b/drizzle/meta/0006_snapshot.json @@ -0,0 +1,2331 @@ +{ + "id": "8ca71247-d512-427d-b115-47a7287ac431", + "prevId": "92c75e26-64ef-484f-a7d2-72a9422c119f", + "version": "6", + "dialect": "postgresql", + "tables": { + "public.application": { + "name": "application", + "schema": "", + "columns": { + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "subtitle": { + "name": "subtitle", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refreshToken": { + "name": "refreshToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sourceType": { + "name": "sourceType", + "type": "sourceType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'github'" + }, + "repository": { + "name": "repository", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "owner": { + "name": "owner", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "branch": { + "name": "branch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "buildPath": { + "name": "buildPath", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "autoDeploy": { + "name": "autoDeploy", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitUrl": { + "name": "customGitUrl", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitBranch": { + "name": "customGitBranch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitBuildPath": { + "name": "customGitBuildPath", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitSSHKey": { + "name": "customGitSSHKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerfile": { + "name": "dockerfile", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "buildType": { + "name": "buildType", + "type": "buildType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'nixpacks'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "registryId": { + "name": "registryId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "application_registryId_registry_registryId_fk": { + "name": "application_registryId_registry_registryId_fk", + "tableFrom": "application", + "tableTo": "registry", + "columnsFrom": [ + "registryId" + ], + "columnsTo": [ + "registryId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "application_projectId_project_projectId_fk": { + "name": "application_projectId_project_projectId_fk", + "tableFrom": "application", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "application_appName_unique": { + "name": "application_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.postgres": { + "name": "postgres", + "schema": "", + "columns": { + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "postgres_projectId_project_projectId_fk": { + "name": "postgres_projectId_project_projectId_fk", + "tableFrom": "postgres", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "postgres_appName_unique": { + "name": "postgres_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "userId": { + "name": "userId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "isRegistered": { + "name": "isRegistered", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "expirationDate": { + "name": "expirationDate", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "canCreateProjects": { + "name": "canCreateProjects", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canCreateServices": { + "name": "canCreateServices", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canDeleteProjects": { + "name": "canDeleteProjects", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canDeleteServices": { + "name": "canDeleteServices", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canAccessToDocker": { + "name": "canAccessToDocker", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canAccessToTraefikFiles": { + "name": "canAccessToTraefikFiles", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "accesedProjects": { + "name": "accesedProjects", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::text[]" + }, + "accesedServices": { + "name": "accesedServices", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::text[]" + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "authId": { + "name": "authId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "user_adminId_admin_adminId_fk": { + "name": "user_adminId_admin_adminId_fk", + "tableFrom": "user", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "user_authId_auth_id_fk": { + "name": "user_authId_auth_id_fk", + "tableFrom": "user", + "tableTo": "auth", + "columnsFrom": [ + "authId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.admin": { + "name": "admin", + "schema": "", + "columns": { + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "githubAppId": { + "name": "githubAppId", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "githubAppName": { + "name": "githubAppName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serverIp": { + "name": "serverIp", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "certificateType": { + "name": "certificateType", + "type": "certificateType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "host": { + "name": "host", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubClientId": { + "name": "githubClientId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubClientSecret": { + "name": "githubClientSecret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubInstallationId": { + "name": "githubInstallationId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubPrivateKey": { + "name": "githubPrivateKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "letsEncryptEmail": { + "name": "letsEncryptEmail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sshPrivateKey": { + "name": "sshPrivateKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enableDockerCleanup": { + "name": "enableDockerCleanup", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "authId": { + "name": "authId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "admin_authId_auth_id_fk": { + "name": "admin_authId_auth_id_fk", + "tableFrom": "admin", + "tableTo": "auth", + "columnsFrom": [ + "authId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.auth": { + "name": "auth", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rol": { + "name": "rol", + "type": "Roles", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secret": { + "name": "secret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is2FAEnabled": { + "name": "is2FAEnabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "auth_email_unique": { + "name": "auth_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + } + }, + "public.project": { + "name": "project", + "schema": "", + "columns": { + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "project_adminId_admin_adminId_fk": { + "name": "project_adminId_admin_adminId_fk", + "tableFrom": "project", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.domain": { + "name": "domain", + "schema": "", + "columns": { + "domainId": { + "name": "domainId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "host": { + "name": "host", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "https": { + "name": "https", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "port": { + "name": "port", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 80 + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "uniqueConfigKey": { + "name": "uniqueConfigKey", + "type": "serial", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificateType": { + "name": "certificateType", + "type": "certificateType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + } + }, + "indexes": {}, + "foreignKeys": { + "domain_applicationId_application_applicationId_fk": { + "name": "domain_applicationId_application_applicationId_fk", + "tableFrom": "domain", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.mariadb": { + "name": "mariadb", + "schema": "", + "columns": { + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rootPassword": { + "name": "rootPassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mariadb_projectId_project_projectId_fk": { + "name": "mariadb_projectId_project_projectId_fk", + "tableFrom": "mariadb", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mariadb_appName_unique": { + "name": "mariadb_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.mongo": { + "name": "mongo", + "schema": "", + "columns": { + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mongo_projectId_project_projectId_fk": { + "name": "mongo_projectId_project_projectId_fk", + "tableFrom": "mongo", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mongo_appName_unique": { + "name": "mongo_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.mysql": { + "name": "mysql", + "schema": "", + "columns": { + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rootPassword": { + "name": "rootPassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mysql_projectId_project_projectId_fk": { + "name": "mysql_projectId_project_projectId_fk", + "tableFrom": "mysql", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mysql_appName_unique": { + "name": "mysql_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.backup": { + "name": "backup", + "schema": "", + "columns": { + "backupId": { + "name": "backupId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "schedule": { + "name": "schedule", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "database": { + "name": "database", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prefix": { + "name": "prefix", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "destinationId": { + "name": "destinationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseType": { + "name": "databaseType", + "type": "databaseType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "backup_destinationId_destination_destinationId_fk": { + "name": "backup_destinationId_destination_destinationId_fk", + "tableFrom": "backup", + "tableTo": "destination", + "columnsFrom": [ + "destinationId" + ], + "columnsTo": [ + "destinationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_postgresId_postgres_postgresId_fk": { + "name": "backup_postgresId_postgres_postgresId_fk", + "tableFrom": "backup", + "tableTo": "postgres", + "columnsFrom": [ + "postgresId" + ], + "columnsTo": [ + "postgresId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mariadbId_mariadb_mariadbId_fk": { + "name": "backup_mariadbId_mariadb_mariadbId_fk", + "tableFrom": "backup", + "tableTo": "mariadb", + "columnsFrom": [ + "mariadbId" + ], + "columnsTo": [ + "mariadbId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mysqlId_mysql_mysqlId_fk": { + "name": "backup_mysqlId_mysql_mysqlId_fk", + "tableFrom": "backup", + "tableTo": "mysql", + "columnsFrom": [ + "mysqlId" + ], + "columnsTo": [ + "mysqlId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mongoId_mongo_mongoId_fk": { + "name": "backup_mongoId_mongo_mongoId_fk", + "tableFrom": "backup", + "tableTo": "mongo", + "columnsFrom": [ + "mongoId" + ], + "columnsTo": [ + "mongoId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.destination": { + "name": "destination", + "schema": "", + "columns": { + "destinationId": { + "name": "destinationId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "accessKey": { + "name": "accessKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "secretAccessKey": { + "name": "secretAccessKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "bucket": { + "name": "bucket", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "region": { + "name": "region", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "destination_adminId_admin_adminId_fk": { + "name": "destination_adminId_admin_adminId_fk", + "tableFrom": "destination", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.deployment": { + "name": "deployment", + "schema": "", + "columns": { + "deploymentId": { + "name": "deploymentId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "deploymentStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": false, + "default": "'running'" + }, + "logPath": { + "name": "logPath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "deployment_applicationId_application_applicationId_fk": { + "name": "deployment_applicationId_application_applicationId_fk", + "tableFrom": "deployment", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.mount": { + "name": "mount", + "schema": "", + "columns": { + "mountId": { + "name": "mountId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "mountType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "hostPath": { + "name": "hostPath", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "volumeName": { + "name": "volumeName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serviceType": { + "name": "serviceType", + "type": "serviceType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'application'" + }, + "mountPath": { + "name": "mountPath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "redisId": { + "name": "redisId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "mount_applicationId_application_applicationId_fk": { + "name": "mount_applicationId_application_applicationId_fk", + "tableFrom": "mount", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_postgresId_postgres_postgresId_fk": { + "name": "mount_postgresId_postgres_postgresId_fk", + "tableFrom": "mount", + "tableTo": "postgres", + "columnsFrom": [ + "postgresId" + ], + "columnsTo": [ + "postgresId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mariadbId_mariadb_mariadbId_fk": { + "name": "mount_mariadbId_mariadb_mariadbId_fk", + "tableFrom": "mount", + "tableTo": "mariadb", + "columnsFrom": [ + "mariadbId" + ], + "columnsTo": [ + "mariadbId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mongoId_mongo_mongoId_fk": { + "name": "mount_mongoId_mongo_mongoId_fk", + "tableFrom": "mount", + "tableTo": "mongo", + "columnsFrom": [ + "mongoId" + ], + "columnsTo": [ + "mongoId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mysqlId_mysql_mysqlId_fk": { + "name": "mount_mysqlId_mysql_mysqlId_fk", + "tableFrom": "mount", + "tableTo": "mysql", + "columnsFrom": [ + "mysqlId" + ], + "columnsTo": [ + "mysqlId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_redisId_redis_redisId_fk": { + "name": "mount_redisId_redis_redisId_fk", + "tableFrom": "mount", + "tableTo": "redis", + "columnsFrom": [ + "redisId" + ], + "columnsTo": [ + "redisId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.certificate": { + "name": "certificate", + "schema": "", + "columns": { + "certificateId": { + "name": "certificateId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificateData": { + "name": "certificateData", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "privateKey": { + "name": "privateKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificatePath": { + "name": "certificatePath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "autoRenew": { + "name": "autoRenew", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "certificate_certificatePath_unique": { + "name": "certificate_certificatePath_unique", + "nullsNotDistinct": false, + "columns": [ + "certificatePath" + ] + } + } + }, + "public.session": { + "name": "session", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "session_user_id_auth_id_fk": { + "name": "session_user_id_auth_id_fk", + "tableFrom": "session", + "tableTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.redirect": { + "name": "redirect", + "schema": "", + "columns": { + "redirectId": { + "name": "redirectId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "regex": { + "name": "regex", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "replacement": { + "name": "replacement", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "permanent": { + "name": "permanent", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "uniqueConfigKey": { + "name": "uniqueConfigKey", + "type": "serial", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "redirect_applicationId_application_applicationId_fk": { + "name": "redirect_applicationId_application_applicationId_fk", + "tableFrom": "redirect", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.security": { + "name": "security", + "schema": "", + "columns": { + "securityId": { + "name": "securityId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "security_applicationId_application_applicationId_fk": { + "name": "security_applicationId_application_applicationId_fk", + "tableFrom": "security", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "security_username_applicationId_unique": { + "name": "security_username_applicationId_unique", + "nullsNotDistinct": false, + "columns": [ + "username", + "applicationId" + ] + } + } + }, + "public.port": { + "name": "port", + "schema": "", + "columns": { + "portId": { + "name": "portId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "publishedPort": { + "name": "publishedPort", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "targetPort": { + "name": "targetPort", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "protocol": { + "name": "protocol", + "type": "protocolType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "port_applicationId_application_applicationId_fk": { + "name": "port_applicationId_application_applicationId_fk", + "tableFrom": "port", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.redis": { + "name": "redis", + "schema": "", + "columns": { + "redisId": { + "name": "redisId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "redis_projectId_project_projectId_fk": { + "name": "redis_projectId_project_projectId_fk", + "tableFrom": "redis", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "redis_appName_unique": { + "name": "redis_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.registry": { + "name": "registry", + "schema": "", + "columns": { + "registryId": { + "name": "registryId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "registryName": { + "name": "registryName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "registryUrl": { + "name": "registryUrl", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "selfHosted": { + "name": "selfHosted", + "type": "RegistryType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'cloud'" + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "registry_adminId_admin_adminId_fk": { + "name": "registry_adminId_admin_adminId_fk", + "tableFrom": "registry", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + } + }, + "enums": { + "public.buildType": { + "name": "buildType", + "schema": "public", + "values": [ + "dockerfile", + "heroku_buildpacks", + "paketo_buildpacks", + "nixpacks" + ] + }, + "public.sourceType": { + "name": "sourceType", + "schema": "public", + "values": [ + "docker", + "git", + "github" + ] + }, + "public.Roles": { + "name": "Roles", + "schema": "public", + "values": [ + "admin", + "user" + ] + }, + "public.databaseType": { + "name": "databaseType", + "schema": "public", + "values": [ + "postgres", + "mariadb", + "mysql", + "mongo" + ] + }, + "public.deploymentStatus": { + "name": "deploymentStatus", + "schema": "public", + "values": [ + "running", + "done", + "error" + ] + }, + "public.mountType": { + "name": "mountType", + "schema": "public", + "values": [ + "bind", + "volume", + "file" + ] + }, + "public.serviceType": { + "name": "serviceType", + "schema": "public", + "values": [ + "application", + "postgres", + "mysql", + "mariadb", + "mongo", + "redis" + ] + }, + "public.protocolType": { + "name": "protocolType", + "schema": "public", + "values": [ + "tcp", + "udp" + ] + }, + "public.applicationStatus": { + "name": "applicationStatus", + "schema": "public", + "values": [ + "idle", + "running", + "done", + "error" + ] + }, + "public.certificateType": { + "name": "certificateType", + "schema": "public", + "values": [ + "letsencrypt", + "none" + ] + }, + "public.RegistryType": { + "name": "RegistryType", + "schema": "public", + "values": [ + "selfHosted", + "cloud" + ] + } + }, + "schemas": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/drizzle/meta/0007_snapshot.json b/drizzle/meta/0007_snapshot.json new file mode 100644 index 000000000..a3292da07 --- /dev/null +++ b/drizzle/meta/0007_snapshot.json @@ -0,0 +1,2338 @@ +{ + "id": "80176730-273b-45e4-a7ca-760e29ad6d02", + "prevId": "8ca71247-d512-427d-b115-47a7287ac431", + "version": "6", + "dialect": "postgresql", + "tables": { + "public.application": { + "name": "application", + "schema": "", + "columns": { + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "subtitle": { + "name": "subtitle", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refreshToken": { + "name": "refreshToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sourceType": { + "name": "sourceType", + "type": "sourceType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'github'" + }, + "repository": { + "name": "repository", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "owner": { + "name": "owner", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "branch": { + "name": "branch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "buildPath": { + "name": "buildPath", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "autoDeploy": { + "name": "autoDeploy", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitUrl": { + "name": "customGitUrl", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitBranch": { + "name": "customGitBranch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitBuildPath": { + "name": "customGitBuildPath", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitSSHKey": { + "name": "customGitSSHKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerfile": { + "name": "dockerfile", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "replicas": { + "name": "replicas", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 1 + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "buildType": { + "name": "buildType", + "type": "buildType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'nixpacks'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "registryId": { + "name": "registryId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "application_registryId_registry_registryId_fk": { + "name": "application_registryId_registry_registryId_fk", + "tableFrom": "application", + "tableTo": "registry", + "columnsFrom": [ + "registryId" + ], + "columnsTo": [ + "registryId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "application_projectId_project_projectId_fk": { + "name": "application_projectId_project_projectId_fk", + "tableFrom": "application", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "application_appName_unique": { + "name": "application_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.postgres": { + "name": "postgres", + "schema": "", + "columns": { + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "postgres_projectId_project_projectId_fk": { + "name": "postgres_projectId_project_projectId_fk", + "tableFrom": "postgres", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "postgres_appName_unique": { + "name": "postgres_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "userId": { + "name": "userId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "isRegistered": { + "name": "isRegistered", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "expirationDate": { + "name": "expirationDate", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "canCreateProjects": { + "name": "canCreateProjects", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canCreateServices": { + "name": "canCreateServices", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canDeleteProjects": { + "name": "canDeleteProjects", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canDeleteServices": { + "name": "canDeleteServices", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canAccessToDocker": { + "name": "canAccessToDocker", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canAccessToTraefikFiles": { + "name": "canAccessToTraefikFiles", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "accesedProjects": { + "name": "accesedProjects", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::text[]" + }, + "accesedServices": { + "name": "accesedServices", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::text[]" + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "authId": { + "name": "authId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "user_adminId_admin_adminId_fk": { + "name": "user_adminId_admin_adminId_fk", + "tableFrom": "user", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "user_authId_auth_id_fk": { + "name": "user_authId_auth_id_fk", + "tableFrom": "user", + "tableTo": "auth", + "columnsFrom": [ + "authId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.admin": { + "name": "admin", + "schema": "", + "columns": { + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "githubAppId": { + "name": "githubAppId", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "githubAppName": { + "name": "githubAppName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serverIp": { + "name": "serverIp", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "certificateType": { + "name": "certificateType", + "type": "certificateType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "host": { + "name": "host", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubClientId": { + "name": "githubClientId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubClientSecret": { + "name": "githubClientSecret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubInstallationId": { + "name": "githubInstallationId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubPrivateKey": { + "name": "githubPrivateKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "letsEncryptEmail": { + "name": "letsEncryptEmail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sshPrivateKey": { + "name": "sshPrivateKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enableDockerCleanup": { + "name": "enableDockerCleanup", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "authId": { + "name": "authId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "admin_authId_auth_id_fk": { + "name": "admin_authId_auth_id_fk", + "tableFrom": "admin", + "tableTo": "auth", + "columnsFrom": [ + "authId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.auth": { + "name": "auth", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rol": { + "name": "rol", + "type": "Roles", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secret": { + "name": "secret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is2FAEnabled": { + "name": "is2FAEnabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "auth_email_unique": { + "name": "auth_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + } + }, + "public.project": { + "name": "project", + "schema": "", + "columns": { + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "project_adminId_admin_adminId_fk": { + "name": "project_adminId_admin_adminId_fk", + "tableFrom": "project", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.domain": { + "name": "domain", + "schema": "", + "columns": { + "domainId": { + "name": "domainId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "host": { + "name": "host", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "https": { + "name": "https", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "port": { + "name": "port", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 80 + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "uniqueConfigKey": { + "name": "uniqueConfigKey", + "type": "serial", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificateType": { + "name": "certificateType", + "type": "certificateType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + } + }, + "indexes": {}, + "foreignKeys": { + "domain_applicationId_application_applicationId_fk": { + "name": "domain_applicationId_application_applicationId_fk", + "tableFrom": "domain", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.mariadb": { + "name": "mariadb", + "schema": "", + "columns": { + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rootPassword": { + "name": "rootPassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mariadb_projectId_project_projectId_fk": { + "name": "mariadb_projectId_project_projectId_fk", + "tableFrom": "mariadb", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mariadb_appName_unique": { + "name": "mariadb_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.mongo": { + "name": "mongo", + "schema": "", + "columns": { + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mongo_projectId_project_projectId_fk": { + "name": "mongo_projectId_project_projectId_fk", + "tableFrom": "mongo", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mongo_appName_unique": { + "name": "mongo_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.mysql": { + "name": "mysql", + "schema": "", + "columns": { + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rootPassword": { + "name": "rootPassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mysql_projectId_project_projectId_fk": { + "name": "mysql_projectId_project_projectId_fk", + "tableFrom": "mysql", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mysql_appName_unique": { + "name": "mysql_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.backup": { + "name": "backup", + "schema": "", + "columns": { + "backupId": { + "name": "backupId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "schedule": { + "name": "schedule", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "database": { + "name": "database", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prefix": { + "name": "prefix", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "destinationId": { + "name": "destinationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseType": { + "name": "databaseType", + "type": "databaseType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "backup_destinationId_destination_destinationId_fk": { + "name": "backup_destinationId_destination_destinationId_fk", + "tableFrom": "backup", + "tableTo": "destination", + "columnsFrom": [ + "destinationId" + ], + "columnsTo": [ + "destinationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_postgresId_postgres_postgresId_fk": { + "name": "backup_postgresId_postgres_postgresId_fk", + "tableFrom": "backup", + "tableTo": "postgres", + "columnsFrom": [ + "postgresId" + ], + "columnsTo": [ + "postgresId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mariadbId_mariadb_mariadbId_fk": { + "name": "backup_mariadbId_mariadb_mariadbId_fk", + "tableFrom": "backup", + "tableTo": "mariadb", + "columnsFrom": [ + "mariadbId" + ], + "columnsTo": [ + "mariadbId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mysqlId_mysql_mysqlId_fk": { + "name": "backup_mysqlId_mysql_mysqlId_fk", + "tableFrom": "backup", + "tableTo": "mysql", + "columnsFrom": [ + "mysqlId" + ], + "columnsTo": [ + "mysqlId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mongoId_mongo_mongoId_fk": { + "name": "backup_mongoId_mongo_mongoId_fk", + "tableFrom": "backup", + "tableTo": "mongo", + "columnsFrom": [ + "mongoId" + ], + "columnsTo": [ + "mongoId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.destination": { + "name": "destination", + "schema": "", + "columns": { + "destinationId": { + "name": "destinationId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "accessKey": { + "name": "accessKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "secretAccessKey": { + "name": "secretAccessKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "bucket": { + "name": "bucket", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "region": { + "name": "region", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "destination_adminId_admin_adminId_fk": { + "name": "destination_adminId_admin_adminId_fk", + "tableFrom": "destination", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.deployment": { + "name": "deployment", + "schema": "", + "columns": { + "deploymentId": { + "name": "deploymentId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "deploymentStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": false, + "default": "'running'" + }, + "logPath": { + "name": "logPath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "deployment_applicationId_application_applicationId_fk": { + "name": "deployment_applicationId_application_applicationId_fk", + "tableFrom": "deployment", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.mount": { + "name": "mount", + "schema": "", + "columns": { + "mountId": { + "name": "mountId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "mountType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "hostPath": { + "name": "hostPath", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "volumeName": { + "name": "volumeName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serviceType": { + "name": "serviceType", + "type": "serviceType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'application'" + }, + "mountPath": { + "name": "mountPath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "redisId": { + "name": "redisId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "mount_applicationId_application_applicationId_fk": { + "name": "mount_applicationId_application_applicationId_fk", + "tableFrom": "mount", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_postgresId_postgres_postgresId_fk": { + "name": "mount_postgresId_postgres_postgresId_fk", + "tableFrom": "mount", + "tableTo": "postgres", + "columnsFrom": [ + "postgresId" + ], + "columnsTo": [ + "postgresId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mariadbId_mariadb_mariadbId_fk": { + "name": "mount_mariadbId_mariadb_mariadbId_fk", + "tableFrom": "mount", + "tableTo": "mariadb", + "columnsFrom": [ + "mariadbId" + ], + "columnsTo": [ + "mariadbId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mongoId_mongo_mongoId_fk": { + "name": "mount_mongoId_mongo_mongoId_fk", + "tableFrom": "mount", + "tableTo": "mongo", + "columnsFrom": [ + "mongoId" + ], + "columnsTo": [ + "mongoId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mysqlId_mysql_mysqlId_fk": { + "name": "mount_mysqlId_mysql_mysqlId_fk", + "tableFrom": "mount", + "tableTo": "mysql", + "columnsFrom": [ + "mysqlId" + ], + "columnsTo": [ + "mysqlId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_redisId_redis_redisId_fk": { + "name": "mount_redisId_redis_redisId_fk", + "tableFrom": "mount", + "tableTo": "redis", + "columnsFrom": [ + "redisId" + ], + "columnsTo": [ + "redisId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.certificate": { + "name": "certificate", + "schema": "", + "columns": { + "certificateId": { + "name": "certificateId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificateData": { + "name": "certificateData", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "privateKey": { + "name": "privateKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificatePath": { + "name": "certificatePath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "autoRenew": { + "name": "autoRenew", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "certificate_certificatePath_unique": { + "name": "certificate_certificatePath_unique", + "nullsNotDistinct": false, + "columns": [ + "certificatePath" + ] + } + } + }, + "public.session": { + "name": "session", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "session_user_id_auth_id_fk": { + "name": "session_user_id_auth_id_fk", + "tableFrom": "session", + "tableTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.redirect": { + "name": "redirect", + "schema": "", + "columns": { + "redirectId": { + "name": "redirectId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "regex": { + "name": "regex", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "replacement": { + "name": "replacement", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "permanent": { + "name": "permanent", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "uniqueConfigKey": { + "name": "uniqueConfigKey", + "type": "serial", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "redirect_applicationId_application_applicationId_fk": { + "name": "redirect_applicationId_application_applicationId_fk", + "tableFrom": "redirect", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.security": { + "name": "security", + "schema": "", + "columns": { + "securityId": { + "name": "securityId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "security_applicationId_application_applicationId_fk": { + "name": "security_applicationId_application_applicationId_fk", + "tableFrom": "security", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "security_username_applicationId_unique": { + "name": "security_username_applicationId_unique", + "nullsNotDistinct": false, + "columns": [ + "username", + "applicationId" + ] + } + } + }, + "public.port": { + "name": "port", + "schema": "", + "columns": { + "portId": { + "name": "portId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "publishedPort": { + "name": "publishedPort", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "targetPort": { + "name": "targetPort", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "protocol": { + "name": "protocol", + "type": "protocolType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "port_applicationId_application_applicationId_fk": { + "name": "port_applicationId_application_applicationId_fk", + "tableFrom": "port", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.redis": { + "name": "redis", + "schema": "", + "columns": { + "redisId": { + "name": "redisId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "redis_projectId_project_projectId_fk": { + "name": "redis_projectId_project_projectId_fk", + "tableFrom": "redis", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "redis_appName_unique": { + "name": "redis_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.registry": { + "name": "registry", + "schema": "", + "columns": { + "registryId": { + "name": "registryId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "registryName": { + "name": "registryName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "registryUrl": { + "name": "registryUrl", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "selfHosted": { + "name": "selfHosted", + "type": "RegistryType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'cloud'" + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "registry_adminId_admin_adminId_fk": { + "name": "registry_adminId_admin_adminId_fk", + "tableFrom": "registry", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + } + }, + "enums": { + "public.buildType": { + "name": "buildType", + "schema": "public", + "values": [ + "dockerfile", + "heroku_buildpacks", + "paketo_buildpacks", + "nixpacks" + ] + }, + "public.sourceType": { + "name": "sourceType", + "schema": "public", + "values": [ + "docker", + "git", + "github" + ] + }, + "public.Roles": { + "name": "Roles", + "schema": "public", + "values": [ + "admin", + "user" + ] + }, + "public.databaseType": { + "name": "databaseType", + "schema": "public", + "values": [ + "postgres", + "mariadb", + "mysql", + "mongo" + ] + }, + "public.deploymentStatus": { + "name": "deploymentStatus", + "schema": "public", + "values": [ + "running", + "done", + "error" + ] + }, + "public.mountType": { + "name": "mountType", + "schema": "public", + "values": [ + "bind", + "volume", + "file" + ] + }, + "public.serviceType": { + "name": "serviceType", + "schema": "public", + "values": [ + "application", + "postgres", + "mysql", + "mariadb", + "mongo", + "redis" + ] + }, + "public.protocolType": { + "name": "protocolType", + "schema": "public", + "values": [ + "tcp", + "udp" + ] + }, + "public.applicationStatus": { + "name": "applicationStatus", + "schema": "public", + "values": [ + "idle", + "running", + "done", + "error" + ] + }, + "public.certificateType": { + "name": "certificateType", + "schema": "public", + "values": [ + "letsencrypt", + "none" + ] + }, + "public.RegistryType": { + "name": "RegistryType", + "schema": "public", + "values": [ + "selfHosted", + "cloud" + ] + } + }, + "schemas": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/drizzle/meta/0008_snapshot.json b/drizzle/meta/0008_snapshot.json new file mode 100644 index 000000000..c09360d28 --- /dev/null +++ b/drizzle/meta/0008_snapshot.json @@ -0,0 +1,2338 @@ +{ + "id": "54b3cce8-c1ab-46ed-bef9-1bb945d965f9", + "prevId": "80176730-273b-45e4-a7ca-760e29ad6d02", + "version": "6", + "dialect": "postgresql", + "tables": { + "public.application": { + "name": "application", + "schema": "", + "columns": { + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "subtitle": { + "name": "subtitle", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refreshToken": { + "name": "refreshToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sourceType": { + "name": "sourceType", + "type": "sourceType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'github'" + }, + "repository": { + "name": "repository", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "owner": { + "name": "owner", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "branch": { + "name": "branch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "buildPath": { + "name": "buildPath", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "autoDeploy": { + "name": "autoDeploy", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitUrl": { + "name": "customGitUrl", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitBranch": { + "name": "customGitBranch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitBuildPath": { + "name": "customGitBuildPath", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitSSHKey": { + "name": "customGitSSHKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerfile": { + "name": "dockerfile", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "replicas": { + "name": "replicas", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 1 + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "buildType": { + "name": "buildType", + "type": "buildType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'nixpacks'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "registryId": { + "name": "registryId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "application_registryId_registry_registryId_fk": { + "name": "application_registryId_registry_registryId_fk", + "tableFrom": "application", + "tableTo": "registry", + "columnsFrom": [ + "registryId" + ], + "columnsTo": [ + "registryId" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "application_projectId_project_projectId_fk": { + "name": "application_projectId_project_projectId_fk", + "tableFrom": "application", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "application_appName_unique": { + "name": "application_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.postgres": { + "name": "postgres", + "schema": "", + "columns": { + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "postgres_projectId_project_projectId_fk": { + "name": "postgres_projectId_project_projectId_fk", + "tableFrom": "postgres", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "postgres_appName_unique": { + "name": "postgres_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "userId": { + "name": "userId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "isRegistered": { + "name": "isRegistered", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "expirationDate": { + "name": "expirationDate", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "canCreateProjects": { + "name": "canCreateProjects", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canCreateServices": { + "name": "canCreateServices", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canDeleteProjects": { + "name": "canDeleteProjects", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canDeleteServices": { + "name": "canDeleteServices", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canAccessToDocker": { + "name": "canAccessToDocker", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canAccessToTraefikFiles": { + "name": "canAccessToTraefikFiles", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "accesedProjects": { + "name": "accesedProjects", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::text[]" + }, + "accesedServices": { + "name": "accesedServices", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::text[]" + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "authId": { + "name": "authId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "user_adminId_admin_adminId_fk": { + "name": "user_adminId_admin_adminId_fk", + "tableFrom": "user", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "user_authId_auth_id_fk": { + "name": "user_authId_auth_id_fk", + "tableFrom": "user", + "tableTo": "auth", + "columnsFrom": [ + "authId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.admin": { + "name": "admin", + "schema": "", + "columns": { + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "githubAppId": { + "name": "githubAppId", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "githubAppName": { + "name": "githubAppName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serverIp": { + "name": "serverIp", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "certificateType": { + "name": "certificateType", + "type": "certificateType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "host": { + "name": "host", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubClientId": { + "name": "githubClientId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubClientSecret": { + "name": "githubClientSecret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubInstallationId": { + "name": "githubInstallationId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubPrivateKey": { + "name": "githubPrivateKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "letsEncryptEmail": { + "name": "letsEncryptEmail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sshPrivateKey": { + "name": "sshPrivateKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enableDockerCleanup": { + "name": "enableDockerCleanup", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "authId": { + "name": "authId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "admin_authId_auth_id_fk": { + "name": "admin_authId_auth_id_fk", + "tableFrom": "admin", + "tableTo": "auth", + "columnsFrom": [ + "authId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.auth": { + "name": "auth", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rol": { + "name": "rol", + "type": "Roles", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secret": { + "name": "secret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is2FAEnabled": { + "name": "is2FAEnabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "auth_email_unique": { + "name": "auth_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + } + }, + "public.project": { + "name": "project", + "schema": "", + "columns": { + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "project_adminId_admin_adminId_fk": { + "name": "project_adminId_admin_adminId_fk", + "tableFrom": "project", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.domain": { + "name": "domain", + "schema": "", + "columns": { + "domainId": { + "name": "domainId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "host": { + "name": "host", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "https": { + "name": "https", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "port": { + "name": "port", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 80 + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "uniqueConfigKey": { + "name": "uniqueConfigKey", + "type": "serial", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificateType": { + "name": "certificateType", + "type": "certificateType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + } + }, + "indexes": {}, + "foreignKeys": { + "domain_applicationId_application_applicationId_fk": { + "name": "domain_applicationId_application_applicationId_fk", + "tableFrom": "domain", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.mariadb": { + "name": "mariadb", + "schema": "", + "columns": { + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rootPassword": { + "name": "rootPassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mariadb_projectId_project_projectId_fk": { + "name": "mariadb_projectId_project_projectId_fk", + "tableFrom": "mariadb", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mariadb_appName_unique": { + "name": "mariadb_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.mongo": { + "name": "mongo", + "schema": "", + "columns": { + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mongo_projectId_project_projectId_fk": { + "name": "mongo_projectId_project_projectId_fk", + "tableFrom": "mongo", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mongo_appName_unique": { + "name": "mongo_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.mysql": { + "name": "mysql", + "schema": "", + "columns": { + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rootPassword": { + "name": "rootPassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mysql_projectId_project_projectId_fk": { + "name": "mysql_projectId_project_projectId_fk", + "tableFrom": "mysql", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mysql_appName_unique": { + "name": "mysql_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.backup": { + "name": "backup", + "schema": "", + "columns": { + "backupId": { + "name": "backupId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "schedule": { + "name": "schedule", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "database": { + "name": "database", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prefix": { + "name": "prefix", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "destinationId": { + "name": "destinationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseType": { + "name": "databaseType", + "type": "databaseType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "backup_destinationId_destination_destinationId_fk": { + "name": "backup_destinationId_destination_destinationId_fk", + "tableFrom": "backup", + "tableTo": "destination", + "columnsFrom": [ + "destinationId" + ], + "columnsTo": [ + "destinationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_postgresId_postgres_postgresId_fk": { + "name": "backup_postgresId_postgres_postgresId_fk", + "tableFrom": "backup", + "tableTo": "postgres", + "columnsFrom": [ + "postgresId" + ], + "columnsTo": [ + "postgresId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mariadbId_mariadb_mariadbId_fk": { + "name": "backup_mariadbId_mariadb_mariadbId_fk", + "tableFrom": "backup", + "tableTo": "mariadb", + "columnsFrom": [ + "mariadbId" + ], + "columnsTo": [ + "mariadbId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mysqlId_mysql_mysqlId_fk": { + "name": "backup_mysqlId_mysql_mysqlId_fk", + "tableFrom": "backup", + "tableTo": "mysql", + "columnsFrom": [ + "mysqlId" + ], + "columnsTo": [ + "mysqlId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mongoId_mongo_mongoId_fk": { + "name": "backup_mongoId_mongo_mongoId_fk", + "tableFrom": "backup", + "tableTo": "mongo", + "columnsFrom": [ + "mongoId" + ], + "columnsTo": [ + "mongoId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.destination": { + "name": "destination", + "schema": "", + "columns": { + "destinationId": { + "name": "destinationId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "accessKey": { + "name": "accessKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "secretAccessKey": { + "name": "secretAccessKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "bucket": { + "name": "bucket", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "region": { + "name": "region", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "destination_adminId_admin_adminId_fk": { + "name": "destination_adminId_admin_adminId_fk", + "tableFrom": "destination", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.deployment": { + "name": "deployment", + "schema": "", + "columns": { + "deploymentId": { + "name": "deploymentId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "deploymentStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": false, + "default": "'running'" + }, + "logPath": { + "name": "logPath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "deployment_applicationId_application_applicationId_fk": { + "name": "deployment_applicationId_application_applicationId_fk", + "tableFrom": "deployment", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.mount": { + "name": "mount", + "schema": "", + "columns": { + "mountId": { + "name": "mountId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "mountType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "hostPath": { + "name": "hostPath", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "volumeName": { + "name": "volumeName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serviceType": { + "name": "serviceType", + "type": "serviceType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'application'" + }, + "mountPath": { + "name": "mountPath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "redisId": { + "name": "redisId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "mount_applicationId_application_applicationId_fk": { + "name": "mount_applicationId_application_applicationId_fk", + "tableFrom": "mount", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_postgresId_postgres_postgresId_fk": { + "name": "mount_postgresId_postgres_postgresId_fk", + "tableFrom": "mount", + "tableTo": "postgres", + "columnsFrom": [ + "postgresId" + ], + "columnsTo": [ + "postgresId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mariadbId_mariadb_mariadbId_fk": { + "name": "mount_mariadbId_mariadb_mariadbId_fk", + "tableFrom": "mount", + "tableTo": "mariadb", + "columnsFrom": [ + "mariadbId" + ], + "columnsTo": [ + "mariadbId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mongoId_mongo_mongoId_fk": { + "name": "mount_mongoId_mongo_mongoId_fk", + "tableFrom": "mount", + "tableTo": "mongo", + "columnsFrom": [ + "mongoId" + ], + "columnsTo": [ + "mongoId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mysqlId_mysql_mysqlId_fk": { + "name": "mount_mysqlId_mysql_mysqlId_fk", + "tableFrom": "mount", + "tableTo": "mysql", + "columnsFrom": [ + "mysqlId" + ], + "columnsTo": [ + "mysqlId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_redisId_redis_redisId_fk": { + "name": "mount_redisId_redis_redisId_fk", + "tableFrom": "mount", + "tableTo": "redis", + "columnsFrom": [ + "redisId" + ], + "columnsTo": [ + "redisId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.certificate": { + "name": "certificate", + "schema": "", + "columns": { + "certificateId": { + "name": "certificateId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificateData": { + "name": "certificateData", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "privateKey": { + "name": "privateKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificatePath": { + "name": "certificatePath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "autoRenew": { + "name": "autoRenew", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "certificate_certificatePath_unique": { + "name": "certificate_certificatePath_unique", + "nullsNotDistinct": false, + "columns": [ + "certificatePath" + ] + } + } + }, + "public.session": { + "name": "session", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "session_user_id_auth_id_fk": { + "name": "session_user_id_auth_id_fk", + "tableFrom": "session", + "tableTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.redirect": { + "name": "redirect", + "schema": "", + "columns": { + "redirectId": { + "name": "redirectId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "regex": { + "name": "regex", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "replacement": { + "name": "replacement", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "permanent": { + "name": "permanent", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "uniqueConfigKey": { + "name": "uniqueConfigKey", + "type": "serial", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "redirect_applicationId_application_applicationId_fk": { + "name": "redirect_applicationId_application_applicationId_fk", + "tableFrom": "redirect", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.security": { + "name": "security", + "schema": "", + "columns": { + "securityId": { + "name": "securityId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "security_applicationId_application_applicationId_fk": { + "name": "security_applicationId_application_applicationId_fk", + "tableFrom": "security", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "security_username_applicationId_unique": { + "name": "security_username_applicationId_unique", + "nullsNotDistinct": false, + "columns": [ + "username", + "applicationId" + ] + } + } + }, + "public.port": { + "name": "port", + "schema": "", + "columns": { + "portId": { + "name": "portId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "publishedPort": { + "name": "publishedPort", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "targetPort": { + "name": "targetPort", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "protocol": { + "name": "protocol", + "type": "protocolType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "port_applicationId_application_applicationId_fk": { + "name": "port_applicationId_application_applicationId_fk", + "tableFrom": "port", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.redis": { + "name": "redis", + "schema": "", + "columns": { + "redisId": { + "name": "redisId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "redis_projectId_project_projectId_fk": { + "name": "redis_projectId_project_projectId_fk", + "tableFrom": "redis", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "redis_appName_unique": { + "name": "redis_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.registry": { + "name": "registry", + "schema": "", + "columns": { + "registryId": { + "name": "registryId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "registryName": { + "name": "registryName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "registryUrl": { + "name": "registryUrl", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "selfHosted": { + "name": "selfHosted", + "type": "RegistryType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'cloud'" + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "registry_adminId_admin_adminId_fk": { + "name": "registry_adminId_admin_adminId_fk", + "tableFrom": "registry", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + } + }, + "enums": { + "public.buildType": { + "name": "buildType", + "schema": "public", + "values": [ + "dockerfile", + "heroku_buildpacks", + "paketo_buildpacks", + "nixpacks" + ] + }, + "public.sourceType": { + "name": "sourceType", + "schema": "public", + "values": [ + "docker", + "git", + "github" + ] + }, + "public.Roles": { + "name": "Roles", + "schema": "public", + "values": [ + "admin", + "user" + ] + }, + "public.databaseType": { + "name": "databaseType", + "schema": "public", + "values": [ + "postgres", + "mariadb", + "mysql", + "mongo" + ] + }, + "public.deploymentStatus": { + "name": "deploymentStatus", + "schema": "public", + "values": [ + "running", + "done", + "error" + ] + }, + "public.mountType": { + "name": "mountType", + "schema": "public", + "values": [ + "bind", + "volume", + "file" + ] + }, + "public.serviceType": { + "name": "serviceType", + "schema": "public", + "values": [ + "application", + "postgres", + "mysql", + "mariadb", + "mongo", + "redis" + ] + }, + "public.protocolType": { + "name": "protocolType", + "schema": "public", + "values": [ + "tcp", + "udp" + ] + }, + "public.applicationStatus": { + "name": "applicationStatus", + "schema": "public", + "values": [ + "idle", + "running", + "done", + "error" + ] + }, + "public.certificateType": { + "name": "certificateType", + "schema": "public", + "values": [ + "letsencrypt", + "none" + ] + }, + "public.RegistryType": { + "name": "RegistryType", + "schema": "public", + "values": [ + "selfHosted", + "cloud" + ] + } + }, + "schemas": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/drizzle/meta/0009_snapshot.json b/drizzle/meta/0009_snapshot.json new file mode 100644 index 000000000..906bd91ae --- /dev/null +++ b/drizzle/meta/0009_snapshot.json @@ -0,0 +1,2338 @@ +{ + "id": "81eb82a8-2190-4dee-a6c8-416ea98e2547", + "prevId": "54b3cce8-c1ab-46ed-bef9-1bb945d965f9", + "version": "6", + "dialect": "postgresql", + "tables": { + "public.application": { + "name": "application", + "schema": "", + "columns": { + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "subtitle": { + "name": "subtitle", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refreshToken": { + "name": "refreshToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sourceType": { + "name": "sourceType", + "type": "sourceType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'github'" + }, + "repository": { + "name": "repository", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "owner": { + "name": "owner", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "branch": { + "name": "branch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "buildPath": { + "name": "buildPath", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "autoDeploy": { + "name": "autoDeploy", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitUrl": { + "name": "customGitUrl", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitBranch": { + "name": "customGitBranch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitBuildPath": { + "name": "customGitBuildPath", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitSSHKey": { + "name": "customGitSSHKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerfile": { + "name": "dockerfile", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "replicas": { + "name": "replicas", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "buildType": { + "name": "buildType", + "type": "buildType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'nixpacks'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "registryId": { + "name": "registryId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "application_registryId_registry_registryId_fk": { + "name": "application_registryId_registry_registryId_fk", + "tableFrom": "application", + "tableTo": "registry", + "columnsFrom": [ + "registryId" + ], + "columnsTo": [ + "registryId" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "application_projectId_project_projectId_fk": { + "name": "application_projectId_project_projectId_fk", + "tableFrom": "application", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "application_appName_unique": { + "name": "application_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.postgres": { + "name": "postgres", + "schema": "", + "columns": { + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "postgres_projectId_project_projectId_fk": { + "name": "postgres_projectId_project_projectId_fk", + "tableFrom": "postgres", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "postgres_appName_unique": { + "name": "postgres_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "userId": { + "name": "userId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "isRegistered": { + "name": "isRegistered", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "expirationDate": { + "name": "expirationDate", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "canCreateProjects": { + "name": "canCreateProjects", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canCreateServices": { + "name": "canCreateServices", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canDeleteProjects": { + "name": "canDeleteProjects", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canDeleteServices": { + "name": "canDeleteServices", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canAccessToDocker": { + "name": "canAccessToDocker", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canAccessToTraefikFiles": { + "name": "canAccessToTraefikFiles", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "accesedProjects": { + "name": "accesedProjects", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::text[]" + }, + "accesedServices": { + "name": "accesedServices", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::text[]" + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "authId": { + "name": "authId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "user_adminId_admin_adminId_fk": { + "name": "user_adminId_admin_adminId_fk", + "tableFrom": "user", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "user_authId_auth_id_fk": { + "name": "user_authId_auth_id_fk", + "tableFrom": "user", + "tableTo": "auth", + "columnsFrom": [ + "authId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.admin": { + "name": "admin", + "schema": "", + "columns": { + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "githubAppId": { + "name": "githubAppId", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "githubAppName": { + "name": "githubAppName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serverIp": { + "name": "serverIp", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "certificateType": { + "name": "certificateType", + "type": "certificateType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "host": { + "name": "host", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubClientId": { + "name": "githubClientId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubClientSecret": { + "name": "githubClientSecret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubInstallationId": { + "name": "githubInstallationId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubPrivateKey": { + "name": "githubPrivateKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "letsEncryptEmail": { + "name": "letsEncryptEmail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sshPrivateKey": { + "name": "sshPrivateKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enableDockerCleanup": { + "name": "enableDockerCleanup", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "authId": { + "name": "authId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "admin_authId_auth_id_fk": { + "name": "admin_authId_auth_id_fk", + "tableFrom": "admin", + "tableTo": "auth", + "columnsFrom": [ + "authId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.auth": { + "name": "auth", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rol": { + "name": "rol", + "type": "Roles", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secret": { + "name": "secret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is2FAEnabled": { + "name": "is2FAEnabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "auth_email_unique": { + "name": "auth_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + } + }, + "public.project": { + "name": "project", + "schema": "", + "columns": { + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "project_adminId_admin_adminId_fk": { + "name": "project_adminId_admin_adminId_fk", + "tableFrom": "project", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.domain": { + "name": "domain", + "schema": "", + "columns": { + "domainId": { + "name": "domainId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "host": { + "name": "host", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "https": { + "name": "https", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "port": { + "name": "port", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 80 + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "uniqueConfigKey": { + "name": "uniqueConfigKey", + "type": "serial", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificateType": { + "name": "certificateType", + "type": "certificateType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + } + }, + "indexes": {}, + "foreignKeys": { + "domain_applicationId_application_applicationId_fk": { + "name": "domain_applicationId_application_applicationId_fk", + "tableFrom": "domain", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.mariadb": { + "name": "mariadb", + "schema": "", + "columns": { + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rootPassword": { + "name": "rootPassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mariadb_projectId_project_projectId_fk": { + "name": "mariadb_projectId_project_projectId_fk", + "tableFrom": "mariadb", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mariadb_appName_unique": { + "name": "mariadb_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.mongo": { + "name": "mongo", + "schema": "", + "columns": { + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mongo_projectId_project_projectId_fk": { + "name": "mongo_projectId_project_projectId_fk", + "tableFrom": "mongo", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mongo_appName_unique": { + "name": "mongo_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.mysql": { + "name": "mysql", + "schema": "", + "columns": { + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rootPassword": { + "name": "rootPassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mysql_projectId_project_projectId_fk": { + "name": "mysql_projectId_project_projectId_fk", + "tableFrom": "mysql", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mysql_appName_unique": { + "name": "mysql_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.backup": { + "name": "backup", + "schema": "", + "columns": { + "backupId": { + "name": "backupId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "schedule": { + "name": "schedule", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "database": { + "name": "database", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prefix": { + "name": "prefix", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "destinationId": { + "name": "destinationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseType": { + "name": "databaseType", + "type": "databaseType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "backup_destinationId_destination_destinationId_fk": { + "name": "backup_destinationId_destination_destinationId_fk", + "tableFrom": "backup", + "tableTo": "destination", + "columnsFrom": [ + "destinationId" + ], + "columnsTo": [ + "destinationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_postgresId_postgres_postgresId_fk": { + "name": "backup_postgresId_postgres_postgresId_fk", + "tableFrom": "backup", + "tableTo": "postgres", + "columnsFrom": [ + "postgresId" + ], + "columnsTo": [ + "postgresId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mariadbId_mariadb_mariadbId_fk": { + "name": "backup_mariadbId_mariadb_mariadbId_fk", + "tableFrom": "backup", + "tableTo": "mariadb", + "columnsFrom": [ + "mariadbId" + ], + "columnsTo": [ + "mariadbId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mysqlId_mysql_mysqlId_fk": { + "name": "backup_mysqlId_mysql_mysqlId_fk", + "tableFrom": "backup", + "tableTo": "mysql", + "columnsFrom": [ + "mysqlId" + ], + "columnsTo": [ + "mysqlId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mongoId_mongo_mongoId_fk": { + "name": "backup_mongoId_mongo_mongoId_fk", + "tableFrom": "backup", + "tableTo": "mongo", + "columnsFrom": [ + "mongoId" + ], + "columnsTo": [ + "mongoId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.destination": { + "name": "destination", + "schema": "", + "columns": { + "destinationId": { + "name": "destinationId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "accessKey": { + "name": "accessKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "secretAccessKey": { + "name": "secretAccessKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "bucket": { + "name": "bucket", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "region": { + "name": "region", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "destination_adminId_admin_adminId_fk": { + "name": "destination_adminId_admin_adminId_fk", + "tableFrom": "destination", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.deployment": { + "name": "deployment", + "schema": "", + "columns": { + "deploymentId": { + "name": "deploymentId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "deploymentStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": false, + "default": "'running'" + }, + "logPath": { + "name": "logPath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "deployment_applicationId_application_applicationId_fk": { + "name": "deployment_applicationId_application_applicationId_fk", + "tableFrom": "deployment", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.mount": { + "name": "mount", + "schema": "", + "columns": { + "mountId": { + "name": "mountId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "mountType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "hostPath": { + "name": "hostPath", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "volumeName": { + "name": "volumeName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serviceType": { + "name": "serviceType", + "type": "serviceType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'application'" + }, + "mountPath": { + "name": "mountPath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "redisId": { + "name": "redisId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "mount_applicationId_application_applicationId_fk": { + "name": "mount_applicationId_application_applicationId_fk", + "tableFrom": "mount", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_postgresId_postgres_postgresId_fk": { + "name": "mount_postgresId_postgres_postgresId_fk", + "tableFrom": "mount", + "tableTo": "postgres", + "columnsFrom": [ + "postgresId" + ], + "columnsTo": [ + "postgresId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mariadbId_mariadb_mariadbId_fk": { + "name": "mount_mariadbId_mariadb_mariadbId_fk", + "tableFrom": "mount", + "tableTo": "mariadb", + "columnsFrom": [ + "mariadbId" + ], + "columnsTo": [ + "mariadbId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mongoId_mongo_mongoId_fk": { + "name": "mount_mongoId_mongo_mongoId_fk", + "tableFrom": "mount", + "tableTo": "mongo", + "columnsFrom": [ + "mongoId" + ], + "columnsTo": [ + "mongoId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mysqlId_mysql_mysqlId_fk": { + "name": "mount_mysqlId_mysql_mysqlId_fk", + "tableFrom": "mount", + "tableTo": "mysql", + "columnsFrom": [ + "mysqlId" + ], + "columnsTo": [ + "mysqlId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_redisId_redis_redisId_fk": { + "name": "mount_redisId_redis_redisId_fk", + "tableFrom": "mount", + "tableTo": "redis", + "columnsFrom": [ + "redisId" + ], + "columnsTo": [ + "redisId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.certificate": { + "name": "certificate", + "schema": "", + "columns": { + "certificateId": { + "name": "certificateId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificateData": { + "name": "certificateData", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "privateKey": { + "name": "privateKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificatePath": { + "name": "certificatePath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "autoRenew": { + "name": "autoRenew", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "certificate_certificatePath_unique": { + "name": "certificate_certificatePath_unique", + "nullsNotDistinct": false, + "columns": [ + "certificatePath" + ] + } + } + }, + "public.session": { + "name": "session", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "session_user_id_auth_id_fk": { + "name": "session_user_id_auth_id_fk", + "tableFrom": "session", + "tableTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.redirect": { + "name": "redirect", + "schema": "", + "columns": { + "redirectId": { + "name": "redirectId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "regex": { + "name": "regex", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "replacement": { + "name": "replacement", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "permanent": { + "name": "permanent", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "uniqueConfigKey": { + "name": "uniqueConfigKey", + "type": "serial", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "redirect_applicationId_application_applicationId_fk": { + "name": "redirect_applicationId_application_applicationId_fk", + "tableFrom": "redirect", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.security": { + "name": "security", + "schema": "", + "columns": { + "securityId": { + "name": "securityId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "security_applicationId_application_applicationId_fk": { + "name": "security_applicationId_application_applicationId_fk", + "tableFrom": "security", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "security_username_applicationId_unique": { + "name": "security_username_applicationId_unique", + "nullsNotDistinct": false, + "columns": [ + "username", + "applicationId" + ] + } + } + }, + "public.port": { + "name": "port", + "schema": "", + "columns": { + "portId": { + "name": "portId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "publishedPort": { + "name": "publishedPort", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "targetPort": { + "name": "targetPort", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "protocol": { + "name": "protocol", + "type": "protocolType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "port_applicationId_application_applicationId_fk": { + "name": "port_applicationId_application_applicationId_fk", + "tableFrom": "port", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.redis": { + "name": "redis", + "schema": "", + "columns": { + "redisId": { + "name": "redisId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "redis_projectId_project_projectId_fk": { + "name": "redis_projectId_project_projectId_fk", + "tableFrom": "redis", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "redis_appName_unique": { + "name": "redis_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.registry": { + "name": "registry", + "schema": "", + "columns": { + "registryId": { + "name": "registryId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "registryName": { + "name": "registryName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "registryUrl": { + "name": "registryUrl", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "selfHosted": { + "name": "selfHosted", + "type": "RegistryType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'cloud'" + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "registry_adminId_admin_adminId_fk": { + "name": "registry_adminId_admin_adminId_fk", + "tableFrom": "registry", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + } + }, + "enums": { + "public.buildType": { + "name": "buildType", + "schema": "public", + "values": [ + "dockerfile", + "heroku_buildpacks", + "paketo_buildpacks", + "nixpacks" + ] + }, + "public.sourceType": { + "name": "sourceType", + "schema": "public", + "values": [ + "docker", + "git", + "github" + ] + }, + "public.Roles": { + "name": "Roles", + "schema": "public", + "values": [ + "admin", + "user" + ] + }, + "public.databaseType": { + "name": "databaseType", + "schema": "public", + "values": [ + "postgres", + "mariadb", + "mysql", + "mongo" + ] + }, + "public.deploymentStatus": { + "name": "deploymentStatus", + "schema": "public", + "values": [ + "running", + "done", + "error" + ] + }, + "public.mountType": { + "name": "mountType", + "schema": "public", + "values": [ + "bind", + "volume", + "file" + ] + }, + "public.serviceType": { + "name": "serviceType", + "schema": "public", + "values": [ + "application", + "postgres", + "mysql", + "mariadb", + "mongo", + "redis" + ] + }, + "public.protocolType": { + "name": "protocolType", + "schema": "public", + "values": [ + "tcp", + "udp" + ] + }, + "public.applicationStatus": { + "name": "applicationStatus", + "schema": "public", + "values": [ + "idle", + "running", + "done", + "error" + ] + }, + "public.certificateType": { + "name": "certificateType", + "schema": "public", + "values": [ + "letsencrypt", + "none" + ] + }, + "public.RegistryType": { + "name": "RegistryType", + "schema": "public", + "values": [ + "selfHosted", + "cloud" + ] + } + }, + "schemas": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/drizzle/meta/0010_snapshot.json b/drizzle/meta/0010_snapshot.json new file mode 100644 index 000000000..30db79130 --- /dev/null +++ b/drizzle/meta/0010_snapshot.json @@ -0,0 +1,2344 @@ +{ + "id": "c4f34dc8-69d6-49f3-809d-be474f0f0fcf", + "prevId": "81eb82a8-2190-4dee-a6c8-416ea98e2547", + "version": "6", + "dialect": "postgresql", + "tables": { + "public.application": { + "name": "application", + "schema": "", + "columns": { + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "subtitle": { + "name": "subtitle", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refreshToken": { + "name": "refreshToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sourceType": { + "name": "sourceType", + "type": "sourceType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'github'" + }, + "repository": { + "name": "repository", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "owner": { + "name": "owner", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "branch": { + "name": "branch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "buildPath": { + "name": "buildPath", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "autoDeploy": { + "name": "autoDeploy", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitUrl": { + "name": "customGitUrl", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitBranch": { + "name": "customGitBranch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitBuildPath": { + "name": "customGitBuildPath", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitSSHKey": { + "name": "customGitSSHKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerfile": { + "name": "dockerfile", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "replicas": { + "name": "replicas", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "buildType": { + "name": "buildType", + "type": "buildType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'nixpacks'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "registryId": { + "name": "registryId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "application_registryId_registry_registryId_fk": { + "name": "application_registryId_registry_registryId_fk", + "tableFrom": "application", + "tableTo": "registry", + "columnsFrom": [ + "registryId" + ], + "columnsTo": [ + "registryId" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "application_projectId_project_projectId_fk": { + "name": "application_projectId_project_projectId_fk", + "tableFrom": "application", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "application_appName_unique": { + "name": "application_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.postgres": { + "name": "postgres", + "schema": "", + "columns": { + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "postgres_projectId_project_projectId_fk": { + "name": "postgres_projectId_project_projectId_fk", + "tableFrom": "postgres", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "postgres_appName_unique": { + "name": "postgres_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "userId": { + "name": "userId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "isRegistered": { + "name": "isRegistered", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "expirationDate": { + "name": "expirationDate", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "canCreateProjects": { + "name": "canCreateProjects", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canCreateServices": { + "name": "canCreateServices", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canDeleteProjects": { + "name": "canDeleteProjects", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canDeleteServices": { + "name": "canDeleteServices", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canAccessToDocker": { + "name": "canAccessToDocker", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canAccessToTraefikFiles": { + "name": "canAccessToTraefikFiles", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "accesedProjects": { + "name": "accesedProjects", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::text[]" + }, + "accesedServices": { + "name": "accesedServices", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::text[]" + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "authId": { + "name": "authId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "user_adminId_admin_adminId_fk": { + "name": "user_adminId_admin_adminId_fk", + "tableFrom": "user", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "user_authId_auth_id_fk": { + "name": "user_authId_auth_id_fk", + "tableFrom": "user", + "tableTo": "auth", + "columnsFrom": [ + "authId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.admin": { + "name": "admin", + "schema": "", + "columns": { + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "githubAppId": { + "name": "githubAppId", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "githubAppName": { + "name": "githubAppName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serverIp": { + "name": "serverIp", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "certificateType": { + "name": "certificateType", + "type": "certificateType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "host": { + "name": "host", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubClientId": { + "name": "githubClientId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubClientSecret": { + "name": "githubClientSecret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubInstallationId": { + "name": "githubInstallationId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubPrivateKey": { + "name": "githubPrivateKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "letsEncryptEmail": { + "name": "letsEncryptEmail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sshPrivateKey": { + "name": "sshPrivateKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enableDockerCleanup": { + "name": "enableDockerCleanup", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "authId": { + "name": "authId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "admin_authId_auth_id_fk": { + "name": "admin_authId_auth_id_fk", + "tableFrom": "admin", + "tableTo": "auth", + "columnsFrom": [ + "authId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.auth": { + "name": "auth", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rol": { + "name": "rol", + "type": "Roles", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secret": { + "name": "secret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is2FAEnabled": { + "name": "is2FAEnabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "auth_email_unique": { + "name": "auth_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + } + }, + "public.project": { + "name": "project", + "schema": "", + "columns": { + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "project_adminId_admin_adminId_fk": { + "name": "project_adminId_admin_adminId_fk", + "tableFrom": "project", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.domain": { + "name": "domain", + "schema": "", + "columns": { + "domainId": { + "name": "domainId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "host": { + "name": "host", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "https": { + "name": "https", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "port": { + "name": "port", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 80 + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "uniqueConfigKey": { + "name": "uniqueConfigKey", + "type": "serial", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificateType": { + "name": "certificateType", + "type": "certificateType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + } + }, + "indexes": {}, + "foreignKeys": { + "domain_applicationId_application_applicationId_fk": { + "name": "domain_applicationId_application_applicationId_fk", + "tableFrom": "domain", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.mariadb": { + "name": "mariadb", + "schema": "", + "columns": { + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rootPassword": { + "name": "rootPassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mariadb_projectId_project_projectId_fk": { + "name": "mariadb_projectId_project_projectId_fk", + "tableFrom": "mariadb", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mariadb_appName_unique": { + "name": "mariadb_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.mongo": { + "name": "mongo", + "schema": "", + "columns": { + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mongo_projectId_project_projectId_fk": { + "name": "mongo_projectId_project_projectId_fk", + "tableFrom": "mongo", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mongo_appName_unique": { + "name": "mongo_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.mysql": { + "name": "mysql", + "schema": "", + "columns": { + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rootPassword": { + "name": "rootPassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mysql_projectId_project_projectId_fk": { + "name": "mysql_projectId_project_projectId_fk", + "tableFrom": "mysql", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mysql_appName_unique": { + "name": "mysql_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.backup": { + "name": "backup", + "schema": "", + "columns": { + "backupId": { + "name": "backupId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "schedule": { + "name": "schedule", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "database": { + "name": "database", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prefix": { + "name": "prefix", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "destinationId": { + "name": "destinationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseType": { + "name": "databaseType", + "type": "databaseType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "backup_destinationId_destination_destinationId_fk": { + "name": "backup_destinationId_destination_destinationId_fk", + "tableFrom": "backup", + "tableTo": "destination", + "columnsFrom": [ + "destinationId" + ], + "columnsTo": [ + "destinationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_postgresId_postgres_postgresId_fk": { + "name": "backup_postgresId_postgres_postgresId_fk", + "tableFrom": "backup", + "tableTo": "postgres", + "columnsFrom": [ + "postgresId" + ], + "columnsTo": [ + "postgresId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mariadbId_mariadb_mariadbId_fk": { + "name": "backup_mariadbId_mariadb_mariadbId_fk", + "tableFrom": "backup", + "tableTo": "mariadb", + "columnsFrom": [ + "mariadbId" + ], + "columnsTo": [ + "mariadbId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mysqlId_mysql_mysqlId_fk": { + "name": "backup_mysqlId_mysql_mysqlId_fk", + "tableFrom": "backup", + "tableTo": "mysql", + "columnsFrom": [ + "mysqlId" + ], + "columnsTo": [ + "mysqlId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mongoId_mongo_mongoId_fk": { + "name": "backup_mongoId_mongo_mongoId_fk", + "tableFrom": "backup", + "tableTo": "mongo", + "columnsFrom": [ + "mongoId" + ], + "columnsTo": [ + "mongoId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.destination": { + "name": "destination", + "schema": "", + "columns": { + "destinationId": { + "name": "destinationId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "accessKey": { + "name": "accessKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "secretAccessKey": { + "name": "secretAccessKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "bucket": { + "name": "bucket", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "region": { + "name": "region", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "destination_adminId_admin_adminId_fk": { + "name": "destination_adminId_admin_adminId_fk", + "tableFrom": "destination", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.deployment": { + "name": "deployment", + "schema": "", + "columns": { + "deploymentId": { + "name": "deploymentId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "deploymentStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": false, + "default": "'running'" + }, + "logPath": { + "name": "logPath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "deployment_applicationId_application_applicationId_fk": { + "name": "deployment_applicationId_application_applicationId_fk", + "tableFrom": "deployment", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.mount": { + "name": "mount", + "schema": "", + "columns": { + "mountId": { + "name": "mountId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "mountType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "hostPath": { + "name": "hostPath", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "volumeName": { + "name": "volumeName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serviceType": { + "name": "serviceType", + "type": "serviceType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'application'" + }, + "mountPath": { + "name": "mountPath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "redisId": { + "name": "redisId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "mount_applicationId_application_applicationId_fk": { + "name": "mount_applicationId_application_applicationId_fk", + "tableFrom": "mount", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_postgresId_postgres_postgresId_fk": { + "name": "mount_postgresId_postgres_postgresId_fk", + "tableFrom": "mount", + "tableTo": "postgres", + "columnsFrom": [ + "postgresId" + ], + "columnsTo": [ + "postgresId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mariadbId_mariadb_mariadbId_fk": { + "name": "mount_mariadbId_mariadb_mariadbId_fk", + "tableFrom": "mount", + "tableTo": "mariadb", + "columnsFrom": [ + "mariadbId" + ], + "columnsTo": [ + "mariadbId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mongoId_mongo_mongoId_fk": { + "name": "mount_mongoId_mongo_mongoId_fk", + "tableFrom": "mount", + "tableTo": "mongo", + "columnsFrom": [ + "mongoId" + ], + "columnsTo": [ + "mongoId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mysqlId_mysql_mysqlId_fk": { + "name": "mount_mysqlId_mysql_mysqlId_fk", + "tableFrom": "mount", + "tableTo": "mysql", + "columnsFrom": [ + "mysqlId" + ], + "columnsTo": [ + "mysqlId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_redisId_redis_redisId_fk": { + "name": "mount_redisId_redis_redisId_fk", + "tableFrom": "mount", + "tableTo": "redis", + "columnsFrom": [ + "redisId" + ], + "columnsTo": [ + "redisId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.certificate": { + "name": "certificate", + "schema": "", + "columns": { + "certificateId": { + "name": "certificateId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificateData": { + "name": "certificateData", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "privateKey": { + "name": "privateKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificatePath": { + "name": "certificatePath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "autoRenew": { + "name": "autoRenew", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "certificate_certificatePath_unique": { + "name": "certificate_certificatePath_unique", + "nullsNotDistinct": false, + "columns": [ + "certificatePath" + ] + } + } + }, + "public.session": { + "name": "session", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "session_user_id_auth_id_fk": { + "name": "session_user_id_auth_id_fk", + "tableFrom": "session", + "tableTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.redirect": { + "name": "redirect", + "schema": "", + "columns": { + "redirectId": { + "name": "redirectId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "regex": { + "name": "regex", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "replacement": { + "name": "replacement", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "permanent": { + "name": "permanent", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "uniqueConfigKey": { + "name": "uniqueConfigKey", + "type": "serial", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "redirect_applicationId_application_applicationId_fk": { + "name": "redirect_applicationId_application_applicationId_fk", + "tableFrom": "redirect", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.security": { + "name": "security", + "schema": "", + "columns": { + "securityId": { + "name": "securityId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "security_applicationId_application_applicationId_fk": { + "name": "security_applicationId_application_applicationId_fk", + "tableFrom": "security", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "security_username_applicationId_unique": { + "name": "security_username_applicationId_unique", + "nullsNotDistinct": false, + "columns": [ + "username", + "applicationId" + ] + } + } + }, + "public.port": { + "name": "port", + "schema": "", + "columns": { + "portId": { + "name": "portId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "publishedPort": { + "name": "publishedPort", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "targetPort": { + "name": "targetPort", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "protocol": { + "name": "protocol", + "type": "protocolType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "port_applicationId_application_applicationId_fk": { + "name": "port_applicationId_application_applicationId_fk", + "tableFrom": "port", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.redis": { + "name": "redis", + "schema": "", + "columns": { + "redisId": { + "name": "redisId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "redis_projectId_project_projectId_fk": { + "name": "redis_projectId_project_projectId_fk", + "tableFrom": "redis", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "redis_appName_unique": { + "name": "redis_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.registry": { + "name": "registry", + "schema": "", + "columns": { + "registryId": { + "name": "registryId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "registryName": { + "name": "registryName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "imagePrefix": { + "name": "imagePrefix", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "registryUrl": { + "name": "registryUrl", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "selfHosted": { + "name": "selfHosted", + "type": "RegistryType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'cloud'" + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "registry_adminId_admin_adminId_fk": { + "name": "registry_adminId_admin_adminId_fk", + "tableFrom": "registry", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + } + }, + "enums": { + "public.buildType": { + "name": "buildType", + "schema": "public", + "values": [ + "dockerfile", + "heroku_buildpacks", + "paketo_buildpacks", + "nixpacks" + ] + }, + "public.sourceType": { + "name": "sourceType", + "schema": "public", + "values": [ + "docker", + "git", + "github" + ] + }, + "public.Roles": { + "name": "Roles", + "schema": "public", + "values": [ + "admin", + "user" + ] + }, + "public.databaseType": { + "name": "databaseType", + "schema": "public", + "values": [ + "postgres", + "mariadb", + "mysql", + "mongo" + ] + }, + "public.deploymentStatus": { + "name": "deploymentStatus", + "schema": "public", + "values": [ + "running", + "done", + "error" + ] + }, + "public.mountType": { + "name": "mountType", + "schema": "public", + "values": [ + "bind", + "volume", + "file" + ] + }, + "public.serviceType": { + "name": "serviceType", + "schema": "public", + "values": [ + "application", + "postgres", + "mysql", + "mariadb", + "mongo", + "redis" + ] + }, + "public.protocolType": { + "name": "protocolType", + "schema": "public", + "values": [ + "tcp", + "udp" + ] + }, + "public.applicationStatus": { + "name": "applicationStatus", + "schema": "public", + "values": [ + "idle", + "running", + "done", + "error" + ] + }, + "public.certificateType": { + "name": "certificateType", + "schema": "public", + "values": [ + "letsencrypt", + "none" + ] + }, + "public.RegistryType": { + "name": "RegistryType", + "schema": "public", + "values": [ + "selfHosted", + "cloud" + ] + } + }, + "schemas": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/drizzle/meta/0011_snapshot.json b/drizzle/meta/0011_snapshot.json new file mode 100644 index 000000000..24dc37040 --- /dev/null +++ b/drizzle/meta/0011_snapshot.json @@ -0,0 +1,2344 @@ +{ + "id": "9c6bb052-9f90-46fd-9382-67984e03f5b1", + "prevId": "c4f34dc8-69d6-49f3-809d-be474f0f0fcf", + "version": "6", + "dialect": "postgresql", + "tables": { + "public.application": { + "name": "application", + "schema": "", + "columns": { + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "subtitle": { + "name": "subtitle", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refreshToken": { + "name": "refreshToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sourceType": { + "name": "sourceType", + "type": "sourceType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'github'" + }, + "repository": { + "name": "repository", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "owner": { + "name": "owner", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "branch": { + "name": "branch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "buildPath": { + "name": "buildPath", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "autoDeploy": { + "name": "autoDeploy", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitUrl": { + "name": "customGitUrl", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitBranch": { + "name": "customGitBranch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitBuildPath": { + "name": "customGitBuildPath", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customGitSSHKey": { + "name": "customGitSSHKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerfile": { + "name": "dockerfile", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "replicas": { + "name": "replicas", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "buildType": { + "name": "buildType", + "type": "buildType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'nixpacks'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "registryId": { + "name": "registryId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "application_registryId_registry_registryId_fk": { + "name": "application_registryId_registry_registryId_fk", + "tableFrom": "application", + "tableTo": "registry", + "columnsFrom": [ + "registryId" + ], + "columnsTo": [ + "registryId" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "application_projectId_project_projectId_fk": { + "name": "application_projectId_project_projectId_fk", + "tableFrom": "application", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "application_appName_unique": { + "name": "application_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.postgres": { + "name": "postgres", + "schema": "", + "columns": { + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "postgres_projectId_project_projectId_fk": { + "name": "postgres_projectId_project_projectId_fk", + "tableFrom": "postgres", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "postgres_appName_unique": { + "name": "postgres_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "userId": { + "name": "userId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "isRegistered": { + "name": "isRegistered", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "expirationDate": { + "name": "expirationDate", + "type": "timestamp(3)", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "canCreateProjects": { + "name": "canCreateProjects", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canCreateServices": { + "name": "canCreateServices", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canDeleteProjects": { + "name": "canDeleteProjects", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canDeleteServices": { + "name": "canDeleteServices", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canAccessToDocker": { + "name": "canAccessToDocker", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "canAccessToTraefikFiles": { + "name": "canAccessToTraefikFiles", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "accesedProjects": { + "name": "accesedProjects", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::text[]" + }, + "accesedServices": { + "name": "accesedServices", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "ARRAY[]::text[]" + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "authId": { + "name": "authId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "user_adminId_admin_adminId_fk": { + "name": "user_adminId_admin_adminId_fk", + "tableFrom": "user", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "user_authId_auth_id_fk": { + "name": "user_authId_auth_id_fk", + "tableFrom": "user", + "tableTo": "auth", + "columnsFrom": [ + "authId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.admin": { + "name": "admin", + "schema": "", + "columns": { + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "githubAppId": { + "name": "githubAppId", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "githubAppName": { + "name": "githubAppName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serverIp": { + "name": "serverIp", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "certificateType": { + "name": "certificateType", + "type": "certificateType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "host": { + "name": "host", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubClientId": { + "name": "githubClientId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubClientSecret": { + "name": "githubClientSecret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubInstallationId": { + "name": "githubInstallationId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "githubPrivateKey": { + "name": "githubPrivateKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "letsEncryptEmail": { + "name": "letsEncryptEmail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sshPrivateKey": { + "name": "sshPrivateKey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enableDockerCleanup": { + "name": "enableDockerCleanup", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "authId": { + "name": "authId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "admin_authId_auth_id_fk": { + "name": "admin_authId_auth_id_fk", + "tableFrom": "admin", + "tableTo": "auth", + "columnsFrom": [ + "authId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.auth": { + "name": "auth", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rol": { + "name": "rol", + "type": "Roles", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secret": { + "name": "secret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is2FAEnabled": { + "name": "is2FAEnabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "auth_email_unique": { + "name": "auth_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + } + }, + "public.project": { + "name": "project", + "schema": "", + "columns": { + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "project_adminId_admin_adminId_fk": { + "name": "project_adminId_admin_adminId_fk", + "tableFrom": "project", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.domain": { + "name": "domain", + "schema": "", + "columns": { + "domainId": { + "name": "domainId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "host": { + "name": "host", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "https": { + "name": "https", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "port": { + "name": "port", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 80 + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'/'" + }, + "uniqueConfigKey": { + "name": "uniqueConfigKey", + "type": "serial", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificateType": { + "name": "certificateType", + "type": "certificateType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + } + }, + "indexes": {}, + "foreignKeys": { + "domain_applicationId_application_applicationId_fk": { + "name": "domain_applicationId_application_applicationId_fk", + "tableFrom": "domain", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.mariadb": { + "name": "mariadb", + "schema": "", + "columns": { + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rootPassword": { + "name": "rootPassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mariadb_projectId_project_projectId_fk": { + "name": "mariadb_projectId_project_projectId_fk", + "tableFrom": "mariadb", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mariadb_appName_unique": { + "name": "mariadb_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.mongo": { + "name": "mongo", + "schema": "", + "columns": { + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mongo_projectId_project_projectId_fk": { + "name": "mongo_projectId_project_projectId_fk", + "tableFrom": "mongo", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mongo_appName_unique": { + "name": "mongo_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.mysql": { + "name": "mysql", + "schema": "", + "columns": { + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "databaseName": { + "name": "databaseName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseUser": { + "name": "databaseUser", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databasePassword": { + "name": "databasePassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rootPassword": { + "name": "rootPassword", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "mysql_projectId_project_projectId_fk": { + "name": "mysql_projectId_project_projectId_fk", + "tableFrom": "mysql", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mysql_appName_unique": { + "name": "mysql_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.backup": { + "name": "backup", + "schema": "", + "columns": { + "backupId": { + "name": "backupId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "schedule": { + "name": "schedule", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "database": { + "name": "database", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "prefix": { + "name": "prefix", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "destinationId": { + "name": "destinationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "databaseType": { + "name": "databaseType", + "type": "databaseType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "backup_destinationId_destination_destinationId_fk": { + "name": "backup_destinationId_destination_destinationId_fk", + "tableFrom": "backup", + "tableTo": "destination", + "columnsFrom": [ + "destinationId" + ], + "columnsTo": [ + "destinationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_postgresId_postgres_postgresId_fk": { + "name": "backup_postgresId_postgres_postgresId_fk", + "tableFrom": "backup", + "tableTo": "postgres", + "columnsFrom": [ + "postgresId" + ], + "columnsTo": [ + "postgresId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mariadbId_mariadb_mariadbId_fk": { + "name": "backup_mariadbId_mariadb_mariadbId_fk", + "tableFrom": "backup", + "tableTo": "mariadb", + "columnsFrom": [ + "mariadbId" + ], + "columnsTo": [ + "mariadbId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mysqlId_mysql_mysqlId_fk": { + "name": "backup_mysqlId_mysql_mysqlId_fk", + "tableFrom": "backup", + "tableTo": "mysql", + "columnsFrom": [ + "mysqlId" + ], + "columnsTo": [ + "mysqlId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "backup_mongoId_mongo_mongoId_fk": { + "name": "backup_mongoId_mongo_mongoId_fk", + "tableFrom": "backup", + "tableTo": "mongo", + "columnsFrom": [ + "mongoId" + ], + "columnsTo": [ + "mongoId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.destination": { + "name": "destination", + "schema": "", + "columns": { + "destinationId": { + "name": "destinationId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "accessKey": { + "name": "accessKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "secretAccessKey": { + "name": "secretAccessKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "bucket": { + "name": "bucket", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "region": { + "name": "region", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "endpoint": { + "name": "endpoint", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "destination_adminId_admin_adminId_fk": { + "name": "destination_adminId_admin_adminId_fk", + "tableFrom": "destination", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.deployment": { + "name": "deployment", + "schema": "", + "columns": { + "deploymentId": { + "name": "deploymentId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "deploymentStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": false, + "default": "'running'" + }, + "logPath": { + "name": "logPath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "deployment_applicationId_application_applicationId_fk": { + "name": "deployment_applicationId_application_applicationId_fk", + "tableFrom": "deployment", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.mount": { + "name": "mount", + "schema": "", + "columns": { + "mountId": { + "name": "mountId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "mountType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "hostPath": { + "name": "hostPath", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "volumeName": { + "name": "volumeName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "serviceType": { + "name": "serviceType", + "type": "serviceType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'application'" + }, + "mountPath": { + "name": "mountPath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postgresId": { + "name": "postgresId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mariadbId": { + "name": "mariadbId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mongoId": { + "name": "mongoId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mysqlId": { + "name": "mysqlId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "redisId": { + "name": "redisId", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "mount_applicationId_application_applicationId_fk": { + "name": "mount_applicationId_application_applicationId_fk", + "tableFrom": "mount", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_postgresId_postgres_postgresId_fk": { + "name": "mount_postgresId_postgres_postgresId_fk", + "tableFrom": "mount", + "tableTo": "postgres", + "columnsFrom": [ + "postgresId" + ], + "columnsTo": [ + "postgresId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mariadbId_mariadb_mariadbId_fk": { + "name": "mount_mariadbId_mariadb_mariadbId_fk", + "tableFrom": "mount", + "tableTo": "mariadb", + "columnsFrom": [ + "mariadbId" + ], + "columnsTo": [ + "mariadbId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mongoId_mongo_mongoId_fk": { + "name": "mount_mongoId_mongo_mongoId_fk", + "tableFrom": "mount", + "tableTo": "mongo", + "columnsFrom": [ + "mongoId" + ], + "columnsTo": [ + "mongoId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_mysqlId_mysql_mysqlId_fk": { + "name": "mount_mysqlId_mysql_mysqlId_fk", + "tableFrom": "mount", + "tableTo": "mysql", + "columnsFrom": [ + "mysqlId" + ], + "columnsTo": [ + "mysqlId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mount_redisId_redis_redisId_fk": { + "name": "mount_redisId_redis_redisId_fk", + "tableFrom": "mount", + "tableTo": "redis", + "columnsFrom": [ + "redisId" + ], + "columnsTo": [ + "redisId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.certificate": { + "name": "certificate", + "schema": "", + "columns": { + "certificateId": { + "name": "certificateId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificateData": { + "name": "certificateData", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "privateKey": { + "name": "privateKey", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "certificatePath": { + "name": "certificatePath", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "autoRenew": { + "name": "autoRenew", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "certificate_certificatePath_unique": { + "name": "certificate_certificatePath_unique", + "nullsNotDistinct": false, + "columns": [ + "certificatePath" + ] + } + } + }, + "public.session": { + "name": "session", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "session_user_id_auth_id_fk": { + "name": "session_user_id_auth_id_fk", + "tableFrom": "session", + "tableTo": "auth", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.redirect": { + "name": "redirect", + "schema": "", + "columns": { + "redirectId": { + "name": "redirectId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "regex": { + "name": "regex", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "replacement": { + "name": "replacement", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "permanent": { + "name": "permanent", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "uniqueConfigKey": { + "name": "uniqueConfigKey", + "type": "serial", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "redirect_applicationId_application_applicationId_fk": { + "name": "redirect_applicationId_application_applicationId_fk", + "tableFrom": "redirect", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.security": { + "name": "security", + "schema": "", + "columns": { + "securityId": { + "name": "securityId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "security_applicationId_application_applicationId_fk": { + "name": "security_applicationId_application_applicationId_fk", + "tableFrom": "security", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "security_username_applicationId_unique": { + "name": "security_username_applicationId_unique", + "nullsNotDistinct": false, + "columns": [ + "username", + "applicationId" + ] + } + } + }, + "public.port": { + "name": "port", + "schema": "", + "columns": { + "portId": { + "name": "portId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "publishedPort": { + "name": "publishedPort", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "targetPort": { + "name": "targetPort", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "protocol": { + "name": "protocol", + "type": "protocolType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "applicationId": { + "name": "applicationId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "port_applicationId_application_applicationId_fk": { + "name": "port_applicationId_application_applicationId_fk", + "tableFrom": "port", + "tableTo": "application", + "columnsFrom": [ + "applicationId" + ], + "columnsTo": [ + "applicationId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.redis": { + "name": "redis", + "schema": "", + "columns": { + "redisId": { + "name": "redisId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "appName": { + "name": "appName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dockerImage": { + "name": "dockerImage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "command": { + "name": "command", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "memoryReservation": { + "name": "memoryReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "memoryLimit": { + "name": "memoryLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuReservation": { + "name": "cpuReservation", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cpuLimit": { + "name": "cpuLimit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "externalPort": { + "name": "externalPort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationStatus": { + "name": "applicationStatus", + "type": "applicationStatus", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'idle'" + }, + "projectId": { + "name": "projectId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "redis_projectId_project_projectId_fk": { + "name": "redis_projectId_project_projectId_fk", + "tableFrom": "redis", + "tableTo": "project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "projectId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "redis_appName_unique": { + "name": "redis_appName_unique", + "nullsNotDistinct": false, + "columns": [ + "appName" + ] + } + } + }, + "public.registry": { + "name": "registry", + "schema": "", + "columns": { + "registryId": { + "name": "registryId", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "registryName": { + "name": "registryName", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "imagePrefix": { + "name": "imagePrefix", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "registryUrl": { + "name": "registryUrl", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "selfHosted": { + "name": "selfHosted", + "type": "RegistryType", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'cloud'" + }, + "adminId": { + "name": "adminId", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "registry_adminId_admin_adminId_fk": { + "name": "registry_adminId_admin_adminId_fk", + "tableFrom": "registry", + "tableTo": "admin", + "columnsFrom": [ + "adminId" + ], + "columnsTo": [ + "adminId" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + } + }, + "enums": { + "public.buildType": { + "name": "buildType", + "schema": "public", + "values": [ + "dockerfile", + "heroku_buildpacks", + "paketo_buildpacks", + "nixpacks" + ] + }, + "public.sourceType": { + "name": "sourceType", + "schema": "public", + "values": [ + "docker", + "git", + "github" + ] + }, + "public.Roles": { + "name": "Roles", + "schema": "public", + "values": [ + "admin", + "user" + ] + }, + "public.databaseType": { + "name": "databaseType", + "schema": "public", + "values": [ + "postgres", + "mariadb", + "mysql", + "mongo" + ] + }, + "public.deploymentStatus": { + "name": "deploymentStatus", + "schema": "public", + "values": [ + "running", + "done", + "error" + ] + }, + "public.mountType": { + "name": "mountType", + "schema": "public", + "values": [ + "bind", + "volume", + "file" + ] + }, + "public.serviceType": { + "name": "serviceType", + "schema": "public", + "values": [ + "application", + "postgres", + "mysql", + "mariadb", + "mongo", + "redis" + ] + }, + "public.protocolType": { + "name": "protocolType", + "schema": "public", + "values": [ + "tcp", + "udp" + ] + }, + "public.applicationStatus": { + "name": "applicationStatus", + "schema": "public", + "values": [ + "idle", + "running", + "done", + "error" + ] + }, + "public.certificateType": { + "name": "certificateType", + "schema": "public", + "values": [ + "letsencrypt", + "none" + ] + }, + "public.RegistryType": { + "name": "RegistryType", + "schema": "public", + "values": [ + "selfHosted", + "cloud" + ] + } + }, + "schemas": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json index ae4b256fe..4b2bbaf1f 100644 --- a/drizzle/meta/_journal.json +++ b/drizzle/meta/_journal.json @@ -36,6 +36,55 @@ "when": 1714004732716, "tag": "0004_nice_tenebrous", "breakpoints": true + }, + { + "idx": 5, + "version": "5", + "when": 1715551130605, + "tag": "0005_cute_terror", + "breakpoints": true + }, + { + "idx": 6, + "version": "6", + "when": 1715563165991, + "tag": "0006_oval_jimmy_woo", + "breakpoints": true + }, + { + "idx": 7, + "version": "6", + "when": 1715563497100, + "tag": "0007_cute_guardsmen", + "breakpoints": true + }, + { + "idx": 8, + "version": "6", + "when": 1715564143641, + "tag": "0008_lazy_sage", + "breakpoints": true + }, + { + "idx": 9, + "version": "6", + "when": 1715564774423, + "tag": "0009_majestic_spencer_smythe", + "breakpoints": true + }, + { + "idx": 10, + "version": "6", + "when": 1715574037832, + "tag": "0010_lean_black_widow", + "breakpoints": true + }, + { + "idx": 11, + "version": "6", + "when": 1715574230599, + "tag": "0011_petite_calypso", + "breakpoints": true } ] } \ No newline at end of file diff --git a/package.json b/package.json index bb7284270..babae882e 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,12 @@ "setup": "tsx -r dotenv/config setup.ts && sleep 5 && pnpm run migration:run", "reset-password": "node dist/reset-password.mjs", "dev": "tsx watch -r dotenv/config ./server/server.ts --project tsconfig.server.json ", - "migration:generate": "drizzle-kit generate:pg --config ./server/db/drizzle.config.ts", + "studio":"drizzle-kit studio --config ./server/db/drizzle.config.ts", + "migration:generate": "drizzle-kit generate --config ./server/db/drizzle.config.ts", "migration:run": "tsx -r dotenv/config migration.ts", + "migration:up":"drizzle-kit up --config ./server/db/drizzle.config.ts", "migration:drop": "drizzle-kit drop --config ./server/db/drizzle.config.ts", - "db:push": "drizzle-kit push:pg --config ./server/db/drizzle.config.ts", + "db:push": "drizzle-kit --config ./server/db/drizzle.config.ts", "db:truncate": "tsx -r dotenv/config ./server/db/reset.ts", "db:studio": "drizzle-kit studio", "lint": "biome lint", @@ -117,7 +119,7 @@ "@types/tar-fs": "2.0.4", "@types/ws": "8.5.10", "autoprefixer": "^10.4.14", - "drizzle-kit": "^0.20.14", + "drizzle-kit": "^0.21.1", "esbuild": "0.20.2", "localtunnel": "2.0.2", "postcss": "^8.4.31", diff --git a/pages/dashboard/project/[projectId]/services/application/[applicationId].tsx b/pages/dashboard/project/[projectId]/services/application/[applicationId].tsx index a26bec4a7..71f46eab7 100644 --- a/pages/dashboard/project/[projectId]/services/application/[applicationId].tsx +++ b/pages/dashboard/project/[projectId]/services/application/[applicationId].tsx @@ -1,3 +1,4 @@ +import { ShowClusterSettings } from "@/components/dashboard/application/advanced/cluster/show-cluster-settings"; import { AddCommand } from "@/components/dashboard/application/advanced/general/add-command"; import { ShowPorts } from "@/components/dashboard/application/advanced/ports/show-port"; import { ShowRedirects } from "@/components/dashboard/application/advanced/redirects/show-redirects"; @@ -175,6 +176,7 @@ const Service = (
+ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 61d1677b7..eb727c9a6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -266,8 +266,8 @@ devDependencies: specifier: ^10.4.14 version: 10.4.18(postcss@8.4.35) drizzle-kit: - specifier: ^0.20.14 - version: 0.20.14 + specifier: ^0.21.1 + version: 0.21.1 esbuild: specifier: 0.20.2 version: 0.20.2 @@ -1032,12 +1032,6 @@ packages: dev: true optional: true - /@drizzle-team/studio@0.0.39: - resolution: {integrity: sha512-c5Hkm7MmQC2n5qAsKShjQrHoqlfGslB8+qWzsGGZ+2dHMRTNG60UuzalF0h0rvBax5uzPXuGkYLGaQ+TUX3yMw==} - dependencies: - superjson: 2.2.1 - dev: true - /@emnapi/core@0.45.0: resolution: {integrity: sha512-DPWjcUDQkCeEM4VnljEOEcXdAD7pp8zSZsgOujk/LGIwCXWbXJngin+MO4zbH429lzeC3WbYLGjE2MaUOwzpyw==} requiresBuild: true @@ -4728,19 +4722,9 @@ packages: engines: {node: '>=6'} dev: false - /camelcase@7.0.1: - resolution: {integrity: sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==} - engines: {node: '>=14.16'} - dev: true - /caniuse-lite@1.0.30001598: resolution: {integrity: sha512-j8mQRDziG94uoBfeFuqsJUNECW37DXpnvhcMJMdlH2u3MRkq1sAI0LJcXP1i/Py0KbSIC4UDj8YHPrTn5YsL+Q==} - /chalk@5.3.0: - resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - dev: true - /chokidar@3.6.0: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} @@ -4877,6 +4861,7 @@ packages: engines: {node: '>=12.13'} dependencies: is-what: 4.1.16 + dev: false /copy-to-clipboard@3.3.3: resolution: {integrity: sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==} @@ -5143,14 +5128,11 @@ packages: wordwrap: 1.0.0 dev: true - /drizzle-kit@0.20.14: - resolution: {integrity: sha512-0fHv3YIEaUcSVPSGyaaBfOi9bmpajjhbJNdPsRMIUvYdLVxBu9eGjH8mRc3Qk7HVmEidFc/lhG1YyJhoXrn5yA==} + /drizzle-kit@0.21.1: + resolution: {integrity: sha512-Sp7OnCdROiE2ebMuHsAfrnRoHVGYCvErQxUh7/0l6R1caHssZu9oZu/hW9rLU19xnTK4/y3iSe3sL0Cc530wCg==} hasBin: true dependencies: - '@drizzle-team/studio': 0.0.39 '@esbuild-kit/esm-loader': 2.6.5 - camelcase: 7.0.1 - chalk: 5.3.0 commander: 9.5.0 env-paths: 3.0.0 esbuild: 0.19.12 @@ -5158,8 +5140,6 @@ packages: glob: 8.1.0 hanji: 0.0.5 json-diff: 0.9.0 - minimatch: 7.4.6 - semver: 7.6.0 zod: 3.23.4 transitivePeerDependencies: - supports-color @@ -5834,6 +5814,7 @@ packages: /is-what@4.1.16: resolution: {integrity: sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A==} engines: {node: '>=12.13'} + dev: false /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -6015,6 +5996,7 @@ packages: engines: {node: '>=10'} dependencies: yallist: 4.0.0 + dev: false /lru-queue@0.1.0: resolution: {integrity: sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==} @@ -6095,13 +6077,6 @@ packages: brace-expansion: 2.0.1 dev: true - /minimatch@7.4.6: - resolution: {integrity: sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==} - engines: {node: '>=10'} - dependencies: - brace-expansion: 2.0.1 - dev: true - /minimatch@9.0.3: resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} engines: {node: '>=16 || 14 >=14.17'} @@ -6909,6 +6884,7 @@ packages: hasBin: true dependencies: lru-cache: 6.0.0 + dev: false /set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} @@ -7073,6 +7049,7 @@ packages: engines: {node: '>=16'} dependencies: copy-anything: 3.0.5 + dev: false /supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} @@ -7456,6 +7433,7 @@ packages: /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + dev: false /yaml@2.4.1: resolution: {integrity: sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg==} diff --git a/server/api/root.ts b/server/api/root.ts index 6fb895a83..d9b02e20a 100644 --- a/server/api/root.ts +++ b/server/api/root.ts @@ -20,6 +20,7 @@ import { securityRouter } from "./routers/security"; import { portRouter } from "./routers/port"; import { adminRouter } from "./routers/admin"; import { dockerRouter } from "./routers/docker"; +import { registryRouter } from "./routers/registry"; /** * This is the primary router for your server. * @@ -47,6 +48,7 @@ export const appRouter = createTRPCRouter({ security: securityRouter, redirects: redirectsRouter, port: portRouter, + registry: registryRouter, }); // export type definition of API diff --git a/server/api/routers/registry.ts b/server/api/routers/registry.ts index 725861c5f..0fe097765 100644 --- a/server/api/routers/registry.ts +++ b/server/api/routers/registry.ts @@ -7,12 +7,16 @@ import { } from "@/server/db/schema"; import { createRegistry, + findAllRegistry, findRegistryById, removeRegistry, updaterRegistry, } from "../services/registry"; import { adminProcedure, createTRPCRouter, protectedProcedure } from "../trpc"; import { TRPCError } from "@trpc/server"; +import { manageRegistry } from "@/server/utils/traefik/registry"; +import { initializeRegistry } from "@/server/setup/registry-setup"; +import { docker } from "@/server/constants"; export const registryRouter = createTRPCRouter({ create: adminProcedure @@ -42,25 +46,41 @@ export const registryRouter = createTRPCRouter({ return true; }), + all: protectedProcedure.query(async () => { + return await findAllRegistry(); + }), findOne: adminProcedure.input(apiFindOneRegistry).query(async ({ input }) => { return await findRegistryById(input.registryId); }), + testRegistry: protectedProcedure + .input(apiCreateRegistry) + .mutation(async ({ input }) => { + try { + const result = await docker.checkAuth({ + username: input.username, + password: input.password, + serveraddress: input.registryUrl, + }); - enableSelfHostedRegistry: protectedProcedure + return true; + } catch (error) { + return false; + } + }), + + enableSelfHostedRegistry: adminProcedure .input(apiEnableSelfHostedRegistry) .mutation(async ({ input }) => { - // return await createRegistry({ - // username:"CUSTOM" - // adminId: input.adminId, - // }); - // const application = await findRegistryById(input.registryId); - // const result = await db - // .update(registry) - // .set({ - // selfHosted: true, - // }) - // .where(eq(registry.registryId, input.registryId)) - // .returning(); - // return result[0]; + const selfHostedRegistry = await createRegistry({ + ...input, + registryName: "Self Hosted Registry", + registryType: "selfHosted", + imagePrefix: null, + }); + + await manageRegistry(selfHostedRegistry); + await initializeRegistry(input.username, input.password); + + return selfHostedRegistry; }), }); diff --git a/server/api/services/application.ts b/server/api/services/application.ts index d5da79c40..a7e365334 100644 --- a/server/api/services/application.ts +++ b/server/api/services/application.ts @@ -61,6 +61,7 @@ export const findApplicationById = async (applicationId: string) => { redirects: true, security: true, ports: true, + registry: true, }, }); if (!application) { diff --git a/server/api/services/registry.ts b/server/api/services/registry.ts index ac8f2080a..149927d5f 100644 --- a/server/api/services/registry.ts +++ b/server/api/services/registry.ts @@ -2,14 +2,20 @@ import { type apiCreateRegistry, registry } from "@/server/db/schema"; import { TRPCError } from "@trpc/server"; import { db } from "@/server/db"; import { eq } from "drizzle-orm"; +import { findAdmin } from "./admin"; +import { removeSelfHostedRegistry } from "@/server/utils/traefik/registry"; +import { removeService } from "@/server/utils/docker/utils"; export type Registry = typeof registry.$inferSelect; export const createRegistry = async (input: typeof apiCreateRegistry._type) => { + const admin = await findAdmin(); + const newRegistry = await db .insert(registry) .values({ ...input, + adminId: admin.adminId, }) .returning() .then((value) => value[0]); @@ -38,6 +44,11 @@ export const removeRegistry = async (registryId: string) => { }); } + if (response.registryType === "selfHosted") { + await removeSelfHostedRegistry(); + await removeService("dokploy-registry"); + } + return response; } catch (error) { throw new TRPCError({ @@ -82,3 +93,8 @@ export const findRegistryById = async (registryId: string) => { } return registryResponse; }; + +export const findAllRegistry = async () => { + const registryResponse = await db.query.registry.findMany(); + return registryResponse; +}; diff --git a/server/constants/index.ts b/server/constants/index.ts index 4c7cd5a5c..49de9338f 100644 --- a/server/constants/index.ts +++ b/server/constants/index.ts @@ -11,5 +11,6 @@ export const LOGS_PATH = `${BASE_PATH}/logs`; export const APPLICATIONS_PATH = `${BASE_PATH}/applications`; export const SSH_PATH = `${BASE_PATH}/ssh`; export const CERTIFICATES_PATH = `${DYNAMIC_TRAEFIK_PATH}/certificates`; +export const REGISTRY_PATH = `${DYNAMIC_TRAEFIK_PATH}/registry`; export const MONITORING_PATH = `${BASE_PATH}/monitoring`; export const docker = new Docker(); diff --git a/server/db/drizzle.config.ts b/server/db/drizzle.config.ts index e8349e8fb..f556649be 100644 --- a/server/db/drizzle.config.ts +++ b/server/db/drizzle.config.ts @@ -1,13 +1,14 @@ -import type { Config } from "drizzle-kit"; +import { defineConfig } from "drizzle-kit"; -console.log("> Generating PG Schema:", process.env.DATABASE_URL); -export default { +export default defineConfig({ schema: "./server/db/schema/index.ts", - driver: "pg", + dialect: "postgresql", dbCredentials: { - connectionString: process.env.DATABASE_URL || "", + url: process.env.DATABASE_URL || "", }, - verbose: true, - strict: true, out: "drizzle", -} satisfies Config; + migrations: { + table: "migrations", + schema: "public", + }, +}); diff --git a/server/db/schema/application.ts b/server/db/schema/application.ts index abdeed53e..26e1bf102 100644 --- a/server/db/schema/application.ts +++ b/server/db/schema/application.ts @@ -12,6 +12,7 @@ import { applicationStatus } from "./shared"; import { ports } from "./port"; import { boolean, integer, pgEnum, pgTable, text } from "drizzle-orm/pg-core"; import { generateAppName } from "./utils"; +import { registry } from "./registry"; export const sourceType = pgEnum("sourceType", ["docker", "git", "github"]); @@ -60,6 +61,7 @@ export const applications = pgTable("application", { customGitBuildPath: text("customGitBuildPath"), customGitSSHKey: text("customGitSSHKey"), dockerfile: text("dockerfile"), + replicas: integer("replicas").default(1).notNull(), applicationStatus: applicationStatus("applicationStatus") .notNull() .default("idle"), @@ -67,6 +69,9 @@ export const applications = pgTable("application", { createdAt: text("createdAt") .notNull() .$defaultFn(() => new Date().toISOString()), + registryId: text("registryId").references(() => registry.registryId, { + onDelete: "set null", + }), projectId: text("projectId") .notNull() .references(() => projects.projectId, { onDelete: "cascade" }), @@ -85,6 +90,10 @@ export const applicationsRelations = relations( redirects: many(redirects), security: many(security), ports: many(ports), + registry: one(registry, { + fields: [applications.registryId], + references: [registry.registryId], + }), }), ); diff --git a/server/db/schema/registry.ts b/server/db/schema/registry.ts index b502648a6..9a536c7c2 100644 --- a/server/db/schema/registry.ts +++ b/server/db/schema/registry.ts @@ -5,6 +5,7 @@ import { boolean, pgEnum, pgTable, text, timestamp } from "drizzle-orm/pg-core"; import { auth } from "./auth"; import { admins } from "./admin"; import { z } from "zod"; +import { applications } from "./application"; /** * This is an example of how to use the multi-project schema feature of Drizzle ORM. Use the same * database instance for multiple projects. @@ -19,6 +20,7 @@ export const registry = pgTable("registry", { .primaryKey() .$defaultFn(() => nanoid()), registryName: text("registryName").notNull(), + imagePrefix: text("imagePrefix"), username: text("username").notNull(), password: text("password").notNull(), registryUrl: text("registryUrl").notNull(), @@ -31,11 +33,12 @@ export const registry = pgTable("registry", { .references(() => admins.adminId, { onDelete: "cascade" }), }); -export const registryRelations = relations(registry, ({ one }) => ({ +export const registryRelations = relations(registry, ({ one, many }) => ({ admin: one(admins, { fields: [registry.adminId], references: [admins.adminId], }), + applications: many(applications), })); const createSchema = createInsertSchema(registry, { @@ -45,6 +48,8 @@ const createSchema = createInsertSchema(registry, { registryUrl: z.string().min(1), adminId: z.string().min(1), registryId: z.string().min(1), + registryType: z.enum(["selfHosted", "cloud"]), + imagePrefix: z.string().nullable().optional(), }); export const apiCreateRegistry = createSchema @@ -53,8 +58,9 @@ export const apiCreateRegistry = createSchema registryName: z.string().min(1), username: z.string().min(1), password: z.string().min(1), - registryUrl: z.string().min(1), - adminId: z.string().min(1), + registryUrl: z.string(), + registryType: z.enum(["selfHosted", "cloud"]), + imagePrefix: z.string().nullable().optional(), }) .required(); @@ -82,6 +88,8 @@ export const apiUpdateRegistry = createSchema export const apiEnableSelfHostedRegistry = createSchema .pick({ - adminId: true, + registryUrl: true, + username: true, + password: true, }) .required(); diff --git a/server/setup/registry-setup.ts b/server/setup/registry-setup.ts new file mode 100644 index 000000000..9756ff8c7 --- /dev/null +++ b/server/setup/registry-setup.ts @@ -0,0 +1,89 @@ +import type { CreateServiceOptions } from "dockerode"; +import { docker, REGISTRY_PATH } from "../constants"; +import { pullImage } from "../utils/docker/utils"; +import { execAsync } from "../utils/process/execAsync"; +import { generateRandomPassword } from "../auth/random-password"; + +export const initializeRegistry = async ( + username: string, + password: string, +) => { + const imageName = "registry:2.8.3"; + const containerName = "dokploy-registry"; + await generatePassword(username, password); + const randomPass = await generateRandomPassword(); + const settings: CreateServiceOptions = { + Name: containerName, + TaskTemplate: { + ContainerSpec: { + Image: imageName, + Env: [ + "REGISTRY_STORAGE_DELETE_ENABLED=true", + "REGISTRY_AUTH=htpasswd", + "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm", + "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd", + `REGISTRY_HTTP_SECRET=${randomPass.hashedPassword}`, + ], + Mounts: [ + { + Type: "bind", + Source: `${REGISTRY_PATH}/htpasswd`, + Target: "/auth/htpasswd", + ReadOnly: true, + }, + { + Type: "volume", + Source: "registry-data", + Target: "/var/lib/registry", + ReadOnly: false, + }, + ], + }, + Networks: [{ Target: "dokploy-network" }], + RestartPolicy: { + Condition: "on-failure", + }, + }, + Mode: { + Replicated: { + Replicas: 1, + }, + }, + EndpointSpec: { + Ports: [ + { + TargetPort: 5000, + PublishedPort: 5000, + Protocol: "tcp", + PublishMode: "host", + }, + ], + }, + }; + try { + await pullImage(imageName); + + const service = docker.getService(containerName); + const inspect = await service.inspect(); + await service.update({ + version: Number.parseInt(inspect.Version.Index), + ...settings, + }); + console.log("Registry Started ✅"); + } catch (error) { + await docker.createService(settings); + console.log("Registry Not Found: Starting ✅"); + } +}; + +const generatePassword = async (username: string, password: string) => { + try { + const command = `htpasswd -nbB ${username} "${password}" > ${REGISTRY_PATH}/htpasswd`; + const result = await execAsync(command); + console.log("Password generated ✅"); + return result.stdout.trim(); + } catch (error) { + console.error("Error generating password:", error); + return null; + } +}; diff --git a/server/utils/builders/index.ts b/server/utils/builders/index.ts index f952ab867..73ba8fd83 100644 --- a/server/utils/builders/index.ts +++ b/server/utils/builders/index.ts @@ -13,6 +13,7 @@ import { buildCustomDocker } from "./docker-file"; import { buildHeroku } from "./heroku"; import { buildNixpacks } from "./nixpacks"; import { buildPaketo } from "./paketo"; +import { uploadImage } from "../cluster/upload"; // NIXPACKS codeDirectory = where is the path of the code directory // HEROKU codeDirectory = where is the path of the code directory @@ -20,7 +21,7 @@ import { buildPaketo } from "./paketo"; // DOCKERFILE codeDirectory = where is the exact path of the (Dockerfile) export type ApplicationNested = InferResultType< "applications", - { mounts: true; security: true; redirects: true; ports: true } + { mounts: true; security: true; redirects: true; ports: true; registry: true } >; export const buildApplication = async ( application: ApplicationNested, @@ -42,6 +43,10 @@ export const buildApplication = async ( } else if (buildType === "dockerfile") { await buildCustomDocker(application, writeStream); } + + if (application.registryId) { + await uploadImage(application, writeStream); + } await mechanizeDockerContainer(application); writeStream.write("Docker Deployed: ✅"); } catch (error) { @@ -67,6 +72,7 @@ export const mechanizeDockerContainer = async ( cpuReservation, command, ports, + replicas, } = application; const resources = calculateResources({ @@ -104,7 +110,7 @@ export const mechanizeDockerContainer = async ( }, Mode: { Replicated: { - Replicas: 1, + Replicas: replicas, }, }, EndpointSpec: { diff --git a/server/utils/cluster/upload.ts b/server/utils/cluster/upload.ts new file mode 100644 index 000000000..d033434d7 --- /dev/null +++ b/server/utils/cluster/upload.ts @@ -0,0 +1,67 @@ +import type { ApplicationNested } from "../builders"; +import { execAsync } from "../process/execAsync"; +import { spawnAsync } from "../process/spawnAsync"; +import type { WriteStream } from "node:fs"; + +export const uploadImage = async ( + application: ApplicationNested, + writeStream: WriteStream, +) => { + const registry = application.registry; + + if (!registry) { + throw new Error("Registry not found"); + } + + const { registryUrl, imagePrefix } = registry; + const { appName } = application; + const imageName = `${appName}:latest`; + + let finalURL = registryUrl; + + let registryTag = `${registryUrl}/${imageName}`; + + if (imagePrefix) { + registryTag = `${registryUrl}/${imagePrefix}/${imageName}`; + } + + // registry.digitalocean.com// + // index.docker.io/siumauricio/app-parse-multi-byte-port-e32uh7:latest + if (registry.registryType === "selfHosted") { + finalURL = + process.env.NODE_ENV === "development" ? "localhost:5000" : registryUrl; + registryTag = `${finalURL}/${imageName}`; + } + + try { + console.log(finalURL, registryTag); + writeStream.write( + `📦 [Enabled Registry] Uploading image to ${registry.registryType} | ${registryTag} | ${finalURL}\n`, + ); + + await spawnAsync( + "docker", + ["login", finalURL, "-u", registry.username, "-p", registry.password], + (data) => { + if (writeStream.writable) { + writeStream.write(data); + } + }, + ); + + await spawnAsync("docker", ["tag", imageName, registryTag], (data) => { + if (writeStream.writable) { + writeStream.write(data); + } + }); + + await spawnAsync("docker", ["push", registryTag], (data) => { + if (writeStream.writable) { + writeStream.write(data); + } + }); + } catch (error) { + console.log(error); + throw error; + } +}; diff --git a/server/utils/traefik/domain.ts b/server/utils/traefik/domain.ts index 689afbbb9..4356153b0 100644 --- a/server/utils/traefik/domain.ts +++ b/server/utils/traefik/domain.ts @@ -47,10 +47,7 @@ export const removeDomain = async (appName: string, uniqueKey: number) => { } }; -export const createRouterConfig = async ( - app: ApplicationNested, - domain: Domain, -) => { +const createRouterConfig = async (app: ApplicationNested, domain: Domain) => { const { appName, redirects, security } = app; const { certificateType } = domain; diff --git a/server/utils/traefik/registry.ts b/server/utils/traefik/registry.ts new file mode 100644 index 000000000..bab6c9876 --- /dev/null +++ b/server/utils/traefik/registry.ts @@ -0,0 +1,67 @@ +import { loadOrCreateConfig } from "./application"; +import type { FileConfig, HttpRouter } from "./file-types"; +import type { Registry } from "@/server/api/services/registry"; +import { removeDirectoryIfExistsContent } from "../filesystem/directory"; +import { REGISTRY_PATH } from "@/server/constants"; +import { dump } from "js-yaml"; +import { join } from "node:path"; +import { existsSync, mkdirSync, writeFileSync } from "node:fs"; + +export const manageRegistry = async (registry: Registry) => { + if (!existsSync(REGISTRY_PATH)) { + mkdirSync(REGISTRY_PATH, { recursive: true }); + } + const appName = "dokploy-registry"; + const config: FileConfig = loadOrCreateConfig(appName); + const serviceName = `${appName}-service`; + const routerName = `${appName}-router`; + + config.http = config.http || { routers: {}, services: {} }; + config.http.routers = config.http.routers || {}; + config.http.services = config.http.services || {}; + + config.http.routers[routerName] = await createRegistryRouterConfig(registry); + + config.http.services[serviceName] = { + loadBalancer: { + servers: [{ url: `http://${appName}:5000` }], + passHostHeader: true, + }, + }; + + const yamlConfig = dump(config); + const configFile = join(REGISTRY_PATH, "registry.yml"); + writeFileSync(configFile, yamlConfig); +}; + +export const removeSelfHostedRegistry = async () => { + await removeDirectoryIfExistsContent(REGISTRY_PATH); +}; + +const createRegistryRouterConfig = async (registry: Registry) => { + const { registryUrl } = registry; + const url = + process.env.NODE_ENV === "production" + ? registryUrl + : "dokploy-registry.docker.localhost"; + const routerConfig: HttpRouter = { + rule: `Host(\`${url}\`)`, + service: "dokploy-registry-service", + ...(process.env.NODE_ENV === "production" + ? { + middlewares: ["redirect-to-https"], + } + : {}), + entryPoints: [ + "web", + ...(process.env.NODE_ENV === "production" ? ["websecure"] : []), + ], + ...(process.env.NODE_ENV === "production" + ? { + tls: { certResolver: "letsencrypt" }, + } + : {}), + }; + + return routerConfig; +}; From c45017e204a279b1ee113cee8e109c3734a5a14a Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Mon, 13 May 2024 01:28:50 -0600 Subject: [PATCH 26/98] feat: add show cluster --- .../cluster/registry/add-docker-registry.tsx | 2 - .../cluster/registry/show-registry.tsx | 4 +- .../settings/cluster/worker/add-worker.tsx | 80 +++++++++++++++++++ .../settings/cluster/worker/show-workers.tsx | 62 ++++++++++++++ components/shared/date-tooltip.tsx | 11 ++- pages/dashboard/settings/cluster.tsx | 2 + server/api/root.ts | 2 + server/api/routers/cluster.ts | 17 ++++ 8 files changed, 174 insertions(+), 6 deletions(-) create mode 100644 components/dashboard/settings/cluster/worker/add-worker.tsx create mode 100644 components/dashboard/settings/cluster/worker/show-workers.tsx create mode 100644 server/api/routers/cluster.ts diff --git a/components/dashboard/settings/cluster/registry/add-docker-registry.tsx b/components/dashboard/settings/cluster/registry/add-docker-registry.tsx index c5cf228da..8e7f1dd23 100644 --- a/components/dashboard/settings/cluster/registry/add-docker-registry.tsx +++ b/components/dashboard/settings/cluster/registry/add-docker-registry.tsx @@ -62,8 +62,6 @@ export const AddRegistry = () => { resolver: zodResolver(AddRegistrySchema), }); - console.log(form.formState.errors); - const password = form.watch("password"); const username = form.watch("username"); const registryUrl = form.watch("registryUrl"); diff --git a/components/dashboard/settings/cluster/registry/show-registry.tsx b/components/dashboard/settings/cluster/registry/show-registry.tsx index 3bfc3bada..c02c6ae6a 100644 --- a/components/dashboard/settings/cluster/registry/show-registry.tsx +++ b/components/dashboard/settings/cluster/registry/show-registry.tsx @@ -23,8 +23,8 @@ export const ShowRegistry = () => {
- Clusters - Add cluster to your application. + Registry + Add registry to your application.
diff --git a/components/dashboard/settings/cluster/worker/add-worker.tsx b/components/dashboard/settings/cluster/worker/add-worker.tsx new file mode 100644 index 000000000..5a7bccaea --- /dev/null +++ b/components/dashboard/settings/cluster/worker/add-worker.tsx @@ -0,0 +1,80 @@ +import { Button } from "@/components/ui/button"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/dialog"; +import { + Form, + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@/components/ui/form"; +import { Input } from "@/components/ui/input"; +import { Textarea } from "@/components/ui/textarea"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { AlertTriangle, PlusIcon } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; + +const AddWorkerSchema = z.object({ + name: z.string().min(1, { + message: "Name is required", + }), + description: z.string().optional(), +}); + +type AddWorker = z.infer; + +export const AddWorker = () => { + const utils = api.useUtils(); + + const { data, isLoading } = api.cluster.addWorker.useQuery(); + + return ( + + + + + + + Add a new worker + Add a new worker + + {/* {isError && ( +
+ + + {error?.message} + +
+ )} */} +
+ 1. Go to your new server and run the following command + + curl https://get.docker.com | sh -s -- --version 24.0 + +
+ +
+ + 2. Run the following command to add the node(server) to your cluster + + {data} +
+
+
+ ); +}; diff --git a/components/dashboard/settings/cluster/worker/show-workers.tsx b/components/dashboard/settings/cluster/worker/show-workers.tsx new file mode 100644 index 000000000..bb0deb8fa --- /dev/null +++ b/components/dashboard/settings/cluster/worker/show-workers.tsx @@ -0,0 +1,62 @@ +import React from "react"; +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from "@/components/ui/card"; + +import { api } from "@/utils/api"; +import { AddWorker } from "./add-worker"; +import { DateTooltip } from "@/components/shared/date-tooltip"; + +export const ShowCluster = () => { + const { data, isLoading } = api.cluster.getWorkers.useQuery(); + // console.log(data) + return ( + + +
+ Cluster + Add nodes to your cluster +
+ +
+ +
+ {isLoading &&
Loading...
} + {data?.map((worker, index) => ( +
+ + {worker.Description.Hostname} + + + {worker.Status.State} + + + {worker.Spec.Availability} + + + {worker.ManagerStatus.Reachability} + + + {worker?.Spec?.Role} + + + + {worker?.Description.Engine.EngineVersion} + + + {/* Created */} + +
+ ))} +
+
+
+ ); +}; diff --git a/components/shared/date-tooltip.tsx b/components/shared/date-tooltip.tsx index 2538ebf74..552d629dd 100644 --- a/components/shared/date-tooltip.tsx +++ b/components/shared/date-tooltip.tsx @@ -4,19 +4,26 @@ import { TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; +import { cn } from "@/lib/utils"; import { format, formatDistanceToNow } from "date-fns"; interface Props { date: string; children?: React.ReactNode; + className?: string; } -export const DateTooltip = ({ date, children }: Props) => { +export const DateTooltip = ({ date, children, className }: Props) => { return ( - + {children}{" "} {formatDistanceToNow(new Date(date), { addSuffix: true, diff --git a/pages/dashboard/settings/cluster.tsx b/pages/dashboard/settings/cluster.tsx index 98ce5cfe9..d433e9020 100644 --- a/pages/dashboard/settings/cluster.tsx +++ b/pages/dashboard/settings/cluster.tsx @@ -1,5 +1,6 @@ import { ShowCertificates } from "@/components/dashboard/settings/certificates/show-certificates"; import { ShowRegistry } from "@/components/dashboard/settings/cluster/registry/show-registry"; +import { ShowCluster } from "@/components/dashboard/settings/cluster/worker/show-workers"; import { DashboardLayout } from "@/components/layouts/dashboard-layout"; import { SettingsLayout } from "@/components/layouts/settings-layout"; import { validateRequest } from "@/server/auth/auth"; @@ -10,6 +11,7 @@ const Page = () => { return (
+
); }; diff --git a/server/api/root.ts b/server/api/root.ts index d9b02e20a..da192b6b5 100644 --- a/server/api/root.ts +++ b/server/api/root.ts @@ -21,6 +21,7 @@ import { portRouter } from "./routers/port"; import { adminRouter } from "./routers/admin"; import { dockerRouter } from "./routers/docker"; import { registryRouter } from "./routers/registry"; +import { clusterRouter } from "./routers/cluster"; /** * This is the primary router for your server. * @@ -49,6 +50,7 @@ export const appRouter = createTRPCRouter({ redirects: redirectsRouter, port: portRouter, registry: registryRouter, + cluster: clusterRouter, }); // export type definition of API diff --git a/server/api/routers/cluster.ts b/server/api/routers/cluster.ts new file mode 100644 index 000000000..9a6ff6e7f --- /dev/null +++ b/server/api/routers/cluster.ts @@ -0,0 +1,17 @@ +import { docker } from "@/server/constants"; +import { createTRPCRouter, protectedProcedure } from "../trpc"; +import { getPublicIpWithFallback } from "@/server/wss/terminal"; + +export const clusterRouter = createTRPCRouter({ + getWorkers: protectedProcedure.query(async () => { + const workers = await docker.listNodes(); + // console.log(workers); + return workers; + }), + addWorker: protectedProcedure.query(async ({ input }) => { + const result = await docker.swarmInspect(); + return `docker swarm join --token ${ + result.JoinTokens.Worker + } ${await getPublicIpWithFallback()}:2377`; + }), +}); From d19dec801033ed6e173780ae3051829c414b707a Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Mon, 13 May 2024 03:15:09 -0600 Subject: [PATCH 27/98] refactor: set the registry url in image in case we have a registry asociated --- .../settings/cluster/worker/show-workers.tsx | 2 +- pages/_error.tsx | 4 ++-- server/api/routers/registry.ts | 1 + server/api/routers/settings.ts | 1 + server/utils/builders/index.ts | 17 ++++++++++++++++- 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/components/dashboard/settings/cluster/worker/show-workers.tsx b/components/dashboard/settings/cluster/worker/show-workers.tsx index bb0deb8fa..470ab86db 100644 --- a/components/dashboard/settings/cluster/worker/show-workers.tsx +++ b/components/dashboard/settings/cluster/worker/show-workers.tsx @@ -41,7 +41,7 @@ export const ShowCluster = () => { {worker.Spec.Availability}
- {worker.ManagerStatus.Reachability} + {worker?.ManagerStatus?.Reachability || "-"} {worker?.Spec?.Role} diff --git a/pages/_error.tsx b/pages/_error.tsx index fb3bf23cf..4939d0180 100644 --- a/pages/_error.tsx +++ b/pages/_error.tsx @@ -12,8 +12,8 @@ export default function Custom404({ statusCode }: Props) {
-
-

+
+

{statusCode ? `An error ${statusCode} occurred on server` : "An error occurred on client"} diff --git a/server/api/routers/registry.ts b/server/api/routers/registry.ts index 0fe097765..4779b9488 100644 --- a/server/api/routers/registry.ts +++ b/server/api/routers/registry.ts @@ -64,6 +64,7 @@ export const registryRouter = createTRPCRouter({ return true; } catch (error) { + console.log(error); return false; } }), diff --git a/server/api/routers/settings.ts b/server/api/routers/settings.ts index 366530d80..dabb33081 100644 --- a/server/api/routers/settings.ts +++ b/server/api/routers/settings.ts @@ -238,3 +238,4 @@ export const settingsRouter = createTRPCRouter({ return readConfigInPath(input.path); }), }); +// apt-get install apache2-utils diff --git a/server/utils/builders/index.ts b/server/utils/builders/index.ts index 73ba8fd83..d2611e2b2 100644 --- a/server/utils/builders/index.ts +++ b/server/utils/builders/index.ts @@ -81,16 +81,31 @@ export const mechanizeDockerContainer = async ( cpuLimit, cpuReservation, }); + const volumesMount = generateVolumeMounts(mounts); const bindsMount = generateBindMounts(mounts); const filesMount = generateFileMounts(appName, mounts); const envVariables = prepareEnvironmentVariables(env); + const registry = application.registry; + + const image = + sourceType === "docker" + ? dockerImage! + : registry + ? `${registry.registryUrl}/${appName}` + : `${appName}:latest`; + const settings: CreateServiceOptions = { + authconfig: { + password: registry?.password || "", + username: registry?.username || "", + serveraddress: registry?.registryUrl || "", + }, Name: appName, TaskTemplate: { ContainerSpec: { - Image: sourceType === "docker" ? dockerImage! : `${appName}:latest`, + Image: image, Env: envVariables, Mounts: [...volumesMount, ...bindsMount, ...filesMount], ...(command From 08517d6f3651a741e5e8b18ac7471b7240278438 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Tue, 14 May 2024 03:09:07 -0600 Subject: [PATCH 28/98] feat: add update registry and fix the docker url markup --- Dockerfile | 3 +- .../cluster/registry/add-docker-registry.tsx | 22 +- .../cluster/registry/show-registry.tsx | 6 +- .../registry/update-docker-registry.tsx | 275 ++++++++++++++++++ server/api/routers/registry.ts | 13 +- server/api/services/registry.ts | 21 +- server/db/schema/registry.ts | 21 +- server/setup/registry-setup.ts | 4 +- server/utils/builders/index.ts | 15 +- server/utils/cluster/upload.ts | 26 +- server/utils/traefik/registry.ts | 27 +- 11 files changed, 366 insertions(+), 67 deletions(-) create mode 100644 components/dashboard/settings/cluster/registry/update-docker-registry.tsx diff --git a/Dockerfile b/Dockerfile index 97d7b26a7..6d3e58758 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,7 @@ FROM node:18-slim AS production # Install dependencies only for production ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" -RUN corepack enable && apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* +RUN corepack enable && apt-get update && apt-get install -y curl && apt-get install -y apache2-utils && rm -rf /var/lib/apt/lists/* WORKDIR /app @@ -47,7 +47,6 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-l # Install docker RUN curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh && rm get-docker.sh - # Install Nixpacks and tsx # | VERBOSE=1 VERSION=1.21.0 bash RUN curl -sSL https://nixpacks.com/install.sh -o install.sh \ diff --git a/components/dashboard/settings/cluster/registry/add-docker-registry.tsx b/components/dashboard/settings/cluster/registry/add-docker-registry.tsx index 8e7f1dd23..04ac32707 100644 --- a/components/dashboard/settings/cluster/registry/add-docker-registry.tsx +++ b/components/dashboard/settings/cluster/registry/add-docker-registry.tsx @@ -217,10 +217,6 @@ export const AddRegistry = () => { variant={"secondary"} isLoading={isLoading} onClick={async () => { - if (!form.formState.isValid) { - toast.error("Please fill all the fields"); - return; - } await testRegistry({ username: username, password: password, @@ -228,13 +224,17 @@ export const AddRegistry = () => { registryName: registryName, registryType: "cloud", imagePrefix: imagePrefix, - }).then((data) => { - if (data) { - toast.success("Registry Tested Successfully"); - } else { - toast.error("Registry Test Failed"); - } - }); + }) + .then((data) => { + if (data) { + toast.success("Registry Tested Successfully"); + } else { + toast.error("Registry Test Failed"); + } + }) + .catch(() => { + toast.error("Error to test the registry"); + }); }} > Test Registry diff --git a/components/dashboard/settings/cluster/registry/show-registry.tsx b/components/dashboard/settings/cluster/registry/show-registry.tsx index c02c6ae6a..30ed18fe9 100644 --- a/components/dashboard/settings/cluster/registry/show-registry.tsx +++ b/components/dashboard/settings/cluster/registry/show-registry.tsx @@ -10,6 +10,7 @@ import { Server } from "lucide-react"; import { AddRegistry } from "./add-docker-registry"; import { AddSelfHostedRegistry } from "./add-self-docker-registry"; import { DeleteRegistry } from "./delete-registry"; +import { UpdateDockerRegistry } from "./update-docker-registry"; export const ShowRegistry = () => { const { data } = api.registry.all.useQuery(); @@ -49,8 +50,6 @@ export const ShowRegistry = () => {

- - {/* */}

) : (
@@ -63,12 +62,11 @@ export const ShowRegistry = () => { {index + 1}. {registry.registryName}
+
))} - -
{/* */}
)} diff --git a/components/dashboard/settings/cluster/registry/update-docker-registry.tsx b/components/dashboard/settings/cluster/registry/update-docker-registry.tsx new file mode 100644 index 000000000..c84c019ac --- /dev/null +++ b/components/dashboard/settings/cluster/registry/update-docker-registry.tsx @@ -0,0 +1,275 @@ +import { Button } from "@/components/ui/button"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/dialog"; +import { + Form, + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@/components/ui/form"; +import { Input } from "@/components/ui/input"; +import { cn } from "@/lib/utils"; +import { api } from "@/utils/api"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { AlertTriangle, PenBoxIcon } from "lucide-react"; +import { useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { toast } from "sonner"; +import { z } from "zod"; + +const updateRegistry = z.object({ + registryName: z.string().min(1, { + message: "Registry name is required", + }), + username: z.string().min(1, { + message: "Username is required", + }), + password: z.string(), + registryUrl: z.string().min(1, { + message: "Registry URL is required", + }), + imagePrefix: z.string(), +}); + +type UpdateRegistry = z.infer; + +interface Props { + registryId: string; +} + +export const UpdateDockerRegistry = ({ registryId }: Props) => { + const utils = api.useUtils(); + const { mutateAsync: testRegistry, isLoading } = + api.registry.testRegistry.useMutation(); + const { data, refetch } = api.registry.one.useQuery( + { + registryId, + }, + { + enabled: !!registryId, + }, + ); + + const isCloud = data?.registryType === "cloud"; + const { mutateAsync, isError, error } = api.registry.update.useMutation(); + + const form = useForm({ + defaultValues: { + imagePrefix: "", + registryName: "", + username: "", + password: "", + registryUrl: "", + }, + resolver: zodResolver(updateRegistry), + }); + + const password = form.watch("password"); + const username = form.watch("username"); + const registryUrl = form.watch("registryUrl"); + const registryName = form.watch("registryName"); + const imagePrefix = form.watch("imagePrefix"); + + useEffect(() => { + if (data) { + form.reset({ + imagePrefix: data.imagePrefix || "", + registryName: data.registryName || "", + username: data.username || "", + password: "", + registryUrl: data.registryUrl || "", + }); + } + }, [form, form.reset, data]); + + const onSubmit = async (data: UpdateRegistry) => { + await mutateAsync({ + registryId, + ...(data.password ? { password: data.password } : {}), + registryName: data.registryName, + username: data.username, + registryUrl: data.registryUrl, + imagePrefix: data.imagePrefix, + }) + .then(async (data) => { + toast.success("Registry Updated"); + await refetch(); + await utils.registry.all.invalidate(); + }) + .catch(() => { + toast.error("Error to update the registry"); + }); + }; + return ( + + + + + + + Registry + Update the registry information + + {isError && ( +
+ + + {error?.message} + +
+ )} + +
+ +
+
+ ( + + Registry Name + + + + + + + )} + /> + + ( + + Username + + + + + + + )} + /> + + ( + + Password + + + + + + + )} + /> + {isCloud && ( + ( + + Image Prefix + + + + + + + )} + /> + )} + + ( + + Registry URL + + + + + + + )} + /> +
+
+
+ + + {isCloud && ( + + )} + + + + +
+
+ ); +}; diff --git a/server/api/routers/registry.ts b/server/api/routers/registry.ts index 4779b9488..63ffa213c 100644 --- a/server/api/routers/registry.ts +++ b/server/api/routers/registry.ts @@ -3,6 +3,7 @@ import { apiEnableSelfHostedRegistry, apiFindOneRegistry, apiRemoveRegistry, + apiTestRegistry, apiUpdateRegistry, } from "@/server/db/schema"; import { @@ -10,7 +11,7 @@ import { findAllRegistry, findRegistryById, removeRegistry, - updaterRegistry, + updateRegistry, } from "../services/registry"; import { adminProcedure, createTRPCRouter, protectedProcedure } from "../trpc"; import { TRPCError } from "@trpc/server"; @@ -33,7 +34,7 @@ export const registryRouter = createTRPCRouter({ .input(apiUpdateRegistry) .mutation(async ({ input }) => { const { registryId, ...rest } = input; - const application = await updaterRegistry(registryId, { + const application = await updateRegistry(registryId, { ...rest, }); @@ -49,11 +50,11 @@ export const registryRouter = createTRPCRouter({ all: protectedProcedure.query(async () => { return await findAllRegistry(); }), - findOne: adminProcedure.input(apiFindOneRegistry).query(async ({ input }) => { + one: adminProcedure.input(apiFindOneRegistry).query(async ({ input }) => { return await findRegistryById(input.registryId); }), testRegistry: protectedProcedure - .input(apiCreateRegistry) + .input(apiTestRegistry) .mutation(async ({ input }) => { try { const result = await docker.checkAuth({ @@ -76,6 +77,10 @@ export const registryRouter = createTRPCRouter({ ...input, registryName: "Self Hosted Registry", registryType: "selfHosted", + registryUrl: + process.env.NODE_ENV === "production" + ? input.registryUrl + : "dokploy-registry.docker.localhost", imagePrefix: null, }); diff --git a/server/api/services/registry.ts b/server/api/services/registry.ts index 149927d5f..48077d055 100644 --- a/server/api/services/registry.ts +++ b/server/api/services/registry.ts @@ -3,8 +3,12 @@ import { TRPCError } from "@trpc/server"; import { db } from "@/server/db"; import { eq } from "drizzle-orm"; import { findAdmin } from "./admin"; -import { removeSelfHostedRegistry } from "@/server/utils/traefik/registry"; +import { + manageRegistry, + removeSelfHostedRegistry, +} from "@/server/utils/traefik/registry"; import { removeService } from "@/server/utils/docker/utils"; +import { initializeRegistry } from "@/server/setup/registry-setup"; export type Registry = typeof registry.$inferSelect; @@ -59,7 +63,7 @@ export const removeRegistry = async (registryId: string) => { } }; -export const updaterRegistry = async ( +export const updateRegistry = async ( registryId: string, registryData: Partial, ) => { @@ -70,9 +74,15 @@ export const updaterRegistry = async ( ...registryData, }) .where(eq(registry.registryId, registryId)) - .returning(); + .returning() + .then((res) => res[0]); - return response[0]; + if (response?.registryType === "selfHosted") { + await manageRegistry(response); + await initializeRegistry(response.username, response.password); + } + + return response; } catch (error) { throw new TRPCError({ code: "BAD_REQUEST", @@ -84,6 +94,9 @@ export const updaterRegistry = async ( export const findRegistryById = async (registryId: string) => { const registryResponse = await db.query.registry.findFirst({ where: eq(registry.registryId, registryId), + columns: { + password: false, + }, }); if (!registryResponse) { throw new TRPCError({ diff --git a/server/db/schema/registry.ts b/server/db/schema/registry.ts index 9a536c7c2..7921c5aa4 100644 --- a/server/db/schema/registry.ts +++ b/server/db/schema/registry.ts @@ -64,6 +64,15 @@ export const apiCreateRegistry = createSchema }) .required(); +export const apiTestRegistry = createSchema.pick({}).extend({ + registryName: z.string().min(1), + username: z.string().min(1), + password: z.string().min(1), + registryUrl: z.string(), + registryType: z.enum(["selfHosted", "cloud"]), + imagePrefix: z.string().nullable().optional(), +}); + export const apiRemoveRegistry = createSchema .pick({ registryId: true, @@ -76,15 +85,9 @@ export const apiFindOneRegistry = createSchema }) .required(); -export const apiUpdateRegistry = createSchema - .pick({ - password: true, - registryName: true, - username: true, - registryUrl: true, - registryId: true, - }) - .required(); +export const apiUpdateRegistry = createSchema.partial().extend({ + registryId: z.string().min(1), +}); export const apiEnableSelfHostedRegistry = createSchema .pick({ diff --git a/server/setup/registry-setup.ts b/server/setup/registry-setup.ts index 9756ff8c7..94d592f7f 100644 --- a/server/setup/registry-setup.ts +++ b/server/setup/registry-setup.ts @@ -10,7 +10,7 @@ export const initializeRegistry = async ( ) => { const imageName = "registry:2.8.3"; const containerName = "dokploy-registry"; - await generatePassword(username, password); + await generateRegistryPassword(username, password); const randomPass = await generateRandomPassword(); const settings: CreateServiceOptions = { Name: containerName, @@ -76,7 +76,7 @@ export const initializeRegistry = async ( } }; -const generatePassword = async (username: string, password: string) => { +const generateRegistryPassword = async (username: string, password: string) => { try { const command = `htpasswd -nbB ${username} "${password}" > ${REGISTRY_PATH}/htpasswd`; const result = await execAsync(command); diff --git a/server/utils/builders/index.ts b/server/utils/builders/index.ts index d2611e2b2..715a1fe34 100644 --- a/server/utils/builders/index.ts +++ b/server/utils/builders/index.ts @@ -89,12 +89,15 @@ export const mechanizeDockerContainer = async ( const registry = application.registry; - const image = - sourceType === "docker" - ? dockerImage! - : registry - ? `${registry.registryUrl}/${appName}` - : `${appName}:latest`; + let image = sourceType === "docker" ? dockerImage! : `${appName}:latest`; + + if (registry) { + image = `${registry.registryUrl}/${appName}`; + + if (registry.imagePrefix) { + image = `${registry.registryUrl}/${registry.imagePrefix}/${appName}`; + } + } const settings: CreateServiceOptions = { authconfig: { diff --git a/server/utils/cluster/upload.ts b/server/utils/cluster/upload.ts index d033434d7..234fdbd54 100644 --- a/server/utils/cluster/upload.ts +++ b/server/utils/cluster/upload.ts @@ -1,5 +1,4 @@ import type { ApplicationNested } from "../builders"; -import { execAsync } from "../process/execAsync"; import { spawnAsync } from "../process/spawnAsync"; import type { WriteStream } from "node:fs"; @@ -13,25 +12,20 @@ export const uploadImage = async ( throw new Error("Registry not found"); } - const { registryUrl, imagePrefix } = registry; + const { registryUrl, imagePrefix, registryType } = registry; const { appName } = application; const imageName = `${appName}:latest`; - let finalURL = registryUrl; + const finalURL = + registryType === "selfHosted" + ? process.env.NODE_ENV === "development" + ? "localhost:5000" + : registryUrl + : registryUrl; - let registryTag = `${registryUrl}/${imageName}`; - - if (imagePrefix) { - registryTag = `${registryUrl}/${imagePrefix}/${imageName}`; - } - - // registry.digitalocean.com// - // index.docker.io/siumauricio/app-parse-multi-byte-port-e32uh7:latest - if (registry.registryType === "selfHosted") { - finalURL = - process.env.NODE_ENV === "development" ? "localhost:5000" : registryUrl; - registryTag = `${finalURL}/${imageName}`; - } + const registryTag = imagePrefix + ? `${registryUrl}/${imagePrefix}/${imageName}` + : `${finalURL}/${imageName}`; try { console.log(finalURL, registryTag); diff --git a/server/utils/traefik/registry.ts b/server/utils/traefik/registry.ts index bab6c9876..6f2960ea2 100644 --- a/server/utils/traefik/registry.ts +++ b/server/utils/traefik/registry.ts @@ -1,18 +1,19 @@ -import { loadOrCreateConfig } from "./application"; import type { FileConfig, HttpRouter } from "./file-types"; import type { Registry } from "@/server/api/services/registry"; import { removeDirectoryIfExistsContent } from "../filesystem/directory"; import { REGISTRY_PATH } from "@/server/constants"; -import { dump } from "js-yaml"; +import { dump, load } from "js-yaml"; import { join } from "node:path"; -import { existsSync, mkdirSync, writeFileSync } from "node:fs"; +import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs"; export const manageRegistry = async (registry: Registry) => { if (!existsSync(REGISTRY_PATH)) { mkdirSync(REGISTRY_PATH, { recursive: true }); } + const appName = "dokploy-registry"; - const config: FileConfig = loadOrCreateConfig(appName); + const config: FileConfig = loadOrCreateConfig(); + const serviceName = `${appName}-service`; const routerName = `${appName}-router`; @@ -40,12 +41,8 @@ export const removeSelfHostedRegistry = async () => { const createRegistryRouterConfig = async (registry: Registry) => { const { registryUrl } = registry; - const url = - process.env.NODE_ENV === "production" - ? registryUrl - : "dokploy-registry.docker.localhost"; const routerConfig: HttpRouter = { - rule: `Host(\`${url}\`)`, + rule: `Host(\`${registryUrl}\`)`, service: "dokploy-registry-service", ...(process.env.NODE_ENV === "production" ? { @@ -65,3 +62,15 @@ const createRegistryRouterConfig = async (registry: Registry) => { return routerConfig; }; + +const loadOrCreateConfig = (): FileConfig => { + const configPath = join(REGISTRY_PATH, "registry.yml"); + if (existsSync(configPath)) { + const yamlStr = readFileSync(configPath, "utf8"); + const parsedConfig = (load(yamlStr) as FileConfig) || { + http: { routers: {}, services: {} }, + }; + return parsedConfig; + } + return { http: { routers: {}, services: {} } }; +}; From 1279722704289a236d1877696d7302333ac1cfb2 Mon Sep 17 00:00:00 2001 From: Freddy <118914591+DontFred@users.noreply.github.com> Date: Tue, 14 May 2024 10:29:03 +0000 Subject: [PATCH 29/98] Added german readme file --- README-de.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 README-de.md diff --git a/README-de.md b/README-de.md new file mode 100644 index 000000000..f4fead657 --- /dev/null +++ b/README-de.md @@ -0,0 +1,48 @@ + + +
+

Dokploy

+
+ +
+Reflex Logo +
+
+ + +Dokploy ist eine kostenlose und self-hostable Platform as a Service (PaaS), welche das hosten und managen von deinen Projekten und Datenbanken vereinfacht, das geschieht mithilfe von Docker und Treafik. Es ist designt, um deine Leistung und die Sicherheit deiner Projekte zu verbessern. Dokploy erlaubt dir schnell und einfach auf jeder VPS deine Projekte zu verwirklichen. + + +## Explanation +[English](README.md) | [中文](README-zh.md) | [Deutsch](README-de.md) + + + + +## 🌟 Features + +- **Projekte**: - **Projekte**: Hoste jegliche Art von Projekt (Node.js, PHP, Python, Go, Ruby, etc.) mit Einfachheit. +- **Datenbanken**: Erstelle und manage Datenbanken, wie MySQL, PostgreSQL, MongoDB, MariaDB, Redis, und mehr. +- **Docker Management**: Einfach Docker container hosten und managen. +- **Traefik Integration**: Automatische Integration mit Traefik für routing und load balancing +- **Real-time Monitoring**: Monitor von CPU, RAM, Speicher, und network Nutzung. +- **Database Backups**: Automatische Backups mit Support für mehrere Speicher Systeme. + + +## 🚀 Getting Started + +Um anzufangen führe einfach den folgende command in einer VPS aus: + +```bash +curl -sSL https://dokploy.com/install.sh | sh +``` + +Getestete Systems: + +- Ubuntu 20.04 +- Debian 11 + +## 📄 Documentation + +Für eine detaillierte Dokumentation, siehe [docs.dokploy.com/docs](https://docs.dokploy.com) + From 61d7013a59036d8fa4b3d5e3591284e9c69f3baf Mon Sep 17 00:00:00 2001 From: Freddy <118914591+DontFred@users.noreply.github.com> Date: Tue, 14 May 2024 10:30:39 +0000 Subject: [PATCH 30/98] Added german readme link to other readme's --- README-zh.md | 2 ++ README.md | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README-zh.md b/README-zh.md index 0e4982e08..e7d14fe58 100644 --- a/README-zh.md +++ b/README-zh.md @@ -18,6 +18,8 @@ Dokploy 是一个免费的自托管平台即服务 (PaaS),它使用 Docker 和 [中文](README-zh.md) +[Deutsch](README-de.md) + diff --git a/README.md b/README.md index a1c4708a9..623836007 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Dokploy is a free self-hostable Platform as a Service (PaaS) that simplifies the ## Explanation -[English](README.md) | [中文](README-zh.md) +[English](README.md) | [中文](README-zh.md) | [Deutsch](README-de.md) From 30cab150c951f9c387b631019ac52a3d9236416a Mon Sep 17 00:00:00 2001 From: Freddy <118914591+DontFred@users.noreply.github.com> Date: Wed, 15 May 2024 08:10:36 +0200 Subject: [PATCH 31/98] Changed titles README-de.md --- README-de.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README-de.md b/README-de.md index f4fead657..76dca832b 100644 --- a/README-de.md +++ b/README-de.md @@ -13,13 +13,13 @@ Dokploy ist eine kostenlose und self-hostable Platform as a Service (PaaS), welche das hosten und managen von deinen Projekten und Datenbanken vereinfacht, das geschieht mithilfe von Docker und Treafik. Es ist designt, um deine Leistung und die Sicherheit deiner Projekte zu verbessern. Dokploy erlaubt dir schnell und einfach auf jeder VPS deine Projekte zu verwirklichen. -## Explanation +## Erklärung [English](README.md) | [中文](README-zh.md) | [Deutsch](README-de.md) -## 🌟 Features +## 🌟 Vorteile - **Projekte**: - **Projekte**: Hoste jegliche Art von Projekt (Node.js, PHP, Python, Go, Ruby, etc.) mit Einfachheit. - **Datenbanken**: Erstelle und manage Datenbanken, wie MySQL, PostgreSQL, MongoDB, MariaDB, Redis, und mehr. @@ -29,7 +29,7 @@ Dokploy ist eine kostenlose und self-hostable Platform as a Service (PaaS), - **Database Backups**: Automatische Backups mit Support für mehrere Speicher Systeme. -## 🚀 Getting Started +## 🚀 Loslegen Um anzufangen führe einfach den folgende command in einer VPS aus: @@ -42,7 +42,7 @@ Getestete Systems: - Ubuntu 20.04 - Debian 11 -## 📄 Documentation +## 📄 Dokumentation Für eine detaillierte Dokumentation, siehe [docs.dokploy.com/docs](https://docs.dokploy.com) From d6685e1f4a16aee2f70b09437997987593abbb38 Mon Sep 17 00:00:00 2001 From: Mr1Blaze Date: Wed, 15 May 2024 21:25:46 +0300 Subject: [PATCH 32/98] Added Russian Readme --- README-ru.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 README-ru.md diff --git a/README-ru.md b/README-ru.md new file mode 100644 index 000000000..ac4ff6647 --- /dev/null +++ b/README-ru.md @@ -0,0 +1,47 @@ +
+

Dokploy

+
+ +
+Логотип Dokploy +
+
+ + + +Dokploy - это бесплатная самоустанавливаемая Платформа как Сервис (PaaS), которая упрощает развертывание и управление приложениями и базами данных с использованием Docker и Traefik. Разработанный для повышения эффективности и безопасности, Dokploy позволяет развертывать ваши приложения на любом VPS. + + + +## Объяснение +[English](README.md) | [中文](README-zh.md) | [Deutsch](README-de.md) + + + + +## 🌟 Особенности + +- **Приложения**: Легко развертывать любой тип приложения (Node.js, PHP, Python, Go, Ruby и др.). +- **Базы данных**: Создавайте и управляйте базами данных с поддержкой MySQL, PostgreSQL, MongoDB, MariaDB, Redis и других. +- **Управление Docker**: Легко развертывать и управляйте контейнерами Docker. +- **Интеграция с Traefik**: Автоматически интегрируется с Traefik для маршрутизации и балансировки нагрузки. +- **Мониторинг в реальном времени**: Отслеживайте использование CPU, памяти, хранилища и сети. +- **Резервное копирование баз данных**: Автоматизируйте резервное копирование с поддержкой нескольких мест хранения. + + +## 🚀 Начало работы + +Чтобы установить, выполните следующую команду на VPS: + + +```bash +curl -sSL https://dokploy.com/install.sh | sh +``` + +Проверенные системы: + +- Ubuntu 20.04 +- Debian 11 + +## 📄 Документация +Для подробной документации посетите docs.dokploy.com/docs. \ No newline at end of file From e5830898978444ce4224a22d6939817bf95b9099 Mon Sep 17 00:00:00 2001 From: Mr1Blaze Date: Wed, 15 May 2024 21:27:02 +0300 Subject: [PATCH 33/98] Added Russian Path on README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 623836007..ff142f1e7 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Dokploy is a free self-hostable Platform as a Service (PaaS) that simplifies the ## Explanation -[English](README.md) | [中文](README-zh.md) | [Deutsch](README-de.md) +[English](README.md) | [中文](README-zh.md) | [Deutsch](README-de.md) | [Русский Язык](README-ru.md) From fe788d72091a2c8149e8cccf3932c274d1ee40a5 Mon Sep 17 00:00:00 2001 From: Mr1Blaze Date: Wed, 15 May 2024 21:28:18 +0300 Subject: [PATCH 34/98] Update README-zh.md linked Russian Language --- README-zh.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README-zh.md b/README-zh.md index e7d14fe58..83aa0241a 100644 --- a/README-zh.md +++ b/README-zh.md @@ -19,6 +19,7 @@ Dokploy 是一个免费的自托管平台即服务 (PaaS),它使用 Docker 和 [中文](README-zh.md) [Deutsch](README-de.md) +[Русский Язык](README-ru.md) From 5f52345b2e9a170031cfb80385528b296132b77c Mon Sep 17 00:00:00 2001 From: Mr1Blaze Date: Wed, 15 May 2024 21:28:45 +0300 Subject: [PATCH 35/98] Update README-zh.md --- README-zh.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README-zh.md b/README-zh.md index 83aa0241a..010ca799c 100644 --- a/README-zh.md +++ b/README-zh.md @@ -19,6 +19,7 @@ Dokploy 是一个免费的自托管平台即服务 (PaaS),它使用 Docker 和 [中文](README-zh.md) [Deutsch](README-de.md) + [Русский Язык](README-ru.md) From 9d02fd52075879db28ac7ea06b45249d74564334 Mon Sep 17 00:00:00 2001 From: Mr1Blaze Date: Wed, 15 May 2024 21:29:52 +0300 Subject: [PATCH 36/98] Update README-de.md and Linked Russian Language --- README-de.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-de.md b/README-de.md index 76dca832b..29f3482c4 100644 --- a/README-de.md +++ b/README-de.md @@ -14,7 +14,7 @@ Dokploy ist eine kostenlose und self-hostable Platform as a Service (PaaS), ## Erklärung -[English](README.md) | [中文](README-zh.md) | [Deutsch](README-de.md) +[English](README.md) | [中文](README-zh.md) | [Deutsch](README-de.md) | [Русский Язык](README-ru.md) From e0f1691731ffbea9058c1b3742ccd24f7d949ad2 Mon Sep 17 00:00:00 2001 From: Mr1Blaze Date: Thu, 16 May 2024 06:20:02 +0300 Subject: [PATCH 37/98] Added Russian readme file (#89) * Added Russian Readme * Added Russian Path on README.md * Update README-zh.md linked Russian Language * Update README-zh.md * Update README-de.md and Linked Russian Language --- README-de.md | 2 +- README-ru.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ README-zh.md | 2 ++ README.md | 2 +- 4 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 README-ru.md diff --git a/README-de.md b/README-de.md index 76dca832b..29f3482c4 100644 --- a/README-de.md +++ b/README-de.md @@ -14,7 +14,7 @@ Dokploy ist eine kostenlose und self-hostable Platform as a Service (PaaS), ## Erklärung -[English](README.md) | [中文](README-zh.md) | [Deutsch](README-de.md) +[English](README.md) | [中文](README-zh.md) | [Deutsch](README-de.md) | [Русский Язык](README-ru.md) diff --git a/README-ru.md b/README-ru.md new file mode 100644 index 000000000..ac4ff6647 --- /dev/null +++ b/README-ru.md @@ -0,0 +1,47 @@ +
+

Dokploy

+
+ +
+Логотип Dokploy +
+
+ + + +Dokploy - это бесплатная самоустанавливаемая Платформа как Сервис (PaaS), которая упрощает развертывание и управление приложениями и базами данных с использованием Docker и Traefik. Разработанный для повышения эффективности и безопасности, Dokploy позволяет развертывать ваши приложения на любом VPS. + + + +## Объяснение +[English](README.md) | [中文](README-zh.md) | [Deutsch](README-de.md) + + + + +## 🌟 Особенности + +- **Приложения**: Легко развертывать любой тип приложения (Node.js, PHP, Python, Go, Ruby и др.). +- **Базы данных**: Создавайте и управляйте базами данных с поддержкой MySQL, PostgreSQL, MongoDB, MariaDB, Redis и других. +- **Управление Docker**: Легко развертывать и управляйте контейнерами Docker. +- **Интеграция с Traefik**: Автоматически интегрируется с Traefik для маршрутизации и балансировки нагрузки. +- **Мониторинг в реальном времени**: Отслеживайте использование CPU, памяти, хранилища и сети. +- **Резервное копирование баз данных**: Автоматизируйте резервное копирование с поддержкой нескольких мест хранения. + + +## 🚀 Начало работы + +Чтобы установить, выполните следующую команду на VPS: + + +```bash +curl -sSL https://dokploy.com/install.sh | sh +``` + +Проверенные системы: + +- Ubuntu 20.04 +- Debian 11 + +## 📄 Документация +Для подробной документации посетите docs.dokploy.com/docs. \ No newline at end of file diff --git a/README-zh.md b/README-zh.md index e7d14fe58..010ca799c 100644 --- a/README-zh.md +++ b/README-zh.md @@ -20,6 +20,8 @@ Dokploy 是一个免费的自托管平台即服务 (PaaS),它使用 Docker 和 [Deutsch](README-de.md) +[Русский Язык](README-ru.md) + diff --git a/README.md b/README.md index 623836007..ff142f1e7 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Dokploy is a free self-hostable Platform as a Service (PaaS) that simplifies the ## Explanation -[English](README.md) | [中文](README-zh.md) | [Deutsch](README-de.md) +[English](README.md) | [中文](README-zh.md) | [Deutsch](README-de.md) | [Русский Язык](README-ru.md) From 744f80070066732c6a9ffb4ce8160f53c3badb1c Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Thu, 16 May 2024 01:55:37 -0600 Subject: [PATCH 38/98] chore: remove --advertise-ip on swarm script --- docker/prod.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/prod.sh b/docker/prod.sh index 77513175b..4dc23da28 100644 --- a/docker/prod.sh +++ b/docker/prod.sh @@ -46,7 +46,7 @@ else fi docker swarm leave --force 2>/dev/null -docker swarm init --advertise-addr 127.0.0.1 --listen-addr 0.0.0.0; +docker swarm init; echo "Swarm initialized" From 42e9aa18349749feb7d7d66836a3a1916c3f6de7 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Thu, 16 May 2024 22:09:40 -0600 Subject: [PATCH 39/98] refactor: remove listen address of swarm initialize --- server/setup/setup.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/server/setup/setup.ts b/server/setup/setup.ts index c59877022..263865c95 100644 --- a/server/setup/setup.ts +++ b/server/setup/setup.ts @@ -5,10 +5,7 @@ export const initializeSwarm = async () => { if (swarmInitialized) { console.log("Swarm is already initilized"); } else { - await docker.swarmInit({ - AdvertiseAddr: "127.0.0.1", - ListenAddr: "0.0.0.0", - }); + await docker.swarmInit({}); console.log("Swarm was initilized"); } }; From b4c07ce6d169f6d092640dc5e2b9e7bb7a7f5eb6 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Fri, 17 May 2024 02:54:35 -0600 Subject: [PATCH 40/98] Update LICENSE.MD --- LICENSE.MD | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/LICENSE.MD b/LICENSE.MD index 9b02d8669..9c53a3bc0 100644 --- a/LICENSE.MD +++ b/LICENSE.MD @@ -1,3 +1,5 @@ +# License + Copyright 2024 Mauricio Siu. Licensed under the Apache License, Version 2.0 (the "License"); @@ -9,16 +11,13 @@ You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. +See the License for the specific language governing permissions and limitations under the License. -Appendix: +## Appendix -In cases of conflict, the provisions in this appendix supersede those in the general Apache License. +In the event of a conflict, the provisions in this appendix shall take precedence over those in the Apache License. -- **Modification of Paid Features:** Written consent or a formal agreement is required for modifying any paid features of Dokploy. -- **Prohibition of Unauthorized Resale:** No party is permitted to sell, resell, or otherwise distribute for commercial gain, the software or any of its components, including both original and modified versions, without prior written consent from the copyright holder. -- **Commercial Distribution:** Any distribution of Dokploy, whether for direct profit or indirect financial benefit, through commercial channels is strictly prohibited without a separate commercial agreement negotiated with the copyright holder. -- **Open Source Distribution of Free Features:** Any modifications to the free features of Dokploy must be distributed freely and must not be included in any paid or commercial package unless they comply with the license and appendix terms specified in this agreement. +- **Modification Distribution:** Any modifications to the software must be distributed freely. +- **Future Paid Features:** Any future paid features of Dokploy cannot be sold or offered as a service by any party other than the copyright holder without prior written consent. For further inquiries or permissions, please contact us directly. From 976d1f312f17e1aef4f8e7920e0d099d45a18a28 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Fri, 17 May 2024 02:56:50 -0600 Subject: [PATCH 41/98] feat: add table to show nodes and add dropdown to add manager & workers --- .../cluster/nodes/manager/add-manager.tsx | 49 +++++++ .../settings/cluster/nodes/show-node-data.tsx | 43 ++++++ .../settings/cluster/nodes/show-nodes.tsx | 131 ++++++++++++++++++ .../cluster/nodes/workers/add-worker.tsx | 47 +++++++ .../cluster/nodes/workers/delete-worker.tsx | 62 +++++++++ .../settings/cluster/worker/add-worker.tsx | 80 ----------- .../settings/cluster/worker/show-workers.tsx | 62 --------- pages/dashboard/settings/cluster.tsx | 5 +- server/api/routers/cluster.ts | 37 ++++- server/api/services/cluster.ts | 41 ++++++ 10 files changed, 409 insertions(+), 148 deletions(-) create mode 100644 components/dashboard/settings/cluster/nodes/manager/add-manager.tsx create mode 100644 components/dashboard/settings/cluster/nodes/show-node-data.tsx create mode 100644 components/dashboard/settings/cluster/nodes/show-nodes.tsx create mode 100644 components/dashboard/settings/cluster/nodes/workers/add-worker.tsx create mode 100644 components/dashboard/settings/cluster/nodes/workers/delete-worker.tsx delete mode 100644 components/dashboard/settings/cluster/worker/add-worker.tsx delete mode 100644 components/dashboard/settings/cluster/worker/show-workers.tsx create mode 100644 server/api/services/cluster.ts diff --git a/components/dashboard/settings/cluster/nodes/manager/add-manager.tsx b/components/dashboard/settings/cluster/nodes/manager/add-manager.tsx new file mode 100644 index 000000000..8c6b1db8c --- /dev/null +++ b/components/dashboard/settings/cluster/nodes/manager/add-manager.tsx @@ -0,0 +1,49 @@ +import { Button } from "@/components/ui/button"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/dialog"; +import { api } from "@/utils/api"; +import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; +export const AddManager = () => { + const { data } = api.cluster.addManager.useQuery(); + + return ( + <> + + + e.preventDefault()} + > + Add Manager + + + + + Add a new manager + Add a new manager + +
+ 1. Go to your new server and run the following command + + curl https://get.docker.com | sh -s -- --version 24.0 + +
+ +
+ + 2. Run the following command to add the node(server) to your + cluster + + {data} +
+
+
+ + ); +}; diff --git a/components/dashboard/settings/cluster/nodes/show-node-data.tsx b/components/dashboard/settings/cluster/nodes/show-node-data.tsx new file mode 100644 index 000000000..c597b9480 --- /dev/null +++ b/components/dashboard/settings/cluster/nodes/show-node-data.tsx @@ -0,0 +1,43 @@ +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/dialog"; +import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; + +interface Props { + data: unknown; +} + +export const ShowNodeData = ({ data }: Props) => { + return ( + + + e.preventDefault()} + > + View Config + + + + + Node Config + + See in detail the metadata of this node + + +
+ +
+							{JSON.stringify(data, null, 2)}
+						
+
+
+
+
+ ); +}; diff --git a/components/dashboard/settings/cluster/nodes/show-nodes.tsx b/components/dashboard/settings/cluster/nodes/show-nodes.tsx new file mode 100644 index 000000000..47cbee4c0 --- /dev/null +++ b/components/dashboard/settings/cluster/nodes/show-nodes.tsx @@ -0,0 +1,131 @@ +import React from "react"; +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from "@/components/ui/card"; +import { api } from "@/utils/api"; +import { AddWorker } from "./workers/add-worker"; +import { DateTooltip } from "@/components/shared/date-tooltip"; +import { Badge } from "@/components/ui/badge"; +import { DeleteWorker } from "./workers/delete-worker"; +import { + Table, + TableBody, + TableCaption, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "@/components/ui/table"; +import { MoreHorizontal, PlusIcon } from "lucide-react"; +import { Button } from "@/components/ui/button"; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuLabel, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu"; +import { ShowNodeData } from "./show-node-data"; +import { AddManager } from "./manager/add-manager"; + +export const ShowNodes = () => { + const { data, isLoading } = api.cluster.getNodes.useQuery(); + return ( + + +
+ Cluster + Add nodes to your cluster +
+
+ + + + + + Actions + + + + +
+
+ +
+ {isLoading &&
Loading...
} + + A list of your managers / workers. + + + Hostname + Status + Role + Availability + Engine Version + Created + + Actions + + + + {data?.map((node) => { + const isManager = node.Spec.Role === "manager"; + return ( + + + {node.Description.Hostname} + + + {node.Status.State} + + + + {node?.Spec?.Role} + + + + {node.Spec.Availability} + + + + {node?.Description.Engine.EngineVersion} + + + + + Created{" "} + + + + + + + + + Actions + + {!node?.ManagerStatus?.Leader && ( + + )} + + + + + ); + })} + +
+
+
+
+ ); +}; diff --git a/components/dashboard/settings/cluster/nodes/workers/add-worker.tsx b/components/dashboard/settings/cluster/nodes/workers/add-worker.tsx new file mode 100644 index 000000000..f05561581 --- /dev/null +++ b/components/dashboard/settings/cluster/nodes/workers/add-worker.tsx @@ -0,0 +1,47 @@ +import { Button } from "@/components/ui/button"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/dialog"; +import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; +import { api } from "@/utils/api"; + +export const AddWorker = () => { + const { data } = api.cluster.addWorker.useQuery(); + + return ( + + + e.preventDefault()} + > + Add Worker + + + + + Add a new worker + Add a new worker + +
+ 1. Go to your new server and run the following command + + curl https://get.docker.com | sh -s -- --version 24.0 + +
+ +
+ + 2. Run the following command to add the node(server) to your cluster + + {data} +
+
+
+ ); +}; diff --git a/components/dashboard/settings/cluster/nodes/workers/delete-worker.tsx b/components/dashboard/settings/cluster/nodes/workers/delete-worker.tsx new file mode 100644 index 000000000..2d3810ca8 --- /dev/null +++ b/components/dashboard/settings/cluster/nodes/workers/delete-worker.tsx @@ -0,0 +1,62 @@ +import React from "react"; +import { + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, + AlertDialogTrigger, +} from "@/components/ui/alert-dialog"; +import { Button } from "@/components/ui/button"; +import { api } from "@/utils/api"; +import { TrashIcon } from "lucide-react"; +import { toast } from "sonner"; +import { DropdownMenuItem } from "@/components/ui/dropdown-menu"; + +interface Props { + nodeId: string; +} +export const DeleteWorker = ({ nodeId }: Props) => { + const { mutateAsync, isLoading } = api.cluster.removeWorker.useMutation(); + const utils = api.useUtils(); + return ( + + + e.preventDefault()}> + Delete + + + + + Are you absolutely sure? + + This action cannot be undone. This will permanently delete the + worker. + + + + Cancel + { + await mutateAsync({ + nodeId, + }) + .then(async () => { + utils.cluster.getNodes.invalidate(); + toast.success("Worker deleted succesfully"); + }) + .catch(() => { + toast.error("Error to delete the worker"); + }); + }} + > + Confirm + + + + + ); +}; diff --git a/components/dashboard/settings/cluster/worker/add-worker.tsx b/components/dashboard/settings/cluster/worker/add-worker.tsx deleted file mode 100644 index 5a7bccaea..000000000 --- a/components/dashboard/settings/cluster/worker/add-worker.tsx +++ /dev/null @@ -1,80 +0,0 @@ -import { Button } from "@/components/ui/button"; -import { - Dialog, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogTitle, - DialogTrigger, -} from "@/components/ui/dialog"; -import { - Form, - FormControl, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "@/components/ui/form"; -import { Input } from "@/components/ui/input"; -import { Textarea } from "@/components/ui/textarea"; -import { api } from "@/utils/api"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { AlertTriangle, PlusIcon } from "lucide-react"; -import { useEffect } from "react"; -import { useForm } from "react-hook-form"; -import { toast } from "sonner"; -import { z } from "zod"; - -const AddWorkerSchema = z.object({ - name: z.string().min(1, { - message: "Name is required", - }), - description: z.string().optional(), -}); - -type AddWorker = z.infer; - -export const AddWorker = () => { - const utils = api.useUtils(); - - const { data, isLoading } = api.cluster.addWorker.useQuery(); - - return ( - - - - - - - Add a new worker - Add a new worker - - {/* {isError && ( -
- - - {error?.message} - -
- )} */} -
- 1. Go to your new server and run the following command - - curl https://get.docker.com | sh -s -- --version 24.0 - -
- -
- - 2. Run the following command to add the node(server) to your cluster - - {data} -
-
-
- ); -}; diff --git a/components/dashboard/settings/cluster/worker/show-workers.tsx b/components/dashboard/settings/cluster/worker/show-workers.tsx deleted file mode 100644 index 470ab86db..000000000 --- a/components/dashboard/settings/cluster/worker/show-workers.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import React from "react"; -import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle, -} from "@/components/ui/card"; - -import { api } from "@/utils/api"; -import { AddWorker } from "./add-worker"; -import { DateTooltip } from "@/components/shared/date-tooltip"; - -export const ShowCluster = () => { - const { data, isLoading } = api.cluster.getWorkers.useQuery(); - // console.log(data) - return ( - - -
- Cluster - Add nodes to your cluster -
- -
- -
- {isLoading &&
Loading...
} - {data?.map((worker, index) => ( -
- - {worker.Description.Hostname} - - - {worker.Status.State} - - - {worker.Spec.Availability} - - - {worker?.ManagerStatus?.Reachability || "-"} - - - {worker?.Spec?.Role} - - - - {worker?.Description.Engine.EngineVersion} - - - {/* Created */} - -
- ))} -
-
-
- ); -}; diff --git a/pages/dashboard/settings/cluster.tsx b/pages/dashboard/settings/cluster.tsx index d433e9020..969e97aaa 100644 --- a/pages/dashboard/settings/cluster.tsx +++ b/pages/dashboard/settings/cluster.tsx @@ -1,6 +1,5 @@ -import { ShowCertificates } from "@/components/dashboard/settings/certificates/show-certificates"; import { ShowRegistry } from "@/components/dashboard/settings/cluster/registry/show-registry"; -import { ShowCluster } from "@/components/dashboard/settings/cluster/worker/show-workers"; +import { ShowNodes } from "@/components/dashboard/settings/cluster/nodes/show-nodes"; import { DashboardLayout } from "@/components/layouts/dashboard-layout"; import { SettingsLayout } from "@/components/layouts/settings-layout"; import { validateRequest } from "@/server/auth/auth"; @@ -11,7 +10,7 @@ const Page = () => { return (
- +
); }; diff --git a/server/api/routers/cluster.ts b/server/api/routers/cluster.ts index 9a6ff6e7f..2e1d98261 100644 --- a/server/api/routers/cluster.ts +++ b/server/api/routers/cluster.ts @@ -1,17 +1,48 @@ import { docker } from "@/server/constants"; import { createTRPCRouter, protectedProcedure } from "../trpc"; import { getPublicIpWithFallback } from "@/server/wss/terminal"; +import type { DockerNode } from "../services/cluster"; +import { z } from "zod"; +import { TRPCError } from "@trpc/server"; +import { execAsync } from "@/server/utils/process/execAsync"; export const clusterRouter = createTRPCRouter({ - getWorkers: protectedProcedure.query(async () => { - const workers = await docker.listNodes(); - // console.log(workers); + getNodes: protectedProcedure.query(async () => { + const workers: DockerNode[] = await docker.listNodes(); + return workers; }), + removeWorker: protectedProcedure + .input( + z.object({ + nodeId: z.string(), + }), + ) + .mutation(async ({ input }) => { + try { + await execAsync( + `docker node update --availability drain ${input.nodeId}`, + ); + await execAsync(`docker node rm ${input.nodeId} --force`); + return true; + } catch (error) { + throw new TRPCError({ + code: "INTERNAL_SERVER_ERROR", + message: "Error to remove the node", + cause: error, + }); + } + }), addWorker: protectedProcedure.query(async ({ input }) => { const result = await docker.swarmInspect(); return `docker swarm join --token ${ result.JoinTokens.Worker } ${await getPublicIpWithFallback()}:2377`; }), + addManager: protectedProcedure.query(async ({ input }) => { + const result = await docker.swarmInspect(); + return `docker swarm join --token ${ + result.JoinTokens.Manager + } ${await getPublicIpWithFallback()}:2377`; + }), }); diff --git a/server/api/services/cluster.ts b/server/api/services/cluster.ts new file mode 100644 index 000000000..ea71d1aee --- /dev/null +++ b/server/api/services/cluster.ts @@ -0,0 +1,41 @@ +export interface DockerNode { + ID: string; + Version: { + Index: number; + }; + CreatedAt: string; + UpdatedAt: string; + Spec: { + Name: string; + Labels: Record; + Role: "worker" | "manager"; + Availability: "active" | "pause" | "drain"; + }; + Description: { + Hostname: string; + Platform: { + Architecture: string; + OS: string; + }; + Resources: { + NanoCPUs: number; + MemoryBytes: number; + }; + Engine: { + EngineVersion: string; + Plugins: Array<{ + Type: string; + Name: string; + }>; + }; + }; + Status: { + State: "unknown" | "down" | "ready" | "disconnected"; + Message: string; + Addr: string; + }; + ManagerStatus?: { + Leader: boolean; + Addr: string; + }; +} From d539b80ef786ca0ff1dfa448f376f18c3cece53f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E5=A4=B4981?= Date: Sat, 18 May 2024 11:43:52 +0800 Subject: [PATCH 42/98] fix: dashboard layout styles (#86) * fix: dashboard layout scroll * feat: dashboard nav style animation * chore: code input font * style: format code * pref: alert component extraction * fix: global font var not found * fix: code path beak line * chore: remove framer-motion * fix: status color --- .gitignore | 3 +- components/auth/login-2fa.tsx | 2 +- .../advanced/general/add-command.tsx | 6 +- .../application/advanced/ports/add-port.tsx | 17 +- .../advanced/ports/update-port.tsx | 12 +- .../advanced/redirects/add-redirect.tsx | 11 +- .../advanced/redirects/update-redirect.tsx | 12 +- .../advanced/security/add-security.tsx | 11 +- .../advanced/security/update-security.tsx | 12 +- .../traefik/update-traefik-config.tsx | 13 +- .../advanced/volumes/add-volumes.tsx | 2 +- .../application/domains/add-domain.tsx | 12 +- .../application/domains/update-domain.tsx | 12 +- .../application/environment/show.tsx | 2 +- .../application/update-application.tsx | 10 +- .../docker/config/show-container-config.tsx | 4 +- .../dashboard/docker/logs/docker-logs-id.tsx | 7 +- .../docker/terminal/docker-terminal-modal.tsx | 1 - .../docker/terminal/docker-terminal.tsx | 21 +- .../file-system/show-traefik-file.tsx | 21 +- .../file-system/show-traefik-system.tsx | 2 +- .../environment/show-mariadb-environment.tsx | 2 +- .../dashboard/mariadb/update-mariadb.tsx | 10 +- .../environment/show-mongo-environment.tsx | 2 +- components/dashboard/mongo/update-mongo.tsx | 10 +- .../environment/show-mysql-environment.tsx | 2 +- components/dashboard/mysql/update-mysql.tsx | 10 +- .../environment/show-postgres-environment.tsx | 2 +- .../dashboard/postgres/update-postgres.tsx | 10 +- .../dashboard/project/add-application.tsx | 12 +- components/dashboard/project/add-database.tsx | 2 +- components/dashboard/projects/add.tsx | 12 +- components/dashboard/projects/show.tsx | 6 +- components/dashboard/projects/update.tsx | 10 +- components/dashboard/redis/update-redis.tsx | 10 +- .../settings/certificates/add-certificate.tsx | 272 +++++++++--------- .../settings/destination/add-destination.tsx | 11 +- .../destination/update-destination.tsx | 12 +- .../settings/users/add-permissions.tsx | 12 +- .../dashboard/settings/users/add-user.tsx | 11 +- .../dashboard/settings/users/show-users.tsx | 2 +- .../dashboard/settings/users/update-user.tsx | 12 +- .../web-server/show-main-traefik-config.tsx | 17 +- .../show-server-middleware-config.tsx | 17 +- .../web-server/show-server-traefik-config.tsx | 17 +- components/layouts/dashboard-layout.tsx | 16 +- components/layouts/navbar.tsx | 2 +- components/layouts/navigation-tabs.tsx | 135 +++++---- components/shared/alert-block.tsx | 51 ++++ components/shared/status-tooltip.tsx | 8 +- components/ui/alert.tsx | 59 ++++ components/ui/file-tree.tsx | 4 +- package.json | 4 +- pages/_app.tsx | 59 ++-- pages/_document.tsx | 15 +- styles/globals.css | 5 - tailwind.config.ts | 4 + 57 files changed, 502 insertions(+), 536 deletions(-) create mode 100644 components/shared/alert-block.tsx create mode 100644 components/ui/alert.tsx diff --git a/.gitignore b/.gitignore index bfbda236c..61e009710 100644 --- a/.gitignore +++ b/.gitignore @@ -53,4 +53,5 @@ yarn-error.log* /.data /.main -*.lockb \ No newline at end of file +*.lockb +*.rdb diff --git a/components/auth/login-2fa.tsx b/components/auth/login-2fa.tsx index 17b2d483e..6bf03d0c3 100644 --- a/components/auth/login-2fa.tsx +++ b/components/auth/login-2fa.tsx @@ -61,7 +61,7 @@ export const Login2FA = ({ authId }: Props) => { id: authId, }) .then(() => { - toast.success("Signin succesfully", { + toast.success("Signin successfully", { duration: 2000, }); diff --git a/components/dashboard/application/advanced/general/add-command.tsx b/components/dashboard/application/advanced/general/add-command.tsx index b7de2ae62..a898607d7 100644 --- a/components/dashboard/application/advanced/general/add-command.tsx +++ b/components/dashboard/application/advanced/general/add-command.tsx @@ -26,11 +26,11 @@ interface Props { applicationId: string; } -const AddRedirectchema = z.object({ +const AddRedirectSchema = z.object({ command: z.string(), }); -type AddCommand = z.infer; +type AddCommand = z.infer; export const AddCommand = ({ applicationId }: Props) => { const { data } = api.application.one.useQuery( @@ -48,7 +48,7 @@ export const AddCommand = ({ applicationId }: Props) => { defaultValues: { command: "", }, - resolver: zodResolver(AddRedirectchema), + resolver: zodResolver(AddRedirectSchema), }); useEffect(() => { diff --git a/components/dashboard/application/advanced/ports/add-port.tsx b/components/dashboard/application/advanced/ports/add-port.tsx index ceb9657cb..52b303a57 100644 --- a/components/dashboard/application/advanced/ports/add-port.tsx +++ b/components/dashboard/application/advanced/ports/add-port.tsx @@ -18,8 +18,8 @@ import { } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; import { api } from "@/utils/api"; +import { AlertBlock } from "@/components/shared/alert-block"; import { zodResolver } from "@hookform/resolvers/zod"; -import { AlertTriangle } from "lucide-react"; import { useEffect } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; @@ -33,7 +33,7 @@ import { } from "@/components/ui/select"; import { z } from "zod"; -const AddPortchema = z.object({ +const AddPortSchema = z.object({ publishedPort: z.number().int().min(1).max(65535), targetPort: z.number().int().min(1).max(65535), protocol: z.enum(["tcp", "udp"], { @@ -41,7 +41,7 @@ const AddPortchema = z.object({ }), }); -type AddPort = z.infer; +type AddPort = z.infer; interface Props { applicationId: string; @@ -62,7 +62,7 @@ export const AddPort = ({ publishedPort: 0, targetPort: 0, }, - resolver: zodResolver(AddPortchema), + resolver: zodResolver(AddPortSchema), }); useEffect(() => { @@ -100,14 +100,7 @@ export const AddPort = ({ Ports are used to expose your application to the internet. - {isError && ( -
- - - {error?.message} - -
- )} + {isError && {error?.message}}
{ Update Update the port - {isError && ( -
- - - {error?.message} - -
- )} + {isError && {error?.message}} - {isError && ( -
- - - {error?.message} - -
- )} + {isError && {error?.message}} { Update Update the redirect - {isError && ( -
- - - {error?.message} - -
- )} + {isError && {error?.message}} - {isError && ( -
- - - {error?.message} - -
- )} + {isError && {error?.message}} { Update Update the security - {isError && ( -
- - - {error?.message} - -
- )} + {isError && {error?.message}} { Update traefik config Update the traefik config - {isError && ( -
- - - {error?.message} - -
- )} + {isError && {error?.message}} { Traefik config