-- CreateTable
CREATE TABLE "actuate_page_templates" (
    "id" TEXT NOT NULL,
    "name" TEXT NOT NULL,
    "description" TEXT,
    "category" TEXT NOT NULL DEFAULT 'content',
    "tree" JSONB NOT NULL,
    "thumbnail" TEXT,
    "builtIn" BOOLEAN NOT NULL DEFAULT false,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,

    CONSTRAINT "actuate_page_templates_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "actuate_saved_sections" (
    "id" TEXT NOT NULL,
    "name" TEXT NOT NULL,
    "description" TEXT,
    "category" TEXT NOT NULL DEFAULT 'content',
    "tree" JSONB NOT NULL,
    "thumbnail" TEXT,
    "usageCount" INTEGER NOT NULL DEFAULT 0,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,

    CONSTRAINT "actuate_saved_sections_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE INDEX "actuate_page_templates_category_idx" ON "actuate_page_templates"("category");

-- CreateIndex
CREATE INDEX "actuate_page_templates_builtIn_idx" ON "actuate_page_templates"("builtIn");

-- CreateIndex
CREATE INDEX "actuate_saved_sections_category_idx" ON "actuate_saved_sections"("category");
