Changeset 7881080 in Klonkt for src/config/database.js
- Timestamp:
- 06/18/2026 03:28:34 AM (3 months ago)
- Branches:
- main
- Children:
- 8398935
- Parents:
- 98ecf51
- File:
-
- 1 edited
-
src/config/database.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/config/database.js
r98ecf51 r7881080 50 50 ensureColumn('sites', 'allow_circle', 'INTEGER DEFAULT 1'); 51 51 52 // Eén EXPLICIETE primaire/hoofd-site (= de bedrijfs-/labelsite in hub-modus, 53 // de enige site in solo) i.p.v. de fragiele "oudste = hoofd"-conventie die op 54 // 4 plekken gedupliceerd stond. Backfill: markeer de oudste als er nog geen 55 // primaire site is, zodat bestaand gedrag exact behouden blijft. 56 ensureColumn('sites', 'is_primary', 'INTEGER DEFAULT 0'); 57 try { 58 const hasPrimary = db.prepare('SELECT 1 FROM sites WHERE is_primary = 1 LIMIT 1').get(); 59 if (!hasPrimary) { 60 const oldest = db.prepare('SELECT id FROM sites ORDER BY created_at ASC LIMIT 1').get(); 61 if (oldest) db.prepare('UPDATE sites SET is_primary = 1 WHERE id = ?').run(oldest.id); 62 } 63 } catch (e) { /* sites-tabel nog leeg/afwezig bij verse init — ensurePrimarySite regelt 't */ } 64 52 65 // v9 audit additions ————————————————————————————————————————— 53 66 // SEO/social columns the v9 template uses (most live in 001-init.sql already
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)