Enforce natural key uniqueness by adding unique constraints to Bundesland, Platz, Altersklasse, and Land tables.

This commit is contained in:
2026-03-28 20:52:58 +01:00
parent 74df3514ae
commit 9ec8535ff7
3 changed files with 51 additions and 0 deletions
@@ -27,5 +27,8 @@ object BundeslandTable : Table("bundesland") {
init {
uniqueIndex("idx_bundesland_oeps", oepsCode, landId)
uniqueIndex("idx_bundesland_iso", iso3166_2_Code)
// Natürlicher Schlüssel gem. Architektur: (land_id + kuerzel) eindeutig
// Hinweis: kuerzel kann NULL sein der Unique-Index greift dann nur für nicht-null Werte pro Land.
uniqueIndex("ux_bundesland_land_kuerzel", landId, kuerzel)
}
}
@@ -25,5 +25,7 @@ object PlatzTable : Table("platz") {
init {
index("idx_platz_turnier", isUnique = false, turnierId)
// Natürlicher Schlüssel gem. Architektur: (turnier_id + name) eindeutig
uniqueIndex("ux_platz_turnier_name", turnierId, name)
}
}