diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fb6bfeba..0f59ee6dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Moved the watchlist from experimental to general availability - Deprecated the endpoint to get a portfolio position in favor of get a holding - Deprecated the endpoint to update portfolio position tags in favor of update holding tags +- Renamed `Account` to `accounts` in the `Platform` database schema - Upgraded `prisma` from version `6.6.0` to `6.7.0` ## 2.159.0 - 2025-05-02 diff --git a/apps/api/src/app/platform/platform.service.ts b/apps/api/src/app/platform/platform.service.ts index db827569d..200b4de00 100644 --- a/apps/api/src/app/platform/platform.service.ts +++ b/apps/api/src/app/platform/platform.service.ts @@ -54,7 +54,7 @@ export class PlatformService { await this.prismaService.platform.findMany({ include: { _count: { - select: { Account: true } + select: { accounts: true } } } }); @@ -64,7 +64,7 @@ export class PlatformService { id, name, url, - accountCount: _count.Account + accountCount: _count.accounts }; }); } diff --git a/prisma/schema.prisma b/prisma/schema.prisma index c33f7d6cc..863c196ac 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -147,10 +147,10 @@ model Order { } model Platform { - id String @id @default(uuid()) - name String? - url String @unique - Account Account[] + accounts Account[] + id String @id @default(uuid()) + name String? + url String @unique @@index([name]) }