Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Feature/remove account type from account database model (#2616)

Thomas Kaul7cb86de7af96
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 70f0551863..48b0cb190f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## Unreleased
+
+### Changed
+
+- Removed the account type from the `Account` database schema
+
## 2.19.0 - 2023-11-06
### Added
diff --git a/apps/api/src/app/account/create-account.dto.ts b/apps/api/src/app/account/create-account.dto.ts
index fff982ecfa..a6e07ad825 100644
--- a/apps/api/src/app/account/create-account.dto.ts
+++ b/apps/api/src/app/account/create-account.dto.ts
@@ -1,4 +1,3 @@
-import { AccountType } from '@prisma/client';
import { Transform, TransformFnParams } from 'class-transformer';
import {
IsBoolean,
@@ -10,10 +9,6 @@ import {
import { isString } from 'lodash';
export class CreateAccountDto {
- @IsOptional()
- @IsString()
- accountType?: AccountType;
-
@IsNumber()
balance: number;
diff --git a/apps/api/src/app/account/update-account.dto.ts b/apps/api/src/app/account/update-account.dto.ts
index 7ab8294541..16d55386d5 100644
--- a/apps/api/src/app/account/update-account.dto.ts
+++ b/apps/api/src/app/account/update-account.dto.ts
@@ -1,4 +1,3 @@
-import { AccountType } from '@prisma/client';
import { Transform, TransformFnParams } from 'class-transformer';
import {
IsBoolean,
@@ -10,10 +9,6 @@ import {
import { isString } from 'lodash';
export class UpdateAccountDto {
- @IsOptional()
- @IsString()
- accountType?: AccountType;
-
@IsNumber()
balance: number;
diff --git a/prisma/migrations/20231107080536_removed_account_type_from_account/migration.sql b/prisma/migrations/20231107080536_removed_account_type_from_account/migration.sql
new file mode 100644
index 0000000000..e25b06ad88
--- /dev/null
+++ b/prisma/migrations/20231107080536_removed_account_type_from_account/migration.sql
@@ -0,0 +1,2 @@
+-- AlterTable
+ALTER TABLE "Account" DROP COLUMN "accountType";
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index 015431e6c1..a7db0ceeec 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -21,7 +21,6 @@ model Access {
}
model Account {
- accountType AccountType?
balance Float @default(0)
balances AccountBalance[]
comment String?