const seed = require('./seed/seed.json'); const Database = require('better-sqlite3'); const db = new Database('./data.db'); // Only seed pages for now const insertPage = db.prepare( "INSERT OR REPLACE INTO ec_pages (id, slug, status, title, subtitle, badge, hero_image, theme, show_cta, cta_text, cta_link, variant, size, created_at, updated_at, published_at) VALUES (?, ?, 'published', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, datetime('now'), datetime('now'), datetime('now'))" ); (seed.content?.pages || []).forEach(p => { insertPage.run(p.id, p.slug, p.data.title, p.data.subtitle, p.data.badge, p.data.hero_image, p.data.theme, p.data.show_cta ? 1 : 0, p.data.cta_text, p.data.cta_link, p.data.variant, p.data.size); }); console.log('Pages:', db.prepare('SELECT COUNT(*) as c FROM ec_pages').get().c); db.close(); console.log('Done');