feat: add listed field to note for public listing visibility
Notes with listed=false are filtered out from all GET /notes queries. The field defaults to true so existing and new notes without it remain visible. Migration handles existing databases with ALTER TABLE ADD COLUMN.
This commit is contained in:
@@ -7,10 +7,19 @@ db.exec(`
|
||||
createdAt DATETIME NOT NULL,
|
||||
did TEXT NOT NULL,
|
||||
rkey TEXT NOT NULL,
|
||||
listed INTEGER NOT NULL DEFAULT 1,
|
||||
PRIMARY KEY (did, rkey)
|
||||
);
|
||||
`);
|
||||
|
||||
try {
|
||||
db.exec(
|
||||
`ALTER TABLE note ADD COLUMN listed INTEGER NOT NULL DEFAULT 1;`,
|
||||
);
|
||||
} catch {
|
||||
// Column already exists — no-op
|
||||
}
|
||||
|
||||
db.exec(`
|
||||
CREATE TABLE IF NOT EXISTS state (
|
||||
key TEXT PRIMARY KEY,
|
||||
|
||||
Reference in New Issue
Block a user