Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(prisma): Set default Donation Type to donation #635

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
import { DonationType } from '@prisma/client'
import { ApiProperty } from '@nestjs/swagger'

export class CreateDonationDto {
@ApiProperty({ enum: DonationType })
type: DonationType
}
export class CreateDonationDto {}
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
import { DonationType } from '@prisma/client'
import { ApiProperty } from '@nestjs/swagger'

export class UpdateDonationDto {
@ApiProperty({ enum: DonationType })
type?: DonationType
}
export class UpdateDonationDto {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "donations" ALTER COLUMN "type" SET DEFAULT 'donation';
2 changes: 1 addition & 1 deletion podkrepi.dbml
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ Table payments {
Table donations {
id String [pk]
paymentId String [not null]
type DonationType [not null]
type DonationType [not null, default: 'donation']
targetVaultId String [not null, note: 'Vault where the funds are going']
amount Int [not null, default: 0]
personId String
Expand Down
2 changes: 1 addition & 1 deletion schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ model Donation {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid

paymentId String @map("payment_id") @db.Uuid
type DonationType
type DonationType @default(donation)
/// Vault where the funds are going
targetVaultId String @map("target_vault_id") @db.Uuid
amount Int @default(0)
Expand Down
Loading