Enforce natural key uniqueness by adding unique constraints to Bundesland, Platz, Altersklasse, and Land tables.
This commit is contained in:
+3
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user