Auto-indexing service and GraphQL API for AT Protocol Records
quickslice.slices.network/
atproto
gleam
graphql
1-- migrate:up
2
3-- Add default_visibility to label_definition
4ALTER TABLE label_definition ADD COLUMN default_visibility TEXT NOT NULL DEFAULT 'warn';
5
6-- Set appropriate defaults for specific labels
7-- porn should hide by default, while other content warnings should show a warning
8UPDATE label_definition SET default_visibility = 'hide' WHERE val = 'porn';
9
10-- Create actor_label_preferences table
11CREATE TABLE IF NOT EXISTS actor_label_preference (
12 did TEXT NOT NULL,
13 label_val TEXT NOT NULL,
14 visibility TEXT NOT NULL,
15 created_at TEXT NOT NULL DEFAULT (datetime('now')),
16 PRIMARY KEY (did, label_val)
17);
18
19-- Index for fast lookups by user
20CREATE INDEX IF NOT EXISTS idx_actor_label_preference_did ON actor_label_preference(did);
21
22-- migrate:down
23
24DROP INDEX IF EXISTS idx_actor_label_preference_did;
25DROP TABLE IF EXISTS actor_label_preference;
26-- Note: SQLite doesn't support DROP COLUMN, would need table recreation