|
|
|
internal/sites/schema.go raw
| 1 | package sites | | 2 | | | 3 | import ( | | 4 | "context" | | 5 | "database/sql" | | 6 | ) | | 7 | | | 8 | const manifestSchema = `CREATE TABLE IF NOT EXISTS site_manifests ( | | 9 | label TEXT PRIMARY KEY, event_id TEXT NOT NULL, kind INTEGER NOT NULL, | | 10 | pubkey TEXT NOT NULL, d TEXT NOT NULL DEFAULT '' , updated_at INTEGER NOT NULL | | 11 | ); | | 12 | CREATE TRIGGER IF NOT EXISTS site_manifest_event_deleted | | 13 | AFTER DELETE ON events | | 14 | WHEN old.kind IN (5128,15128,35128) | | 15 | BEGIN | | 16 | DELETE FROM site_manifests WHERE event_id=old.id; | | 17 | END;` | | 18 | | | 19 | func ensureManifestSchema(ctx context.Context, db *sql.DB) error { | | 20 | _, err := db.ExecContext(ctx, manifestSchema) | | 21 | return err | | 22 | } |
|
|
About| owner | c01503e8035f |
|---|
| visibility | public |
|---|
| head | d730679639bf |
|---|
Maintainers- c01503e8035f owner
- ba1b5beed5b5 agent hermes
Clonehttps://012.run/npub1cq2s86qrtadf36eqq3epm38wmhdynrrcwxf84eldk3f94dkv7ttsrulrz5/tinyrelay.git
|