Changeset 0b7ebbf in Klonkt for src/config/database.js


Ignore:
Timestamp:
06/16/2026 01:12:00 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
57929aa
Parents:
63edb0d (diff), efdde37 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'feat/cirkels-v1'

# Conflicts:
# src/routes/admin-settings.js

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/config/database.js

    r63edb0d r0b7ebbf  
    4747  // Per-site Prutter toggle: when off, DM endpoints/UI are hidden for that site.
    4848  ensureColumn('sites', 'enable_prutter', 'INTEGER DEFAULT 1');
     49  // Cirkels: mag deze site in cirkels van anderen verschijnen (surfacing opt-out).
     50  ensureColumn('sites', 'allow_circle', 'INTEGER DEFAULT 1');
    4951
    5052  // v9 audit additions —————————————————————————————————————————
     
    106108  `);
    107109  db.prepare("INSERT OR IGNORE INTO app_settings (key, value) VALUES ('tenancy', 'solo')").run();
     110
     111  // ── Cirkels (federatie) ─────────────────────────────────────
     112  // Decentrale, asymmetrische verbindingen tussen solo-instances.
     113  db.exec(`
     114    CREATE TABLE IF NOT EXISTS circle_links (
     115      id TEXT PRIMARY KEY,
     116      local_site_id TEXT NOT NULL,
     117      remote_url TEXT NOT NULL,
     118      remote_actor_id TEXT,
     119      label TEXT,
     120      status TEXT DEFAULT 'active',
     121      added_at DATETIME DEFAULT CURRENT_TIMESTAMP,
     122      last_synced DATETIME,
     123      last_error TEXT,
     124      UNIQUE(local_site_id, remote_url),
     125      FOREIGN KEY (local_site_id) REFERENCES sites(id)
     126    );
     127    CREATE TABLE IF NOT EXISTS remote_actors (
     128      id TEXT PRIMARY KEY,
     129      url TEXT UNIQUE NOT NULL,
     130      name TEXT,
     131      summary TEXT,
     132      avatar TEXT,
     133      public_key TEXT NOT NULL,
     134      fetched_at DATETIME DEFAULT CURRENT_TIMESTAMP
     135    );
     136    CREATE TABLE IF NOT EXISTS remote_posts (
     137      id TEXT PRIMARY KEY,
     138      actor_id TEXT NOT NULL,
     139      published DATETIME,
     140      title TEXT,
     141      summary TEXT,
     142      url TEXT,
     143      media_json TEXT,
     144      raw_json TEXT,
     145      fetched_at DATETIME DEFAULT CURRENT_TIMESTAMP,
     146      FOREIGN KEY (actor_id) REFERENCES remote_actors(id)
     147    );
     148  `);
    108149}
    109150
Note: See TracChangeset for help on using the changeset viewer.