Add scheduled automatic content drafts with Codex and image automation
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "PageContentAutomation" (
|
||||
"id" TEXT NOT NULL,
|
||||
"pageId" TEXT NOT NULL,
|
||||
"requestedById" TEXT NOT NULL,
|
||||
"enabled" BOOLEAN NOT NULL DEFAULT false,
|
||||
"weekdays" INTEGER[] DEFAULT ARRAY[1, 2, 3, 4, 5]::INTEGER[],
|
||||
"times" TEXT[] DEFAULT ARRAY['09:00']::TEXT[],
|
||||
"brief" TEXT NOT NULL DEFAULT '',
|
||||
"targets" "Platform"[] DEFAULT ARRAY['FACEBOOK']::"Platform"[],
|
||||
"nextRunAt" TIMESTAMP(3),
|
||||
"lastQueuedAt" TIMESTAMP(3),
|
||||
"lastError" TEXT,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "PageContentAutomation_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "PageContentAutomation_pageId_key" ON "PageContentAutomation"("pageId");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "PageContentAutomation_enabled_nextRunAt_idx" ON "PageContentAutomation"("enabled", "nextRunAt");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "PageContentAutomation" ADD CONSTRAINT "PageContentAutomation_pageId_fkey" FOREIGN KEY ("pageId") REFERENCES "Page"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "PageContentAutomation" ADD CONSTRAINT "PageContentAutomation_requestedById_fkey" FOREIGN KEY ("requestedById") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
Reference in New Issue
Block a user