-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#10 Refactoring to support Global keys
- Loading branch information
Showing
17 changed files
with
255 additions
and
180 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
prisma/migrations/20240204202910_use_accounts_instead_of_credentials/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,39 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `credentialsOwner` on the `Assistant` table. All the data in the column will be lost. | ||
- You are about to drop the column `credentialsOwnerType` on the `Assistant` table. All the data in the column will be lost. | ||
- You are about to drop the `Credentials` table. If the table is not empty, all the data it contains will be lost. | ||
- Added the required column `limitRunsPerDay` to the `Assistant` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `limitThreadsPerDay` to the `Assistant` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "Assistant" DROP CONSTRAINT "Assistant_credentialsOwner_credentialsOwnerType_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Assistant" DROP COLUMN "credentialsOwner", | ||
DROP COLUMN "credentialsOwnerType", | ||
ADD COLUMN "accountOwner" TEXT, | ||
ADD COLUMN "accountOwnerType" TEXT, | ||
ADD COLUMN "extendedAssistant" JSONB, | ||
ADD COLUMN "limitRunsPerDay" INTEGER NOT NULL, | ||
ADD COLUMN "limitThreadsPerDay" INTEGER NOT NULL; | ||
|
||
-- DropTable | ||
DROP TABLE "Credentials"; | ||
|
||
-- CreateTable | ||
CREATE TABLE "Account" ( | ||
"owner" TEXT NOT NULL, | ||
"ownerType" TEXT NOT NULL DEFAULT 'personal', | ||
"openAIApiKey" TEXT NOT NULL, | ||
"assistantsPerAccount" INTEGER NOT NULL, | ||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updated_at" TIMESTAMP(3) NOT NULL, | ||
|
||
CONSTRAINT "Account_pkey" PRIMARY KEY ("owner","ownerType") | ||
); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Assistant" ADD CONSTRAINT "Assistant_accountOwner_accountOwnerType_fkey" FOREIGN KEY ("accountOwner", "accountOwnerType") REFERENCES "Account"("owner", "ownerType") ON DELETE SET NULL ON UPDATE CASCADE; |
9 changes: 9 additions & 0 deletions
9
prisma/migrations/20240204204409_use_consistent_names_for_limits/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,9 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `assistantsPerAccount` on the `Account` table. All the data in the column will be lost. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "Account" DROP COLUMN "assistantsPerAccount", | ||
ADD COLUMN "limitAssistants" INTEGER NOT NULL DEFAULT 2; |
9 changes: 9 additions & 0 deletions
9
prisma/migrations/20240204204845_using_modified_name_for_open_ai_objects/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,9 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `extendedAssistant` on the `Assistant` table. All the data in the column will be lost. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "Assistant" DROP COLUMN "extendedAssistant", | ||
ADD COLUMN "object" JSONB; |
10 changes: 10 additions & 0 deletions
10
prisma/migrations/20240205001258_removing_the_thread_limits/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,10 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `limitRunsPerDay` on the `Assistant` table. All the data in the column will be lost. | ||
- You are about to drop the column `limitThreadsPerDay` on the `Assistant` table. All the data in the column will be lost. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "Assistant" DROP COLUMN "limitRunsPerDay", | ||
DROP COLUMN "limitThreadsPerDay"; |
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
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
Oops, something went wrong.