fix: ajout du script de migration Flyway pour les nouveaux champs
- Script V30__add_ancienne_categorie_and_sexe.sql pour ajouter les champs en DB. - Mise à jour des colonnes telephone, ancienne_categorie et sexe.
This commit is contained in:
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"java.compile.nullAnalysis.mode": "automatic"
|
||||
}
|
||||
@@ -18,6 +18,9 @@ public class Categorie {
|
||||
@Column(nullable = false, length = 20)
|
||||
private String nom;
|
||||
|
||||
@Column(nullable = false, length = 10)
|
||||
private String sexe = "MASCULIN";
|
||||
|
||||
@Column(name = "annee_min")
|
||||
private Integer anneeMin;
|
||||
|
||||
@@ -45,6 +48,9 @@ public class Categorie {
|
||||
public String getNom() { return nom; }
|
||||
public void setNom(String nom) { this.nom = nom; }
|
||||
|
||||
public String getSexe() { return sexe; }
|
||||
public void setSexe(String sexe) { this.sexe = sexe; }
|
||||
|
||||
public Integer getAnneeMin() { return anneeMin; }
|
||||
public void setAnneeMin(Integer anneeMin) { this.anneeMin = anneeMin; }
|
||||
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
ALTER TABLE adherent ADD COLUMN ancienne_categorie VARCHAR(50);
|
||||
ALTER TABLE pre_inscription ADD COLUMN ancienne_categorie VARCHAR(50) DEFAULT 'NA';
|
||||
|
||||
ALTER TABLE categorie ADD COLUMN sexe VARCHAR(10) DEFAULT 'MASCULIN' NOT NULL;
|
||||
|
||||
UPDATE adherent SET telephone = '0000000000' WHERE telephone IS NULL;
|
||||
ALTER TABLE adherent ALTER COLUMN telephone SET NOT NULL;
|
||||
|
||||
UPDATE pre_inscription SET telephone = '0000000000' WHERE telephone IS NULL;
|
||||
ALTER TABLE pre_inscription ALTER COLUMN telephone SET NOT NULL;
|
||||
@@ -22,10 +22,19 @@
|
||||
<form th:action="@{/categories}" th:object="${categorie}" method="post" class="space-y-6">
|
||||
<input type="hidden" th:field="*{id}" />
|
||||
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Nom (ex: U15)</label>
|
||||
<input type="text" th:field="*{nom}" required class="w-full border border-gray-300 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 outline-none">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Catégorie</label>
|
||||
<select th:field="*{sexe}" class="w-full border border-gray-300 rounded-lg px-4 py-2 text-sm focus:ring-2 focus:ring-blue-500 outline-none">
|
||||
<option value="MASCULIN">Masculine</option>
|
||||
<option value="FEMININ">Féminine</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
|
||||
@@ -43,7 +43,10 @@
|
||||
<td colspan="6" class="py-8 text-center text-gray-500">Aucune catégorie n'est paramétrée.</td>
|
||||
</tr>
|
||||
<tr th:each="cat : ${categories}" class="hover:bg-gray-50 transition-colors">
|
||||
<td class="py-4 px-6 font-medium text-gray-900" th:text="${cat.nom}">U15</td>
|
||||
<td class="py-4 px-6">
|
||||
<div class="font-medium text-gray-900" th:text="${cat.nom}">U15</div>
|
||||
<div class="text-xs text-gray-500" th:text="${cat.sexe == 'FEMININ' ? 'Féminine' : 'Masculine'}">Masculine</div>
|
||||
</td>
|
||||
<td class="py-4 px-6 text-center text-gray-600" th:text="${cat.anneeMin}">2010</td>
|
||||
<td class="py-4 px-6 text-center text-gray-600" th:text="${cat.anneeMax}">2011</td>
|
||||
<td class="py-4 px-6 text-right font-medium text-blue-600" th:text="${cat.tarifBase + ' €'}">100.00 €</td>
|
||||
|
||||
Reference in New Issue
Block a user