Phase B (items 1-6) of docs/AFFINE.md.
Properties: workspaces define custom page properties (text, number,
checkbox, date, select, multi-select, person, link) in the new
workspace_properties collection; pages keep their values in
pages.properties, checked against each property's type. The Info panel
under the title shows tags, custom and built-in properties, following
each property's visibility; the Info side panel shows them all, with the
page's collections and the journal. Settings gains Page properties and
Tags sections.
Tags: coloured, per workspace (tags collection, pages.tags); create from
the picker, rename, recolour, merge and delete. Search filters by tag.
All docs: GET /workspaces/{id}/docs lists the pages the caller can open
with their properties, narrowed by space, tag, collection or filter
rules evaluated on the server. The view shows a list, grid or cards,
groups and orders by any property, picks the properties shown, and acts
on several pages at once (tag, move, trash, collect).
Collections (page_collections): saved rules plus pages added or taken
out by hand, private to their creator until shared with the workspace,
listed in the sidebar.
Journals: one page per person and day in a private journal space
(spaces.journal_owner) that workspace admins do not see into, made on
first use. A week strip marks days with pages, new days can start from
a template, and dates in read mode open that day's journal.
The migration and schema snapshot, OpenAPI spec and generated Go, TS and
Dart types are updated (the Dart generator learns untyped values), the
mobile editor bundle is rebuilt, the new strings are translated into all
five languages, and the user guide covers the new features.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Database schema
docwell-db is a stock PocketBase: the stack runs
tajniak81/pocketbase-docker-root
(source) as it is. There is no Docwell image for it any more.
docwell-server brings PocketBase up to Docwell's schema itself, every time it starts
(Server/internal/pbschema): missing collections and fields are created,
existing ones keep their data. It also writes the DOCWELL_* settings (app name and URL, mail, file storage) and
sends Docwell's own emails, so PocketBase needs no hooks either.
This folder is where that schema is written:
pb_migrations/holds the JS migrations, the source of truth for the schema.export-schema.shturns them intoServer/internal/pbschema/schema.json, the snapshot docwell-server embeds and applies.- All collection API rules are
null, so only superusers have access. Never expose PocketBase publicly; only docwell-server talks to it.
Changing the schema
-
Add a migration to
pb_migrations/(pocketbase migrate create "add_comments" --migrationsDir ./pb_migrations, or copy an existing file). Leave earlier migrations alone. -
Regenerate the snapshot (needs Docker and Go):
sh Database/export-schema.sh -
Commit the migration and the new
schema.jsontogether.go test ./internal/pbschemachecks the snapshot.
Removing a collection or a field is not done by the snapshot: it only adds and updates. Do that by hand, once, in the PocketBase dashboard of each install, after the release that stops using it.
The admin panel manages two parts of the users collection itself, the OAuth2 providers and the magic link switch
(otp.enabled), so the snapshot leaves them out and they keep whatever is set.
Run locally
Download PocketBase v0.40.6 for your OS into Database/bin/, then:
./bin/pocketbase superuser upsert admin@docwell.test devpassword123 --dir ./pb_data
./bin/pocketbase serve --dir ./pb_data --http 127.0.0.1:8070
Start docwell-server against it (DOCWELL_PB_EMAIL and DOCWELL_PB_PASSWORD set to that superuser) and it creates
the collections. The PocketBase dashboard is at http://127.0.0.1:8070/_/.