refactor: update database setup and remove skills migration API
- Changed migration commands in DATABASE_SETUP.md to use `pnpm run sync-skills` and `pnpm run sync-teams`. - Removed the skills migration API endpoint in route.ts, streamlining the migration process. - Updated MIGRATION_UUID.md to reflect changes in migration steps and removed the old skills migration script. - Added new sync scripts for skills and teams in package.json. - Cleaned up init.sql by removing old teams data insertion and adjusted comments for clarity.
This commit is contained in:
@@ -20,8 +20,9 @@ dropdb peakskills
|
||||
createdb peakskills
|
||||
psql -h localhost -U peakskills_user -d peakskills -f scripts/init.sql
|
||||
|
||||
# 3. Migrer les données skills
|
||||
npm run migrate-skills
|
||||
# 3. Synchroniser les données skills et teams
|
||||
pnpm run sync-skills
|
||||
pnpm run sync-teams
|
||||
|
||||
# 4. Démarrer l'app
|
||||
npm run dev
|
||||
@@ -29,19 +30,14 @@ npm run dev
|
||||
|
||||
### Scenario B : Migration base existante
|
||||
|
||||
```bash
|
||||
# 1. Se connecter à PostgreSQL
|
||||
psql -h localhost -U peakskills_user -d peakskills
|
||||
**⚠️ Script de migration supprimé**
|
||||
|
||||
# 2. Exécuter le script de migration
|
||||
\i scripts/migrate-to-uuid.sql
|
||||
Le script `migrate-to-uuid.sql` a été supprimé. Pour migrer une base existante :
|
||||
|
||||
# 3. Vérifier la migration
|
||||
SELECT id, uuid_id, first_name, last_name FROM users LIMIT 5;
|
||||
|
||||
# 4. Redémarrer l'app
|
||||
npm run dev
|
||||
```
|
||||
1. **Sauvegarde** tes données importantes
|
||||
2. **Supprime** l'ancienne base : `dropdb peakskills`
|
||||
3. **Recrée** avec le nouveau schéma : `createdb peakskills`
|
||||
4. **Utilise** le Scenario A ci-dessus
|
||||
|
||||
### 4. Nettoyer les anciennes sessions
|
||||
|
||||
@@ -105,8 +101,7 @@ npm run dev
|
||||
### Infrastructure
|
||||
|
||||
- `middleware.ts` → Variables UUID
|
||||
- `scripts/migrate-to-uuid.sql` → Schema DB migration (pour existants)
|
||||
- `scripts/init.sql` → Schema DB initial avec UUIDs (pour nouvelles installs)
|
||||
- `scripts/init.sql` → Schema DB initial avec UUIDs
|
||||
|
||||
## 🧹 Nettoyage futur
|
||||
|
||||
|
||||
Reference in New Issue
Block a user