2023-02-26 02:01:19 +00:00
|
|
|
-- Add migration script here
|
2023-03-01 08:35:10 +00:00
|
|
|
-- create relays
|
|
|
|
CREATE TABLE
|
|
|
|
relays (
|
|
|
|
id INTEGER PRIMARY KEY,
|
|
|
|
relay_url TEXT NOT NULL,
|
|
|
|
relay_status INTEGER NOT NULL DEFAULT 1,
|
|
|
|
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
|
|
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
|
|
);
|
|
|
|
|
2023-03-15 08:27:07 +00:00
|
|
|
-- add default relays
|
|
|
|
-- relay status:
|
|
|
|
-- 0: off
|
|
|
|
-- 1: on
|
2023-03-01 08:35:10 +00:00
|
|
|
INSERT INTO
|
|
|
|
relays (relay_url, relay_status)
|
|
|
|
VALUES
|
|
|
|
("wss://relay.damus.io", "1"),
|
2023-03-27 13:28:26 +00:00
|
|
|
("wss://eden.nostr.land", "0"),
|
2023-03-01 08:35:10 +00:00
|
|
|
("wss://nostr-pub.wellorder.net", "1"),
|
|
|
|
("wss://nostr.bongbong.com", "1"),
|
|
|
|
("wss://nostr.zebedee.cloud", "1"),
|
|
|
|
("wss://nostr.fmt.wiz.biz", "1"),
|
2023-03-27 13:28:26 +00:00
|
|
|
("wss://nostr.walletofsatoshi.com", "0"),
|
2023-03-01 08:35:10 +00:00
|
|
|
("wss://relay.snort.social", "1"),
|
|
|
|
("wss://offchain.pub", "1"),
|
2023-03-27 13:28:26 +00:00
|
|
|
("wss://brb.io", "0"),
|
2023-03-15 08:03:12 +00:00
|
|
|
("wss://relay.current.fyi", "1"),
|
2023-03-27 13:28:26 +00:00
|
|
|
("wss://nostr.relayer.se", "0"),
|
2023-03-15 08:03:12 +00:00
|
|
|
("wss://nostr.bitcoiner.social", "1"),
|
|
|
|
("wss://relay.nostr.info", "1"),
|
2023-03-27 13:28:26 +00:00
|
|
|
("wss://relay.zeh.app", "0"),
|
2023-03-15 08:03:12 +00:00
|
|
|
("wss://nostr-01.dorafactory.org", "1"),
|
|
|
|
("wss://nostr.zhongwen.world", "1"),
|
|
|
|
("wss://nostro.cc", "1"),
|
|
|
|
("wss://relay.nostr.net.in", "1"),
|
2023-03-01 08:35:10 +00:00
|
|
|
("wss://nos.lol", "1");
|
|
|
|
|
2023-02-26 02:01:19 +00:00
|
|
|
-- create accounts
|
2023-03-15 08:27:07 +00:00
|
|
|
-- is_active (part of multi-account feature):
|
|
|
|
-- 0: false
|
|
|
|
-- 1: true
|
2023-02-26 02:01:19 +00:00
|
|
|
CREATE TABLE
|
|
|
|
accounts (
|
|
|
|
id TEXT PRIMARY KEY,
|
|
|
|
privkey TEXT NOT NULL,
|
|
|
|
npub TEXT NOT NULL,
|
|
|
|
nsec TEXT NOT NULL,
|
2023-03-01 08:35:10 +00:00
|
|
|
is_active INTEGER NOT NULL DEFAULT 0,
|
2023-03-22 02:22:34 +00:00
|
|
|
metadata TEXT
|
2023-02-26 02:01:19 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
-- create follows
|
2023-03-15 08:27:07 +00:00
|
|
|
-- kind (part of multi-newsfeed feature):
|
|
|
|
-- 0: direct
|
|
|
|
-- 1: follow of follow
|
2023-02-26 02:01:19 +00:00
|
|
|
CREATE TABLE
|
|
|
|
follows (
|
|
|
|
id INTEGER PRIMARY KEY,
|
|
|
|
pubkey TEXT NOT NULL,
|
|
|
|
account TEXT NOT NULL,
|
2023-02-26 13:51:25 +00:00
|
|
|
kind INTEGER NOT NULL DEFAULT 0,
|
2023-03-22 02:22:34 +00:00
|
|
|
metadata TEXT
|
2023-02-26 02:01:19 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
-- create index for pubkey in follows
|
2023-03-15 08:27:07 +00:00
|
|
|
CREATE UNIQUE INDEX index_pubkey_on_follows ON follows (pubkey);
|
2023-02-26 02:01:19 +00:00
|
|
|
|
|
|
|
-- create cache profiles
|
|
|
|
CREATE TABLE
|
|
|
|
cache_profiles (
|
|
|
|
id TEXT PRIMARY KEY,
|
2023-03-22 02:22:34 +00:00
|
|
|
metadata TEXT,
|
2023-02-26 13:51:25 +00:00
|
|
|
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
|
|
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
2023-02-26 02:01:19 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
-- create cache notes
|
|
|
|
CREATE TABLE
|
|
|
|
cache_notes (
|
|
|
|
id TEXT PRIMARY KEY,
|
2023-02-28 06:20:47 +00:00
|
|
|
pubkey TEXT NOT NULL,
|
|
|
|
created_at TEXT,
|
2023-02-26 13:51:25 +00:00
|
|
|
kind INTEGER NOT NULL DEFAULT 1,
|
2023-02-28 06:20:47 +00:00
|
|
|
tags TEXT NOT NULL,
|
2023-03-22 02:22:34 +00:00
|
|
|
content TEXT NOT NULL,
|
2023-03-26 01:53:50 +00:00
|
|
|
parent_id TEXT,
|
|
|
|
parent_comment_id TEXT
|
2023-03-27 04:28:57 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
-- create settings
|
|
|
|
CREATE TABLE
|
|
|
|
settings (
|
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
setting_key TEXT NOT NULL,
|
|
|
|
setting_value TEXT NOT NULL
|
|
|
|
);
|
|
|
|
|
|
|
|
-- add default setting
|
|
|
|
INSERT INTO
|
|
|
|
settings (setting_key, setting_value)
|
|
|
|
VALUES
|
|
|
|
("last_login", "0");
|