const fs = require('fs');
const t = fs.readFileSync('C:/Users/fchin/Documents/AfricaAlert/africa-alert-pwa/.worktrees/fix-p1-migrations/server/src/database/init.js', 'utf8');
const re = /`((?:\\.|[^`\\])*)`/g;
let m, blocks = [];
while (m = re.exec(t)) blocks.push(m[1]);
console.log('blocks:', blocks.length);
if (blocks[0]) {
  console.log('first block length:', blocks[0].length);
  console.log('first block has CREATE TABLE:', /CREATE\s+TABLE/i.test(blocks[0]));
  const parts = blocks[0].split(/;\s*\n/);
  console.log('first block split parts:', parts.length);
  for (let i = 0; i < Math.min(3, parts.length); i++) {
    console.log(`part ${i} (${parts[i].length} chars):`, parts[i].substring(0, 120));
  }
}
