Skip to content

Commit b3cbc86

Browse files
feat(dashboard): add migration file
1 parent 2780678 commit b3cbc86

File tree

1 file changed

+22
-0
lines changed
  • packages/db/prisma/migrations/20251029161715_add_share_dashboard

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
-- CreateTable
2+
CREATE TABLE "shares_dashboards" (
3+
"id" TEXT NOT NULL,
4+
"dashboardId" TEXT NOT NULL,
5+
"organizationId" TEXT NOT NULL,
6+
"public" BOOLEAN NOT NULL DEFAULT false,
7+
"password" TEXT,
8+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
9+
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP
10+
);
11+
12+
-- CreateIndex
13+
CREATE UNIQUE INDEX "shares_dashboards_id_key" ON "shares_dashboards"("id");
14+
15+
-- CreateIndex
16+
CREATE UNIQUE INDEX "shares_dashboards_dashboardId_key" ON "shares_dashboards"("dashboardId");
17+
18+
-- AddForeignKey
19+
ALTER TABLE "shares_dashboards" ADD CONSTRAINT "shares_dashboards_dashboardId_fkey" FOREIGN KEY ("dashboardId") REFERENCES "dashboards"("id") ON DELETE CASCADE ON UPDATE CASCADE;
20+
21+
-- AddForeignKey
22+
ALTER TABLE "shares_dashboards" ADD CONSTRAINT "shares_dashboards_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "organizations"("id") ON DELETE CASCADE ON UPDATE CASCADE;

0 commit comments

Comments
 (0)