Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

chore(db): drop legacy `pricings` table, replaced by `models` (#2256)

Marc Klingen4266b46dd942
diff --git a/packages/shared/prisma/generated/types.ts b/packages/shared/prisma/generated/types.ts
index 3c4ea7e349..2541d46613 100644
--- a/packages/shared/prisma/generated/types.ts
+++ b/packages/shared/prisma/generated/types.ts
@@ -36,17 +36,6 @@ export const ScoreDataType = {
BOOLEAN: "BOOLEAN"
} as const;
export type ScoreDataType = (typeof ScoreDataType)[keyof typeof ScoreDataType];
-export const PricingUnit = {
- PER_1000_TOKENS: "PER_1000_TOKENS",
- PER_1000_CHARS: "PER_1000_CHARS"
-} as const;
-export type PricingUnit = (typeof PricingUnit)[keyof typeof PricingUnit];
-export const TokenType = {
- PROMPT: "PROMPT",
- COMPLETION: "COMPLETION",
- TOTAL: "TOTAL"
-} as const;
-export type TokenType = (typeof TokenType)[keyof typeof TokenType];
export const DatasetStatus = {
ACTIVE: "ACTIVE",
ARCHIVED: "ARCHIVED"
@@ -310,14 +299,6 @@ export type PosthogIntegration = {
enabled: boolean;
created_at: Generated<Timestamp>;
};
-export type Pricing = {
- id: string;
- model_name: string;
- pricing_unit: Generated<PricingUnit>;
- price: string;
- currency: Generated<string>;
- token_type: TokenType;
-};
export type Project = {
id: string;
created_at: Generated<Timestamp>;
@@ -471,7 +452,6 @@ export type DB = {
observations: Observation;
observations_view: ObservationView;
posthog_integrations: PosthogIntegration;
- pricings: Pricing;
project_memberships: ProjectMembership;
projects: Project;
prompts: Prompt;
diff --git a/packages/shared/prisma/migrations/20240606093356_drop_unused_pricings_table/migration.sql b/packages/shared/prisma/migrations/20240606093356_drop_unused_pricings_table/migration.sql
new file mode 100644
index 0000000000..5a933fcebb
--- /dev/null
+++ b/packages/shared/prisma/migrations/20240606093356_drop_unused_pricings_table/migration.sql
@@ -0,0 +1,14 @@
+/*
+ Warnings:
+
+ - You are about to drop the `pricings` table. If the table is not empty, all the data it contains will be lost.
+
+*/
+-- DropTable
+DROP TABLE "pricings";
+
+-- DropEnum
+DROP TYPE "PricingUnit";
+
+-- DropEnum
+DROP TYPE "TokenType";
diff --git a/packages/shared/prisma/schema.prisma b/packages/shared/prisma/schema.prisma
index 9de374efc0..678cbab8f9 100644
--- a/packages/shared/prisma/schema.prisma
+++ b/packages/shared/prisma/schema.prisma
@@ -467,29 +467,6 @@ enum ScoreDataType {
BOOLEAN
}
-enum PricingUnit {
- PER_1000_TOKENS
- PER_1000_CHARS
-}
-
-enum TokenType {
- PROMPT
- COMPLETION
- TOTAL
-}
-
-model Pricing {
- id String @id @default(cuid())
- modelName String @map("model_name")
- pricingUnit PricingUnit @default(PER_1000_TOKENS) @map("pricing_unit")
- price Decimal
- currency String @default("USD")
- tokenType TokenType @map("token_type")
-
- @@index(modelName)
- @@map("pricings")
-}
-
model CronJobs {
name String @id
lastRun DateTime? @map("last_run")