Browse Source

Merge 6b07fcea94 into a057f1bdc5

pull/8179/merge
Thomas Kaul 18 hours ago
committed by GitHub
parent
commit
0bbc13792f
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 4
      apps/api/src/app/account-balance/account-balance.service.ts
  3. 5
      prisma/migrations/20261014000000_added_user_id_to_unique_constraint_of_account_balance/migration.sql
  4. 2
      prisma/schema.prisma

1
CHANGELOG.md

@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improved the colors of the muted texts and borders by enabling the dark mode of `bootstrap` - Improved the colors of the muted texts and borders by enabling the dark mode of `bootstrap`
- Reduced the size of the global stylesheet by removing the unused utilities of `bootstrap` - Reduced the size of the global stylesheet by removing the unused utilities of `bootstrap`
- Hardened the validation of the date in the endpoint to create an account balance - Hardened the validation of the date in the endpoint to create an account balance
- Added `userId` to the unique constraint of the `AccountBalance` database schema
- Upgraded `bootstrap` from version `4.6.2` to `5.3.8` - Upgraded `bootstrap` from version `4.6.2` to `5.3.8`
### Fixed ### Fixed

4
apps/api/src/app/account-balance/account-balance.service.ts

@ -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))
} }
} }

5
prisma/migrations/20261014000000_added_user_id_to_unique_constraint_of_account_balance/migration.sql

@ -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");

2
prisma/schema.prisma

@ -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])
} }

Loading…
Cancel
Save