-- Métadonnées des fichiers et dossiers (tags, icône, auteurs), par racine : -- "main" (arborescence commune), "home/" (espace personnel), "s3". CREATE TABLE item_meta ( root text NOT NULL, path text NOT NULL, tags text[] NOT NULL DEFAULT '{}', favorite boolean NOT NULL DEFAULT false, icon text NOT NULL DEFAULT '', created timestamptz, created_by text NOT NULL DEFAULT '', edited_by text NOT NULL DEFAULT '', PRIMARY KEY (root, path) ); -- Liens de partage ; data reprend le format de .shares.json. CREATE TABLE shares ( id text PRIMARY KEY, root text NOT NULL, data jsonb NOT NULL ); CREATE INDEX shares_root ON shares (root); -- Reprises uniques des anciens fichiers JSON (une ligne par racine et par type). CREATE TABLE imports ( root text NOT NULL, kind text NOT NULL, done timestamptz NOT NULL DEFAULT now(), PRIMARY KEY (root, kind) );