first commit
CI / lint-and-test (push) Canceled after 0s

This commit is contained in:
Alberto-Audrix committed 2026-07-28 08:55:05 +07:00
commit 32a36cceff
444 files changed
+67186

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
const fs = require('fs');
const path = require('path');
const { query } = require('./db');
async function runMigration() {
try {
const migrationPath = path.join(
__dirname,
'migrations',
'add_chicken_count_and_population.sql'
);
const sql = fs.readFileSync(migrationPath, 'utf8');
// Split by semicolon and execute each statement
const statements = sql.split(';').filter((stmt) => stmt.trim());
for (const statement of statements) {
if (statement.trim()) {
await query(statement);
}
}
process.exit(0);
} catch (error) {
console.error('Migration failed:', error);
process.exit(1);
}
}
runMigration();