ваше сообщение коммита

This commit is contained in:
2025-09-02 17:18:15 +03:00
parent a6360ccd2e
commit 53bb269b85
26 changed files with 580 additions and 243 deletions

View File

@@ -113,17 +113,14 @@ async function initializeDatabase() {
const filePath = path.join(migrationsPath, file);
const sql = fs.readFileSync(filePath, 'utf8');
logger.info(`Executing migration: ${file}`);
await pool.query(sql);
// Записываем выполненную миграцию
await pool.query('INSERT INTO migrations (name) VALUES ($1)', [file]);
logger.info(`Migration completed: ${file}`);
}
}
logger.info('All migrations completed successfully');
} catch (error) {
logger.error('Error during database initialization:', error);
throw error;