anything-llm/server/prisma/migrations/20240510032311_init/migration.sql
Sean Hatfield d36c3ff8b2
[FEAT] Slash templates (#1314)
* WIP slash presets

* WIP slash command customization CRUD + validations complete

* backend slash command support

* fix permission setting on new slash commands
rework form submit and pattern on frontend

* Add field updates for hooks,
required=true to field
add user<>command constraint to keep them unique
enforce uniquness via teritary uid field on table for multi and non-multi user

* reset migration

---------

Co-authored-by: timothycarambat <rambat1010@gmail.com>
2024-05-10 12:35:33 -07:00

16 lines
644 B
SQL

-- CreateTable
CREATE TABLE "slash_command_presets" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"command" TEXT NOT NULL,
"prompt" TEXT NOT NULL,
"description" TEXT NOT NULL,
"uid" INTEGER NOT NULL DEFAULT 0,
"userId" INTEGER,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"lastUpdatedAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "slash_command_presets_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);
-- CreateIndex
CREATE UNIQUE INDEX "slash_command_presets_uid_command_key" ON "slash_command_presets"("uid", "command");