mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-23 05:42:30 +03:00
16 lines
495 B
MySQL
16 lines
495 B
MySQL
|
-- 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");
|