diff --git a/backend/src/db/index.js b/backend/src/db/index.js index 5621b55..2e5b66d 100644 --- a/backend/src/db/index.js +++ b/backend/src/db/index.js @@ -1012,6 +1012,26 @@ db.exec(` VALUES ('logo-app', 'app-logo.svg', 'Logo principal de la plateforme') `).run(); } + + // Génère le fichier app-logo.svg dans le dossier icons s'il est absent + { + const dataDir = process.env.DATA_DIR + ? path.resolve(process.env.DATA_DIR) + : path.resolve(__dirname, '../../data'); + const logoPath = path.join(dataDir, 'icons', 'app-logo.svg'); + + if (!fs.existsSync(logoPath)) { + fs.mkdirSync(path.dirname(logoPath), { recursive: true }); + fs.writeFileSync(logoPath, ` + + + + + +`, 'utf8'); + console.log('[DB] app-logo.svg généré dans', path.dirname(logoPath)); + } + } } // ── Migration : compte_id sur investissements ────────────────────────────────