@atlashub/smartstack-cli 1.11.0 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.documentation/agents.html +7 -2
- package/.documentation/apex.html +7 -2
- package/.documentation/business-analyse.html +7 -2
- package/.documentation/cli-commands.html +871 -0
- package/.documentation/commands.html +7 -2
- package/.documentation/efcore.html +7 -2
- package/.documentation/gitflow.html +7 -2
- package/.documentation/hooks.html +7 -2
- package/.documentation/index.html +7 -2
- package/.documentation/init.html +7 -2
- package/.documentation/installation.html +7 -2
- package/.documentation/ralph-loop.html +7 -2
- package/.documentation/test-web.html +7 -2
- package/dist/index.js +1932 -336
- package/dist/index.js.map +1 -1
- package/package.json +8 -2
- package/templates/agents/efcore/squash.md +67 -31
- package/templates/agents/gitflow/finish.md +68 -56
- package/templates/commands/business-analyse/0-orchestrate.md +72 -556
- package/templates/commands/business-analyse/1-init.md +23 -193
- package/templates/commands/business-analyse/2-discover.md +85 -462
- package/templates/commands/business-analyse/3-analyse.md +40 -342
- package/templates/commands/business-analyse/4-specify.md +72 -537
- package/templates/commands/business-analyse/5-validate.md +43 -237
- package/templates/commands/business-analyse/6-handoff.md +93 -682
- package/templates/commands/business-analyse/7-doc-html.md +45 -544
- package/templates/commands/business-analyse/_shared.md +176 -0
- package/templates/commands/business-analyse/bug.md +50 -257
- package/templates/commands/business-analyse/change-request.md +59 -283
- package/templates/commands/business-analyse/hotfix.md +36 -120
- package/templates/commands/business-analyse.md +55 -574
- package/templates/commands/efcore/_shared.md +206 -0
- package/templates/commands/efcore/conflicts.md +39 -201
- package/templates/commands/efcore/db-deploy.md +28 -237
- package/templates/commands/efcore/db-reset.md +41 -390
- package/templates/commands/efcore/db-seed.md +44 -323
- package/templates/commands/efcore/db-status.md +31 -210
- package/templates/commands/efcore/migration.md +45 -368
- package/templates/commands/efcore/rebase-snapshot.md +38 -241
- package/templates/commands/efcore/scan.md +35 -204
- package/templates/commands/efcore/squash.md +158 -251
- package/templates/commands/efcore.md +49 -177
- package/templates/commands/gitflow/1-init.md +94 -1318
- package/templates/commands/gitflow/10-start.md +86 -990
- package/templates/commands/gitflow/11-finish.md +264 -454
- package/templates/commands/gitflow/12-cleanup.md +40 -213
- package/templates/commands/gitflow/2-status.md +51 -386
- package/templates/commands/gitflow/3-commit.md +108 -801
- package/templates/commands/gitflow/4-plan.md +42 -13
- package/templates/commands/gitflow/5-exec.md +60 -5
- package/templates/commands/gitflow/6-abort.md +54 -277
- package/templates/commands/gitflow/7-pull-request.md +74 -717
- package/templates/commands/gitflow/8-review.md +51 -178
- package/templates/commands/gitflow/9-merge.md +74 -404
- package/templates/commands/gitflow/_shared.md +196 -0
- package/templates/commands/quickstart.md +154 -0
- package/templates/commands/ralph-loop/ralph-loop.md +104 -2
- package/templates/hooks/hooks.json +13 -0
- package/templates/hooks/ralph-mcp-logger.sh +46 -0
- package/templates/hooks/ralph-session-end.sh +69 -0
- package/templates/ralph/README.md +91 -0
- package/templates/ralph/ralph.config.yaml +113 -0
- package/templates/scripts/setup-ralph-loop.sh +173 -0
- package/templates/skills/_shared.md +117 -0
- package/templates/skills/ai-prompt/SKILL.md +87 -654
- package/templates/skills/application/SKILL.md +76 -499
- package/templates/skills/controller/SKILL.md +38 -165
- package/templates/skills/documentation/SKILL.md +2 -1
- package/templates/skills/feature-full/SKILL.md +107 -732
- package/templates/skills/notification/SKILL.md +85 -474
- package/templates/skills/ui-components/SKILL.md +62 -762
- package/templates/skills/workflow/SKILL.md +85 -489
- package/templates/commands/gitflow/rescue.md +0 -867
- package/templates/skills/business-analyse/SKILL.md +0 -191
|
@@ -4,76 +4,86 @@ agent: efcore-squash
|
|
|
4
4
|
model: sonnet
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# EF Core Squash
|
|
7
|
+
# EF Core Squash
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
**
|
|
12
|
-
|
|
13
|
-
**WARNING:** This operation is **DESTRUCTIVE**. Migration history will be lost.
|
|
9
|
+
> **Ref:** [_shared.md](_shared.md) - `determine_base_branch()`, `detect_efcore_project()`
|
|
10
|
+
> **Usage:** Consolider migrations avant merge ou release
|
|
11
|
+
> **WARNING:** DESTRUCTIF - historique migrations perdu
|
|
14
12
|
|
|
15
13
|
---
|
|
16
14
|
|
|
17
|
-
##
|
|
15
|
+
## Conformité
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
> **OBLIGATOIRE - Méthodes autorisées:**
|
|
25
|
-
> - ✅ `dotnet ef migrations add` pour créer la migration consolidée
|
|
26
|
-
> - ✅ `dotnet ef migrations remove` pour supprimer les anciennes
|
|
27
|
-
> - ✅ Backup des fichiers .cs dans `.claude/gitflow/backup/` (non versionné)
|
|
28
|
-
>
|
|
29
|
-
> **Contact support:** support@atlshub.ch
|
|
17
|
+
| INTERDIT | OBLIGATOIRE |
|
|
18
|
+
|----------|-------------|
|
|
19
|
+
| Scripts .sql dans repo | `dotnet ef migrations add` |
|
|
20
|
+
| `migrationBuilder.Sql()` brut | `dotnet ef migrations remove` |
|
|
21
|
+
| Squash sans récupérer snapshot parent | Backup dans `.claude/` (gitignored) |
|
|
30
22
|
|
|
31
23
|
---
|
|
32
24
|
|
|
33
|
-
## STEP
|
|
25
|
+
## STEP 0: Déterminer Branche Parente (CRITIQUE)
|
|
34
26
|
|
|
35
27
|
```bash
|
|
36
|
-
#
|
|
37
|
-
CURRENT_BRANCH=$(git branch --show-current)
|
|
38
|
-
echo "Current branch: $CURRENT_BRANCH"
|
|
28
|
+
determine_base_branch # Voir _shared.md
|
|
39
29
|
|
|
40
|
-
#
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
30
|
+
# Résultat:
|
|
31
|
+
# - BASE_BRANCH = branche parente (develop, main, etc.)
|
|
32
|
+
# - BRANCH_TYPE = type de branche courante
|
|
33
|
+
# - Exit si main/master (BLOQUÉ)
|
|
34
|
+
```
|
|
45
35
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
| Branche courante | BASE_BRANCH | Action |
|
|
37
|
+
|------------------|-------------|--------|
|
|
38
|
+
| `feature/*` | `develop` | Récupère snapshot develop |
|
|
39
|
+
| `develop` | `main` | Récupère snapshot main |
|
|
40
|
+
| `release/*` | `main` | Récupère snapshot main |
|
|
41
|
+
| `hotfix/*` | `main` | Récupère snapshot main |
|
|
42
|
+
| `main/master` | **BLOQUÉ** | Exit code 1 |
|
|
49
43
|
|
|
50
|
-
|
|
51
|
-
INFRA_PROJECT=$(find . -name "*.csproj" -exec grep -l "Microsoft.EntityFrameworkCore" {} \; | head -1)
|
|
52
|
-
fi
|
|
44
|
+
---
|
|
53
45
|
|
|
54
|
-
|
|
55
|
-
MIGRATIONS_DIR="$PROJECT_DIR/Migrations"
|
|
46
|
+
## STEP 1: Vérifier Prérequis
|
|
56
47
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
```bash
|
|
49
|
+
CURRENT_BRANCH=$(git branch --show-current)
|
|
50
|
+
[ -n "$(git status --porcelain)" ] && { echo "Working directory non propre"; exit 1; }
|
|
51
|
+
detect_efcore_project
|
|
52
|
+
|
|
53
|
+
# Compter migrations LOCALES uniquement (pas celles héritées)
|
|
54
|
+
git fetch origin "$BASE_BRANCH" --quiet
|
|
55
|
+
BASE_MIGRATIONS=$(git ls-tree -r --name-only "origin/$BASE_BRANCH" -- "$MIGRATIONS_DIR" | grep "\.cs$" | grep -v "Designer\|Snapshot")
|
|
56
|
+
LOCAL_MIGRATIONS=$(find "$MIGRATIONS_DIR" -name "*.cs" | grep -v "Designer\|Snapshot" | xargs -I{} basename {})
|
|
57
|
+
|
|
58
|
+
# Migrations propres à cette branche
|
|
59
|
+
BRANCH_ONLY_MIGRATIONS=()
|
|
60
|
+
for mig in $LOCAL_MIGRATIONS; do
|
|
61
|
+
echo "$BASE_MIGRATIONS" | grep -q "$mig" || BRANCH_ONLY_MIGRATIONS+=("$mig")
|
|
62
|
+
done
|
|
60
63
|
|
|
61
|
-
|
|
62
|
-
echo "
|
|
64
|
+
MIGRATION_COUNT=${#BRANCH_ONLY_MIGRATIONS[@]}
|
|
65
|
+
echo "Migrations à consolider: $MIGRATION_COUNT (propres à $CURRENT_BRANCH)"
|
|
66
|
+
echo "Branche parente: $BASE_BRANCH"
|
|
63
67
|
```
|
|
64
68
|
|
|
65
69
|
---
|
|
66
70
|
|
|
67
|
-
## STEP 2:
|
|
71
|
+
## STEP 2: Confirmation Utilisateur
|
|
68
72
|
|
|
69
73
|
```javascript
|
|
70
74
|
AskUserQuestion({
|
|
71
75
|
questions: [{
|
|
72
|
-
question:
|
|
76
|
+
question: `Squash ${MIGRATION_COUNT} migrations de ${CURRENT_BRANCH}?
|
|
77
|
+
|
|
78
|
+
Le ModelSnapshot de ${BASE_BRANCH} sera récupéré comme base.
|
|
79
|
+
Vos migrations seront consolidées en UNE seule.
|
|
80
|
+
|
|
81
|
+
Cette opération est DESTRUCTIVE et IRRÉVERSIBLE (sauf backup).`,
|
|
73
82
|
header: "Squash",
|
|
74
83
|
options: [
|
|
75
|
-
{ label: "
|
|
76
|
-
{ label: "
|
|
84
|
+
{ label: "Oui, squash", description: `Consolider sur base de ${BASE_BRANCH}` },
|
|
85
|
+
{ label: "Voir détails", description: "Afficher migrations concernées" },
|
|
86
|
+
{ label: "Annuler", description: "Ne rien faire" }
|
|
77
87
|
],
|
|
78
88
|
multiSelect: false
|
|
79
89
|
}]
|
|
@@ -82,221 +92,115 @@ AskUserQuestion({
|
|
|
82
92
|
|
|
83
93
|
---
|
|
84
94
|
|
|
85
|
-
## STEP 3:
|
|
95
|
+
## STEP 3: Backup Local
|
|
86
96
|
|
|
87
97
|
```bash
|
|
88
|
-
# Create backup in .claude directory (gitignored)
|
|
89
98
|
BACKUP_DIR=".claude/gitflow/backup/migrations/squash_$(date +%Y%m%d_%H%M%S)"
|
|
90
99
|
mkdir -p "$BACKUP_DIR"
|
|
91
|
-
|
|
92
|
-
echo "Backup
|
|
93
|
-
cp "$MIGRATIONS_DIR"/*.cs "$BACKUP_DIR/" 2>/dev/null
|
|
94
|
-
echo " $(ls -1 "$BACKUP_DIR" | wc -l) files backed up"
|
|
95
|
-
|
|
96
|
-
# Keep ModelSnapshot for reference
|
|
97
|
-
cp "$MIGRATIONS_DIR"/*ModelSnapshot.cs "$BACKUP_DIR/ModelSnapshot_backup.cs" 2>/dev/null
|
|
100
|
+
cp "$MIGRATIONS_DIR"/*.cs "$BACKUP_DIR/"
|
|
101
|
+
echo "Backup: $BACKUP_DIR"
|
|
98
102
|
```
|
|
99
103
|
|
|
100
104
|
---
|
|
101
105
|
|
|
102
|
-
## STEP 4:
|
|
106
|
+
## STEP 4: Récupérer ModelSnapshot de la Branche Parente (CRUCIAL)
|
|
103
107
|
|
|
104
108
|
```bash
|
|
105
|
-
|
|
109
|
+
# Sauvegarder snapshot actuel
|
|
110
|
+
cp "$MIGRATIONS_DIR"/*ModelSnapshot.cs "$BACKUP_DIR/"
|
|
106
111
|
|
|
107
|
-
#
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
echo " - $(basename "$file")"
|
|
111
|
-
done
|
|
112
|
+
# Récupérer le snapshot de la branche parente
|
|
113
|
+
git fetch origin "$BASE_BRANCH" --quiet
|
|
114
|
+
git checkout "origin/$BASE_BRANCH" -- "$MIGRATIONS_DIR"/*ModelSnapshot.cs
|
|
112
115
|
|
|
113
|
-
|
|
114
|
-
for file in $(find "$MIGRATIONS_DIR" -name "*.Designer.cs" 2>/dev/null); do
|
|
115
|
-
rm -f "$file"
|
|
116
|
-
echo " - $(basename "$file")"
|
|
117
|
-
done
|
|
116
|
+
echo "ModelSnapshot récupéré depuis: origin/$BASE_BRANCH"
|
|
118
117
|
```
|
|
119
118
|
|
|
119
|
+
**Pourquoi c'est crucial:**
|
|
120
|
+
- Le snapshot de `$BASE_BRANCH` contient l'état VALIDÉ et COMPLET
|
|
121
|
+
- Les migrations parallèles sur d'autres branches sont incluses
|
|
122
|
+
- Évite la perte d'information de schéma (cf. [Bokio best practices](https://www.bokio.se/engineering-blog/how-to-squash-ef-core-migrations/))
|
|
123
|
+
|
|
120
124
|
---
|
|
121
125
|
|
|
122
|
-
## STEP 5:
|
|
126
|
+
## STEP 5: Supprimer Migrations de la Branche (pas celles héritées)
|
|
123
127
|
|
|
124
128
|
```bash
|
|
125
|
-
#
|
|
126
|
-
|
|
127
|
-
|
|
129
|
+
# Supprimer UNIQUEMENT les migrations propres à cette branche
|
|
130
|
+
for mig in "${BRANCH_ONLY_MIGRATIONS[@]}"; do
|
|
131
|
+
rm -f "$MIGRATIONS_DIR"/${mig%.cs}.cs
|
|
132
|
+
rm -f "$MIGRATIONS_DIR"/${mig%.cs}.Designer.cs
|
|
133
|
+
done
|
|
134
|
+
|
|
135
|
+
echo "Supprimé: ${#BRANCH_ONLY_MIGRATIONS[@]} migrations"
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
128
139
|
|
|
129
|
-
|
|
130
|
-
if [[ "$CURRENT_BRANCH" == release/* ]]; then
|
|
131
|
-
MIGRATION_NAME="Release_${VERSION_CLEAN}_Initial"
|
|
132
|
-
else
|
|
133
|
-
MIGRATION_NAME="Consolidated_${VERSION_CLEAN}_AllMigrations"
|
|
134
|
-
fi
|
|
140
|
+
## STEP 6: Créer Migration Consolidée
|
|
135
141
|
|
|
136
|
-
|
|
137
|
-
|
|
142
|
+
```bash
|
|
143
|
+
# Nommage selon contexte
|
|
144
|
+
case "$BRANCH_TYPE" in
|
|
145
|
+
feature)
|
|
146
|
+
BRANCH_NAME=$(echo "$CURRENT_BRANCH" | sed 's|feature/||')
|
|
147
|
+
MIGRATION_NAME="Feature_${BRANCH_NAME}_Consolidated"
|
|
148
|
+
;;
|
|
149
|
+
release)
|
|
150
|
+
VERSION=$(echo "$CURRENT_BRANCH" | sed 's|release/||' | tr '.' '_')
|
|
151
|
+
MIGRATION_NAME="Release_${VERSION}_Initial"
|
|
152
|
+
;;
|
|
153
|
+
hotfix)
|
|
154
|
+
VERSION=$(echo "$CURRENT_BRANCH" | sed 's|hotfix/||' | tr '.' '_')
|
|
155
|
+
MIGRATION_NAME="Hotfix_${VERSION}_Fix"
|
|
156
|
+
;;
|
|
157
|
+
develop)
|
|
158
|
+
MIGRATION_NAME="Develop_Consolidated_$(date +%Y%m%d)"
|
|
159
|
+
;;
|
|
160
|
+
*)
|
|
161
|
+
MIGRATION_NAME="Consolidated_$(date +%Y%m%d_%H%M%S)"
|
|
162
|
+
;;
|
|
163
|
+
esac
|
|
138
164
|
|
|
139
165
|
dotnet ef migrations add "$MIGRATION_NAME" \
|
|
140
166
|
--project "$INFRA_PROJECT" \
|
|
141
167
|
--startup-project "$STARTUP_PROJECT" \
|
|
142
168
|
--verbose
|
|
143
|
-
|
|
144
|
-
if [ $? -eq 0 ]; then
|
|
145
|
-
echo " Migration created successfully"
|
|
146
|
-
else
|
|
147
|
-
echo " ERROR - restoring backup"
|
|
148
|
-
cp "$BACKUP_DIR"/*.cs "$MIGRATIONS_DIR/"
|
|
149
|
-
exit 1
|
|
150
|
-
fi
|
|
151
169
|
```
|
|
152
170
|
|
|
153
171
|
---
|
|
154
172
|
|
|
155
|
-
## STEP
|
|
173
|
+
## STEP 7: Validation
|
|
156
174
|
|
|
157
175
|
```bash
|
|
158
|
-
echo ""
|
|
159
|
-
echo "Validation..."
|
|
160
|
-
|
|
161
176
|
# Build
|
|
162
177
|
dotnet build --no-restore
|
|
163
|
-
|
|
164
|
-
echo " ERROR: Build failed"
|
|
165
|
-
echo " Restoring backup..."
|
|
166
|
-
cp "$BACKUP_DIR"/*.cs "$MIGRATIONS_DIR/"
|
|
167
|
-
exit 1
|
|
168
|
-
fi
|
|
169
|
-
echo " Build OK"
|
|
170
|
-
|
|
171
|
-
# Verify migration can be listed
|
|
172
|
-
dotnet ef migrations list \
|
|
173
|
-
--project "$INFRA_PROJECT" \
|
|
174
|
-
--startup-project "$STARTUP_PROJECT" \
|
|
175
|
-
--no-build 2>/dev/null
|
|
176
|
-
|
|
177
|
-
if [ $? -ne 0 ]; then
|
|
178
|
-
echo " ERROR: Migration list failed"
|
|
179
|
-
exit 1
|
|
180
|
-
fi
|
|
181
|
-
echo " Migration list OK"
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
---
|
|
185
|
-
|
|
186
|
-
## STEP 7: Resume
|
|
178
|
+
[ $? -ne 0 ] && { echo "Build FAILED - restauration backup"; cp "$BACKUP_DIR"/*.cs "$MIGRATIONS_DIR/"; exit 1; }
|
|
187
179
|
|
|
188
|
-
|
|
180
|
+
# Liste migrations
|
|
181
|
+
dotnet ef migrations list --no-build
|
|
189
182
|
|
|
183
|
+
# Générer script (validation)
|
|
184
|
+
dotnet ef migrations script --no-build --idempotent > /dev/null
|
|
185
|
+
[ $? -ne 0 ] && { echo "Script generation FAILED"; exit 1; }
|
|
190
186
|
```
|
|
191
|
-
===============================================================================
|
|
192
|
-
MIGRATIONS CONSOLIDÉES
|
|
193
|
-
===============================================================================
|
|
194
187
|
|
|
195
|
-
|
|
196
|
-
-------------------------------------------------------------------------------
|
|
197
|
-
• Branche: {current_branch}
|
|
198
|
-
• Backup: {backup_dir} (local uniquement)
|
|
199
|
-
|
|
200
|
-
AVANT LE SQUASH
|
|
201
|
-
-------------------------------------------------------------------------------
|
|
202
|
-
• Migrations: {old_count} fichiers
|
|
203
|
-
|
|
204
|
-
APRÈS LE SQUASH
|
|
205
|
-
-------------------------------------------------------------------------------
|
|
206
|
-
• Migration: {migration_name}
|
|
207
|
-
|
|
208
|
-
VALIDATIONS
|
|
209
|
-
-------------------------------------------------------------------------------
|
|
210
|
-
✓ Migrations fusionnées avec succès
|
|
211
|
-
✓ Build vérifié
|
|
212
|
-
✓ Liste des migrations valide
|
|
213
|
-
|
|
214
|
-
CONFORMITÉ
|
|
215
|
-
-------------------------------------------------------------------------------
|
|
216
|
-
✓ EF Core CLI uniquement
|
|
217
|
-
✓ Pas de scripts SQL dans le repository
|
|
218
|
-
|
|
219
|
-
===============================================================================
|
|
220
|
-
DÉPLOIEMENT EN PRODUCTION
|
|
221
|
-
===============================================================================
|
|
222
|
-
|
|
223
|
-
OPTION 1 - EF Core CLI (Recommandé):
|
|
224
|
-
-------------------------------------------------------------------------------
|
|
225
|
-
dotnet ef database update {migration_name} \
|
|
226
|
-
--project "{INFRA_PROJECT}" \
|
|
227
|
-
--startup-project "{STARTUP_PROJECT}" \
|
|
228
|
-
--connection "Server=...;Database=...;..."
|
|
229
|
-
|
|
230
|
-
OPTION 2 - Si les migrations sont déjà appliquées:
|
|
231
|
-
-------------------------------------------------------------------------------
|
|
232
|
-
Insérer manuellement dans __EFMigrationsHistory via SSMS/Azure:
|
|
233
|
-
|
|
234
|
-
INSERT INTO __EFMigrationsHistory (MigrationId, ProductVersion)
|
|
235
|
-
VALUES ('{migration_name}', '10.0.0')
|
|
236
|
-
|
|
237
|
-
⚠️ NE PAS générer de scripts SQL dans le repository!
|
|
238
|
-
|
|
239
|
-
===============================================================================
|
|
240
|
-
PROCHAINES ÉTAPES
|
|
241
|
-
===============================================================================
|
|
242
|
-
|
|
243
|
-
1. Vérifier le contenu de la migration consolidée:
|
|
244
|
-
Ouvrir Migrations/{migration_name}.cs
|
|
245
|
-
|
|
246
|
-
2. Tester sur la base de développement:
|
|
247
|
-
/efcore:db-reset
|
|
248
|
-
/efcore:db-deploy
|
|
249
|
-
|
|
250
|
-
3. Committer les changements:
|
|
251
|
-
/gitflow:3-commit
|
|
252
|
-
|
|
253
|
-
===============================================================================
|
|
254
|
-
RESTAURATION (si nécessaire)
|
|
255
|
-
===============================================================================
|
|
256
|
-
|
|
257
|
-
Si le squash a causé des problèmes, restaurez le backup:
|
|
188
|
+
---
|
|
258
189
|
|
|
259
|
-
|
|
190
|
+
## Résumé
|
|
260
191
|
|
|
261
|
-
===============================================================================
|
|
262
192
|
```
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
193
|
+
SQUASH - {CURRENT_BRANCH}
|
|
194
|
+
Base: {BASE_BRANCH} (snapshot récupéré)
|
|
195
|
+
Backup: {BACKUP_DIR}
|
|
196
|
+
Avant: {MIGRATION_COUNT} migrations
|
|
197
|
+
Apres: 1 migration ({MIGRATION_NAME})
|
|
198
|
+
Conformite: EF Core CLI, Pas de .sql, Snapshot parent
|
|
199
|
+
|
|
200
|
+
Prochains: /efcore:db-reset, /efcore:db-deploy, /gitflow:3-commit
|
|
266
201
|
```
|
|
267
|
-
===============================================================================
|
|
268
|
-
ÉCHEC DU SQUASH
|
|
269
|
-
===============================================================================
|
|
270
|
-
|
|
271
|
-
ERREUR
|
|
272
|
-
-------------------------------------------------------------------------------
|
|
273
|
-
✗ {error_message}
|
|
274
|
-
|
|
275
|
-
DÉTAILS
|
|
276
|
-
-------------------------------------------------------------------------------
|
|
277
|
-
• Branche: {current_branch}
|
|
278
|
-
• Backup: {backup_dir}
|
|
279
|
-
|
|
280
|
-
RESTAURATION AUTOMATIQUE
|
|
281
|
-
-------------------------------------------------------------------------------
|
|
282
|
-
✓ Backup restauré automatiquement
|
|
283
|
-
✓ Migrations originales récupérées
|
|
284
|
-
|
|
285
|
-
===============================================================================
|
|
286
|
-
ACTIONS SUGGÉRÉES
|
|
287
|
-
===============================================================================
|
|
288
|
-
|
|
289
|
-
1. Vérifier les erreurs de build:
|
|
290
|
-
dotnet build
|
|
291
202
|
|
|
292
|
-
|
|
293
|
-
/efcore:conflicts
|
|
294
|
-
|
|
295
|
-
3. Si problème persistant:
|
|
296
|
-
support@atlshub.ch
|
|
297
|
-
|
|
298
|
-
===============================================================================
|
|
299
|
-
```
|
|
203
|
+
**Si échec:** Restaurer avec `cp $BACKUP_DIR/*.cs $MIGRATIONS_DIR/`
|
|
300
204
|
|
|
301
205
|
---
|
|
302
206
|
|
|
@@ -304,51 +208,54 @@ RESTAURATION AUTOMATIQUE
|
|
|
304
208
|
|
|
305
209
|
| Option | Description |
|
|
306
210
|
|--------|-------------|
|
|
307
|
-
| `--no-backup` |
|
|
308
|
-
| `--name <name>` |
|
|
309
|
-
| `--
|
|
310
|
-
| `--
|
|
211
|
+
| `--no-backup` | Sans backup (dangereux) |
|
|
212
|
+
| `--name <name>` | Forcer nom migration |
|
|
213
|
+
| `--dry-run` | Afficher sans exécuter |
|
|
214
|
+
| `--include-inherited` | Inclure migrations héritées (rare) |
|
|
311
215
|
|
|
312
216
|
---
|
|
313
217
|
|
|
314
|
-
##
|
|
218
|
+
## Matrice d'Utilisation
|
|
315
219
|
|
|
316
|
-
| Situation |
|
|
317
|
-
|
|
318
|
-
|
|
|
319
|
-
|
|
|
320
|
-
|
|
|
321
|
-
|
|
|
220
|
+
| Situation | Utiliser squash? | Alternative |
|
|
221
|
+
|-----------|------------------|-------------|
|
|
222
|
+
| Feature avec plusieurs migrations | OUI | `/efcore:rebase-snapshot` |
|
|
223
|
+
| Avant merge feature vers develop | OUI (recommandé) | - |
|
|
224
|
+
| Sur develop avant release | Créer release d'abord | `/gitflow:10-start release` |
|
|
225
|
+
| Sur release avant tag | OUI (idéal) | - |
|
|
226
|
+
| Hotfix urgent | OUI | - |
|
|
227
|
+
| Sur main/master | **JAMAIS** | BLOQUÉ automatiquement |
|
|
322
228
|
|
|
323
229
|
---
|
|
324
230
|
|
|
325
|
-
##
|
|
231
|
+
## Workflow Complet Recommandé
|
|
326
232
|
|
|
327
233
|
```
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
234
|
+
1. feature/* : développement avec N migrations
|
|
235
|
+
|
|
236
|
+
2. Avant merge sur develop:
|
|
237
|
+
/efcore:squash
|
|
238
|
+
→ Récupère snapshot develop
|
|
239
|
+
→ Consolide en 1 migration
|
|
240
|
+
|
|
241
|
+
3. Merge sur develop:
|
|
242
|
+
/gitflow:7-pull-request
|
|
243
|
+
/gitflow:9-merge
|
|
244
|
+
|
|
245
|
+
4. Avant release:
|
|
246
|
+
/gitflow:10-start release vX.Y.Z
|
|
247
|
+
/efcore:squash (sur release/*)
|
|
248
|
+
→ Récupère snapshot main
|
|
249
|
+
→ Consolide TOUT en Release_X_Y_Z_Initial
|
|
250
|
+
|
|
251
|
+
5. Finaliser:
|
|
252
|
+
/gitflow:11-finish
|
|
346
253
|
```
|
|
347
254
|
|
|
348
255
|
---
|
|
349
256
|
|
|
350
|
-
##
|
|
257
|
+
## Sources Best Practices
|
|
351
258
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
259
|
+
- [Microsoft - Managing Migrations](https://learn.microsoft.com/en-us/ef/core/managing-schemas/migrations/managing)
|
|
260
|
+
- [Bokio - How to squash EF Core migrations](https://www.bokio.se/engineering-blog/how-to-squash-ef-core-migrations/)
|
|
261
|
+
- [Mitchel Sellers - Squashing EF Core Migrations Safely](https://www.mitchelsellers.com/blog/article/squashing-ef-core-migrations-safely)
|