mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-15 20:25:23 +02:00
feat(database): add project_tag and tag tables with foreign key constraints
- Introduced new SQL migration to create 'project_tag' and 'tag' tables. - Added unique constraints and foreign key relationships to ensure data integrity. - Updated journal and snapshot metadata to reflect the new migration.
This commit is contained in:
@@ -15,7 +15,6 @@ import { toast } from "sonner";
|
||||
import { BreadcrumbSidebar } from "@/components/shared/breadcrumb-sidebar";
|
||||
import { DateTooltip } from "@/components/shared/date-tooltip";
|
||||
import { FocusShortcutInput } from "@/components/shared/focus-shortcut-input";
|
||||
import { StatusTooltip } from "@/components/shared/status-tooltip";
|
||||
import { TagBadge } from "@/components/shared/tag-badge";
|
||||
import { TagFilter } from "@/components/shared/tag-filter";
|
||||
import {
|
||||
|
||||
19
apps/dokploy/drizzle/0152_odd_firelord.sql
Normal file
19
apps/dokploy/drizzle/0152_odd_firelord.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
CREATE TABLE "project_tag" (
|
||||
"id" text PRIMARY KEY NOT NULL,
|
||||
"projectId" text NOT NULL,
|
||||
"tagId" text NOT NULL,
|
||||
CONSTRAINT "unique_project_tag" UNIQUE("projectId","tagId")
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE "tag" (
|
||||
"tagId" text PRIMARY KEY NOT NULL,
|
||||
"name" text NOT NULL,
|
||||
"color" text,
|
||||
"createdAt" text NOT NULL,
|
||||
"organizationId" text NOT NULL,
|
||||
CONSTRAINT "unique_org_tag_name" UNIQUE("organizationId","name")
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "project_tag" ADD CONSTRAINT "project_tag_projectId_project_projectId_fk" FOREIGN KEY ("projectId") REFERENCES "public"."project"("projectId") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||
ALTER TABLE "project_tag" ADD CONSTRAINT "project_tag_tagId_tag_tagId_fk" FOREIGN KEY ("tagId") REFERENCES "public"."tag"("tagId") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||
ALTER TABLE "tag" ADD CONSTRAINT "tag_organizationId_organization_id_fk" FOREIGN KEY ("organizationId") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;
|
||||
7855
apps/dokploy/drizzle/meta/0152_snapshot.json
Normal file
7855
apps/dokploy/drizzle/meta/0152_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1065,6 +1065,13 @@
|
||||
"when": 1773872561300,
|
||||
"tag": "0151_modern_sunfire",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 152,
|
||||
"version": "7",
|
||||
"when": 1773903778014,
|
||||
"tag": "0152_odd_firelord",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import superjson from "superjson";
|
||||
import { TagManager } from "@/components/dashboard/settings/tags/tag-manager";
|
||||
import { DashboardLayout } from "@/components/layouts/dashboard-layout";
|
||||
import { appRouter } from "@/server/api/root";
|
||||
import { getLocale, serverSideTranslations } from "@/utils/i18n";
|
||||
|
||||
const Page = () => {
|
||||
return (
|
||||
@@ -26,7 +25,6 @@ export async function getServerSideProps(
|
||||
) {
|
||||
const { req, res } = ctx;
|
||||
const { user, session } = await validateRequest(req);
|
||||
const locale = getLocale(req.cookies);
|
||||
|
||||
const helpers = createServerSideHelpers({
|
||||
router: appRouter,
|
||||
@@ -55,7 +53,6 @@ export async function getServerSideProps(
|
||||
return {
|
||||
props: {
|
||||
trpcState: helpers.dehydrate(),
|
||||
...(await serverSideTranslations(locale, ["settings"])),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user