From ac62c0950b6aece8421dd7fd88dc5b8b6cc7057a Mon Sep 17 00:00:00 2001 From: Mahdi Date: Thu, 31 Oct 2024 19:26:36 +0330 Subject: [PATCH 1/2] Change budget default value --- prisma/schema.prisma | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index b98e4c7..f39c7a1 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -10,7 +10,7 @@ generator client { model User { id Int @id @default(autoincrement()) - budget Int @default(2000000) // 2M In OP + budget Int @default(1100000) // 1.1M In OP address String @unique() smartaddress String? @unique() ballotSuccess Int? @map("ballot_success") From 849704c61fd88a6b580af34d31a25b718bfe346e Mon Sep 17 00:00:00 2001 From: Mahdi Date: Sat, 9 Nov 2024 12:27:22 +0330 Subject: [PATCH 2/2] Add migration file --- .../migrations/20241031160035_/migration.sql | 2 ++ src/flow/flow.controller.ts | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 prisma/migrations/20241031160035_/migration.sql diff --git a/prisma/migrations/20241031160035_/migration.sql b/prisma/migrations/20241031160035_/migration.sql new file mode 100644 index 0000000..cdb18de --- /dev/null +++ b/prisma/migrations/20241031160035_/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "User" ALTER COLUMN "budget" SET DEFAULT 1100000; diff --git a/src/flow/flow.controller.ts b/src/flow/flow.controller.ts index 403d6ad..845d2ce 100644 --- a/src/flow/flow.controller.ts +++ b/src/flow/flow.controller.ts @@ -1277,5 +1277,29 @@ export class FlowController { await this.prismaService.projectCoI.deleteMany({ where: { userId: userId }, }); + await this.prismaService.budgetDelegation.findUnique({ + where: { userId: userId }, + }); + await this.prismaService.collectionDelegation.deleteMany({ + where: { userId: userId }, + }); + await this.prismaService.farcasterConnection.deleteMany({ + where: { userId: userId }, + }); + await this.prismaService.share.deleteMany({ + where: { userId: userId }, + }); + await this.prismaService.userAttestation.deleteMany({ + where: { userId: userId }, + }); + await this.prismaService.userBudgetAttestation.deleteMany({ + where: { userId: userId }, + }); + await this.prismaService.userCollectionFinish.deleteMany({ + where: { userId: userId }, + }); + await this.prismaService.user.deleteMany({ + where: { id: userId }, + }); } }