-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from sugarforever/feature/multi-files-knowledge…
…base multi-files knowledgebase support
- Loading branch information
Showing
7 changed files
with
107 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
prisma/migrations/20240305202320_knowlegebase_files/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `filename` on the `KnowledgeBase` table. All the data in the column will be lost. | ||
*/ | ||
-- CreateTable | ||
CREATE TABLE "KnowledgeBaseFile" ( | ||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
"url" TEXT NOT NULL, | ||
"knowledgeBaseId" INTEGER NOT NULL, | ||
CONSTRAINT "KnowledgeBaseFile_knowledgeBaseId_fkey" FOREIGN KEY ("knowledgeBaseId") REFERENCES "KnowledgeBase" ("id") ON DELETE RESTRICT ON UPDATE CASCADE | ||
); | ||
|
||
-- RedefineTables | ||
PRAGMA foreign_keys=OFF; | ||
CREATE TABLE "new_KnowledgeBase" ( | ||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
"name" TEXT NOT NULL, | ||
"embedding" TEXT, | ||
"description" TEXT, | ||
"created" DATETIME, | ||
"updated" DATETIME | ||
); | ||
INSERT INTO "new_KnowledgeBase" ("created", "description", "embedding", "id", "name", "updated") SELECT "created", "description", "embedding", "id", "name", "updated" FROM "KnowledgeBase"; | ||
DROP TABLE "KnowledgeBase"; | ||
ALTER TABLE "new_KnowledgeBase" RENAME TO "KnowledgeBase"; | ||
CREATE UNIQUE INDEX "KnowledgeBase_name_key" ON "KnowledgeBase"("name"); | ||
PRAGMA foreign_key_check; | ||
PRAGMA foreign_keys=ON; |
13 changes: 13 additions & 0 deletions
13
prisma/migrations/20240305205052_files_cascade_deletion/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
-- RedefineTables | ||
PRAGMA foreign_keys=OFF; | ||
CREATE TABLE "new_KnowledgeBaseFile" ( | ||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
"url" TEXT NOT NULL, | ||
"knowledgeBaseId" INTEGER NOT NULL, | ||
CONSTRAINT "KnowledgeBaseFile_knowledgeBaseId_fkey" FOREIGN KEY ("knowledgeBaseId") REFERENCES "KnowledgeBase" ("id") ON DELETE CASCADE ON UPDATE CASCADE | ||
); | ||
INSERT INTO "new_KnowledgeBaseFile" ("id", "knowledgeBaseId", "url") SELECT "id", "knowledgeBaseId", "url" FROM "KnowledgeBaseFile"; | ||
DROP TABLE "KnowledgeBaseFile"; | ||
ALTER TABLE "new_KnowledgeBaseFile" RENAME TO "KnowledgeBaseFile"; | ||
PRAGMA foreign_key_check; | ||
PRAGMA foreign_keys=ON; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"functions": { | ||
"server/api/**/*.ts": { | ||
"maxDuration": 60 | ||
"maxDuration": 10 | ||
} | ||
} | ||
} |