-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release-2024.6.1-hotfix: add migration script to fix expirationDay fo…
…r gold cards, set expiration only if card has expirationDay, add null check for startDay for static cards
- Loading branch information
Showing
3 changed files
with
25 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...kotlin/app/ehrenamtskarte/backend/migration/migrations/V0013_FixExpirationDateGoldCard.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package app.ehrenamtskarte.backend.migration.migrations | ||
|
||
import app.ehrenamtskarte.backend.migration.Migration | ||
import app.ehrenamtskarte.backend.migration.Statement | ||
|
||
/** | ||
* Set the expirationDay to null for gold cards where the expirationDay was accidentally set to 0. | ||
*/ | ||
@Suppress("ClassName") | ||
internal class V0013_FixExpirationDateGoldCard() : Migration() { | ||
override val migrate: Statement = { | ||
exec( | ||
""" | ||
UPDATE cards | ||
SET "expirationDay" = null | ||
WHERE "expirationDay" = 0; | ||
""".trimIndent() | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters