mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-22 15:41:48 +03:00
3c01d944fb
fix CLOUD-19
16 lines
495 B
SQL
16 lines
495 B
SQL
-- CreateEnum
|
|
CREATE TYPE "AiPromptRole" AS ENUM ('system', 'assistant', 'user');
|
|
|
|
-- CreateTable
|
|
CREATE TABLE "ai_prompts" (
|
|
"id" VARCHAR NOT NULL,
|
|
"name" VARCHAR(20) NOT NULL,
|
|
"idx" INTEGER NOT NULL,
|
|
"role" "AiPromptRole" NOT NULL,
|
|
"content" TEXT NOT NULL,
|
|
"created_at" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
CONSTRAINT "ai_prompts_pkey" PRIMARY KEY ("id")
|
|
);
|
|
|
|
-- CreateIndex
|
|
CREATE UNIQUE INDEX "ai_prompts_name_idx_key" ON "ai_prompts"("name", "idx"); |