ckolderup / postmarks

a single-user bookmarking website designed to live on the Fediverse
https://postmarks.glitch.me
MIT License
456 stars 38 forks source link

Add new unified database, migrate actor data #135

Open johnholdun opened 9 months ago

johnholdun commented 9 months ago

The app currently stores data and configuration across two SQLite databases and a static JSON file. This issue describes the first part of a multi-step process to consolidate these stores into one new SQLite database, enabling more flexibility in administrative settings and general long-term stability. Extracted from #6, as written by @ckolderup:

  1. Create a new application.db database file with a unified setup process that establishes the new schema + migration process with a barebones schema
  2. Create a process by which the setup process detects existing account.json + activitypub.db actor singleton tables and imports them into an application.db settings table with schema defined in the migration .sql file (or files).
  3. Make the application code read this info from application.db instead of account.json/activitypub.db. Add the admin settings to manage the relevant settings data in application.db to make account.json obsolete. Set things up so that on startup, if all the required settings table key/value pairs are present, the owner is notified that they can remove account.json from their filesystem.