-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Tech] Hétérogénéité de minuscules / majuscules sur le pavillon dans …
- Loading branch information
Showing
48 changed files
with
388 additions
and
121 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
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
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
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
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
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
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
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
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
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
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
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
24 changes: 24 additions & 0 deletions
24
...gouv/cnsp/monitorfish/infrastructure/database/entities/converters/CountryCodeConverter.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,24 @@ | ||
package fr.gouv.cnsp.monitorfish.infrastructure.database.entities.converters | ||
|
||
import com.neovisionaries.i18n.CountryCode | ||
import jakarta.persistence.AttributeConverter | ||
import jakarta.persistence.Converter | ||
|
||
@Converter(autoApply = true) | ||
class CountryCodeConverter : AttributeConverter<CountryCode?, String?> { | ||
override fun convertToDatabaseColumn(attribute: CountryCode?): String? { | ||
return attribute?.name | ||
} | ||
|
||
override fun convertToEntityAttribute(dbData: String?): CountryCode? { | ||
if (dbData == null) { | ||
return CountryCode.UNDEFINED | ||
} | ||
|
||
return try { | ||
CountryCode.valueOf(dbData) | ||
} catch (e: Throwable) { | ||
return CountryCode.UNDEFINED | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
backend/src/main/resources/db/migration/internal/V0.254.1__Update_mission_actions_table.sql
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,14 @@ | ||
ALTER TABLE mission_actions | ||
ALTER COLUMN user_trigram SET NOT NULL; | ||
|
||
UPDATE mission_actions | ||
SET flag_state = 'UNDEFINED' | ||
WHERE | ||
flag_state IS NULL | ||
OR flag_state IN ('UNKNOWN', 'X'); | ||
|
||
UPDATE mission_actions | ||
SET flag_state = upper(flag_state); | ||
|
||
ALTER TABLE mission_actions | ||
ALTER COLUMN flag_state SET NOT NULL; |
10 changes: 10 additions & 0 deletions
10
backend/src/main/resources/db/migration/internal/V0.255__Update_flag_state_column.sql
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,10 @@ | ||
-- We now store `UNDEFINED` from `com.neovisionaries.i18n.CountryCode` library | ||
|
||
ALTER TABLE pending_alerts | ||
ALTER COLUMN flag_state SET DATA TYPE varchar(10); | ||
|
||
ALTER TABLE silenced_alerts | ||
ALTER COLUMN flag_state SET DATA TYPE varchar(10); | ||
|
||
ALTER TABLE reportings | ||
ALTER COLUMN flag_state SET DATA TYPE varchar(10); |
Oops, something went wrong.