Initial commit - Sitemap Builder app
This commit is contained in:
58
prisma/migrations/20260108174524_init/migration.sql
Normal file
58
prisma/migrations/20260108174524_init/migration.sql
Normal file
@@ -0,0 +1,58 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "Project" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"name" TEXT NOT NULL,
|
||||
"thumbnail" TEXT,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "Node" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"projectId" TEXT NOT NULL,
|
||||
"type" TEXT NOT NULL DEFAULT 'page',
|
||||
"title" TEXT NOT NULL DEFAULT 'Nowa strona',
|
||||
"content" TEXT,
|
||||
"notes" TEXT,
|
||||
"status" TEXT NOT NULL DEFAULT 'draft',
|
||||
"positionX" REAL NOT NULL DEFAULT 0,
|
||||
"positionY" REAL NOT NULL DEFAULT 0,
|
||||
"width" REAL,
|
||||
"height" REAL,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL,
|
||||
CONSTRAINT "Node_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project" ("id") ON DELETE CASCADE ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "Edge" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"projectId" TEXT NOT NULL,
|
||||
"sourceId" TEXT NOT NULL,
|
||||
"targetId" TEXT NOT NULL,
|
||||
"type" TEXT NOT NULL DEFAULT 'default',
|
||||
CONSTRAINT "Edge_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project" ("id") ON DELETE CASCADE ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "Attachment" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"nodeId" TEXT NOT NULL,
|
||||
"filename" TEXT NOT NULL,
|
||||
"originalName" TEXT NOT NULL,
|
||||
"mimeType" TEXT NOT NULL,
|
||||
"size" INTEGER NOT NULL,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
CONSTRAINT "Attachment_nodeId_fkey" FOREIGN KEY ("nodeId") REFERENCES "Node" ("id") ON DELETE CASCADE ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "Link" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"nodeId" TEXT NOT NULL,
|
||||
"url" TEXT NOT NULL,
|
||||
"label" TEXT,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
CONSTRAINT "Link_nodeId_fkey" FOREIGN KEY ("nodeId") REFERENCES "Node" ("id") ON DELETE CASCADE ON UPDATE CASCADE
|
||||
);
|
||||
@@ -0,0 +1,6 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "Project" ADD COLUMN "colorPalette" TEXT;
|
||||
ALTER TABLE "Project" ADD COLUMN "designNotes" TEXT;
|
||||
ALTER TABLE "Project" ADD COLUMN "fontPrimary" TEXT;
|
||||
ALTER TABLE "Project" ADD COLUMN "fontSecondary" TEXT;
|
||||
ALTER TABLE "Project" ADD COLUMN "globalNotes" TEXT;
|
||||
3
prisma/migrations/migration_lock.toml
Normal file
3
prisma/migrations/migration_lock.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
# Please do not edit this file manually
|
||||
# It should be added in your version-control system (e.g., Git)
|
||||
provider = "sqlite"
|
||||
74
prisma/schema.prisma
Normal file
74
prisma/schema.prisma
Normal file
@@ -0,0 +1,74 @@
|
||||
// This is your Prisma schema file,
|
||||
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "sqlite"
|
||||
}
|
||||
|
||||
model Project {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
thumbnail String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
// Design settings for handoff
|
||||
globalNotes String? // Global project notes
|
||||
fontPrimary String? // Primary font name
|
||||
fontSecondary String? // Secondary font name
|
||||
colorPalette String? // JSON array of colors
|
||||
designNotes String? // Additional design notes (WordPress specifics, etc.)
|
||||
nodes Node[]
|
||||
edges Edge[]
|
||||
}
|
||||
|
||||
model Node {
|
||||
id String @id @default(cuid())
|
||||
projectId String
|
||||
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
|
||||
type String @default("page")
|
||||
title String @default("Nowa strona")
|
||||
content String? // Rich text content
|
||||
notes String? // Developer notes
|
||||
status String @default("draft") // draft, ready, review
|
||||
positionX Float @default(0)
|
||||
positionY Float @default(0)
|
||||
width Float?
|
||||
height Float?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
attachments Attachment[]
|
||||
links Link[]
|
||||
}
|
||||
|
||||
model Edge {
|
||||
id String @id @default(cuid())
|
||||
projectId String
|
||||
project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
|
||||
sourceId String
|
||||
targetId String
|
||||
type String @default("default")
|
||||
}
|
||||
|
||||
model Attachment {
|
||||
id String @id @default(cuid())
|
||||
nodeId String
|
||||
node Node @relation(fields: [nodeId], references: [id], onDelete: Cascade)
|
||||
filename String // Stored filename
|
||||
originalName String // Original upload name
|
||||
mimeType String
|
||||
size Int
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model Link {
|
||||
id String @id @default(cuid())
|
||||
nodeId String
|
||||
node Node @relation(fields: [nodeId], references: [id], onDelete: Cascade)
|
||||
url String
|
||||
label String?
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
Reference in New Issue
Block a user