Browse Source
Bugfix/add missing user id to unique key of account balance (#8179)
* Add missing userId to unique constraint of account balance
* Update changelog
pull/8156/merge
Thomas Kaul
1 day ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
9 additions and
3 deletions
-
CHANGELOG.md
-
apps/api/src/app/account-balance/account-balance.service.ts
-
prisma/migrations/20261014000000_added_user_id_to_unique_constraint_of_account_balance/migration.sql
-
prisma/schema.prisma
|
|
@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
### Fixed |
|
|
### Fixed |
|
|
|
|
|
|
|
|
- Fixed an exception in the authentication interceptor when the time zone of the browser is not available |
|
|
- Fixed an exception in the authentication interceptor when the time zone of the browser is not available |
|
|
|
|
|
- Fixed the missing `userId` in the unique constraint of the `AccountBalance` database schema |
|
|
|
|
|
|
|
|
## 3.86.0 - 2026-10-13 |
|
|
## 3.86.0 - 2026-10-13 |
|
|
|
|
|
|
|
|
|
|
|
@ -68,9 +68,9 @@ export class AccountBalanceService { |
|
|
value: balance |
|
|
value: balance |
|
|
}, |
|
|
}, |
|
|
where: { |
|
|
where: { |
|
|
userId, |
|
|
accountId_userId_date: { |
|
|
accountId_date: { |
|
|
|
|
|
accountId, |
|
|
accountId, |
|
|
|
|
|
userId, |
|
|
date: resetHours(parseISO(date)) |
|
|
date: resetHours(parseISO(date)) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
@ -0,0 +1,5 @@ |
|
|
|
|
|
-- DropIndex |
|
|
|
|
|
DROP INDEX "AccountBalance_accountId_date_key"; |
|
|
|
|
|
|
|
|
|
|
|
-- CreateIndex |
|
|
|
|
|
CREATE UNIQUE INDEX "AccountBalance_accountId_userId_date_key" ON "AccountBalance"("accountId", "userId", "date"); |
|
|
@ -65,7 +65,7 @@ model AccountBalance { |
|
|
userId String |
|
|
userId String |
|
|
value Float |
|
|
value Float |
|
|
|
|
|
|
|
|
@@unique([accountId, date]) |
|
|
@@unique([accountId, userId, date]) |
|
|
@@index([accountId]) |
|
|
@@index([accountId]) |
|
|
@@index([date]) |
|
|
@@index([date]) |
|
|
} |
|
|
} |
|
|
|