Initial commit
This commit is contained in:
commit
9fe412be11
58 changed files with 6215 additions and 0 deletions
23
src/noose/migrations/1697409647688_create_events.sql
Normal file
23
src/noose/migrations/1697409647688_create_events.sql
Normal file
|
@ -0,0 +1,23 @@
|
|||
CREATE TABLE events (
|
||||
id TEXT PRIMARY KEY,
|
||||
kind INTEGER NOT NULL,
|
||||
pubkey TEXT NOT NULL,
|
||||
content TEXT NOT NULL,
|
||||
created_at INTEGER NOT NULL,
|
||||
tags TEXT NOT NULL,
|
||||
sig TEXT NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX idx_events_kind ON events (kind);
|
||||
CREATE INDEX idx_events_pubkey ON events (pubkey);
|
||||
|
||||
|
||||
CREATE TABLE tags (
|
||||
tag TEXT NOT NULL,
|
||||
value TEXT NOT NULL,
|
||||
event_id TEXT REFERENCES events(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE INDEX idx_tags_tag ON tags (tag);
|
||||
CREATE INDEX idx_tags_value ON tags (value);
|
||||
CREATE INDEX idx_tags_event_id ON tags (event_id);
|
5
src/noose/migrations/1697410161900_add_relays.sql
Normal file
5
src/noose/migrations/1697410161900_add_relays.sql
Normal file
|
@ -0,0 +1,5 @@
|
|||
CREATE TABLE relays (
|
||||
url TEXT PRIMARY KEY,
|
||||
domain TEXT NOT NULL,
|
||||
active BOOLEAN NOT NULL
|
||||
);
|
1
src/noose/migrations/1697410223576_events_fts.sql
Normal file
1
src/noose/migrations/1697410223576_events_fts.sql
Normal file
|
@ -0,0 +1 @@
|
|||
CREATE VIRTUAL TABLE events_fts USING fts5(id, content);
|
10
src/noose/migrations/1697410294265_users.sql
Normal file
10
src/noose/migrations/1697410294265_users.sql
Normal file
|
@ -0,0 +1,10 @@
|
|||
CREATE TABLE users (
|
||||
pubkey TEXT PRIMARY KEY,
|
||||
username TEXT NOT NULL UNIQUE,
|
||||
inserted_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
admin BOOLEAN DEFAULT false
|
||||
);
|
||||
|
||||
CREATE INDEX idx_users_pubkey ON users (pubkey);
|
||||
CREATE INDEX idx_users_username ON users (username);
|
||||
|
2
src/noose/migrations/1697410424624_pragma.sql
Normal file
2
src/noose/migrations/1697410424624_pragma.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
PRAGMA foreign_keys = ON;
|
||||
PRAGMA auto_vacuum = FULL;
|
11
src/noose/migrations/1697410480767_unattached_media.sql
Normal file
11
src/noose/migrations/1697410480767_unattached_media.sql
Normal file
|
@ -0,0 +1,11 @@
|
|||
CREATE TABLE unattached_media (
|
||||
id TEXT PRIMARY KEY,
|
||||
pubkey TEXT NOT NULL,
|
||||
url TEXT NOT NULL,
|
||||
data TEXT NOT NULL,
|
||||
uploaded_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE INDEX unattached_media_id ON unattached_media (id);
|
||||
CREATE INDEX unattached_media_pubkey ON unattached_media (pubkey);
|
||||
CREATE INDEX unattached_media_url ON unattached_media (url);
|
Loading…
Add table
Add a link
Reference in a new issue