Skip to content

Commit

Permalink
rename to budgetfilter
Browse files Browse the repository at this point in the history
  • Loading branch information
Hbbb committed Feb 6, 2024
1 parent add368a commit 8e8254b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
Warnings:
- You are about to drop the `BudgetRule` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
PRAGMA foreign_keys=off;
DROP TABLE "BudgetRule";
PRAGMA foreign_keys=on;

-- CreateTable
CREATE TABLE "BudgetFilter" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"budgetId" INTEGER NOT NULL,
"column" TEXT NOT NULL,
"operator" TEXT NOT NULL DEFAULT 'CONTAINS',
"value" TEXT NOT NULL,
CONSTRAINT "BudgetFilter_budgetId_fkey" FOREIGN KEY ("budgetId") REFERENCES "Budget" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
12 changes: 6 additions & 6 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ model AccountBalance {
}

model Budget {
id Int @id @default(autoincrement())
name String
amount Float
range Int
budgetRules BudgetRule[]
id Int @id @default(autoincrement())
name String
amount Float
range Int
budgetFilters BudgetFilter[]
}

model BudgetRule {
model BudgetFilter {
id Int @id @default(autoincrement())
budget Budget @relation(fields: [budgetId], references: [id])
budgetId Int
Expand Down

0 comments on commit 8e8254b

Please sign in to comment.