diff options
| author | Chris Johnston <christopher_johnston@me.com> | 2024-01-08 19:26:44 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-08 14:26:44 -0500 |
| commit | bec1dd270a1d3184ea13f0b849f192176354fc00 (patch) | |
| tree | ebb50246aad6c0562ae892d1729c4eda94ad6ffd /prisma | |
| parent | 4566900f9cfcc837e56c590c9344d09a4bc50820 (diff) | |
Add Expense Date (#26)
* add expense date
* Improve date formatting
* Prettier
* Change field description
---------
Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
Diffstat (limited to 'prisma')
| -rw-r--r-- | prisma/migrations/20240108174319_add_expense_date/migration.sql | 2 | ||||
| -rw-r--r-- | prisma/schema.prisma | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/prisma/migrations/20240108174319_add_expense_date/migration.sql b/prisma/migrations/20240108174319_add_expense_date/migration.sql new file mode 100644 index 0000000..0b6de90 --- /dev/null +++ b/prisma/migrations/20240108174319_add_expense_date/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "Expense" ADD COLUMN "expenseDate" DATE NOT NULL DEFAULT CURRENT_DATE; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index fd65754..42d4cfc 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -32,6 +32,7 @@ model Participant { model Expense { id String @id group Group @relation(fields: [groupId], references: [id], onDelete: Cascade) + expenseDate DateTime @db.Date @default(dbgenerated("CURRENT_DATE")) title String amount Int paidBy Participant @relation(fields: [paidById], references: [id], onDelete: Cascade) |
