From 6cd3fc674cdaf468dcc6a676fbcdb8a1ae3d153f Mon Sep 17 00:00:00 2001 From: Xor290 Date: Tue, 30 Jun 2026 20:02:27 +0200 Subject: [PATCH] chore: build --- backend/gestion/db/db_init.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/gestion/db/db_init.go b/backend/gestion/db/db_init.go index e0731e6e..d933fde4 100644 --- a/backend/gestion/db/db_init.go +++ b/backend/gestion/db/db_init.go @@ -299,6 +299,11 @@ func InitDB() *Database { log.Fatalf("❌ Erreur migration media.key: %v", err) } + // Migration: colonne parrain sur les clients (système de parrainage) + if _, err = database.Exec(`ALTER TABLE clients ADD COLUMN IF NOT EXISTS parrain VARCHAR(255) DEFAULT NULL`); err != nil { + log.Fatalf("❌ Erreur migration clients.parrain: %v", err) + } + // Lancer le nettoyage périodique des tokens expirés go database.cleanExpiredTokensPeriodically() @@ -343,6 +348,7 @@ func (db *Database) createTables() error { cancellations_count INTEGER DEFAULT 0 NOT NULL, last_penalty_reason TEXT DEFAULT NULL, referral_balance NUMERIC(10,2) DEFAULT 0.0, + parrain VARCHAR(255) DEFAULT NULL, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP );`,