UNPKG

@beaker/core

Version:
73 lines (61 loc) 2.35 kB
module.exports = ` CREATE TABLE profiles ( id INTEGER PRIMARY KEY NOT NULL, url TEXT, createdAt INTEGER DEFAULT (strftime('%s', 'now')) ); CREATE TABLE archives ( profileId INTEGER NOT NULL, key TEXT NOT NULL, localPath TEXT, -- deprecated isSaved INTEGER, createdAt INTEGER DEFAULT (strftime('%s', 'now')) ); CREATE TABLE archives_meta ( key TEXT PRIMARY KEY, title TEXT, description TEXT, forkOf TEXT, -- deprecated createdByUrl TEXT, -- deprecated createdByTitle TEXT, -- deprecated mtime INTEGER, metaSize INTEGER, -- deprecated stagingSize INTEGER, -- deprecated isOwner INTEGER ); CREATE TABLE bookmarks ( profileId INTEGER, url TEXT NOT NULL, title TEXT, pinned INTEGER, createdAt INTEGER DEFAULT (strftime('%s', 'now')), PRIMARY KEY (profileId, url), FOREIGN KEY (profileId) REFERENCES profiles (id) ON DELETE CASCADE ); CREATE TABLE visits ( profileId INTEGER, url TEXT NOT NULL, title TEXT NOT NULL, ts INTEGER NOT NULL, FOREIGN KEY (profileId) REFERENCES profiles (id) ON DELETE CASCADE ); CREATE TABLE visit_stats ( url TEXT NOT NULL, num_visits INTEGER, last_visit_ts INTEGER ); CREATE VIRTUAL TABLE visit_fts USING fts4 (url, title); CREATE UNIQUE INDEX visits_stats_url ON visit_stats (url); -- default profile INSERT INTO profiles (id) VALUES (0); -- default bookmarks INSERT INTO bookmarks (profileId, title, url, pinned) VALUES (0, 'Beaker Home', 'dat://beakerbrowser.com', 1); INSERT INTO bookmarks (profileId, title, url, pinned) VALUES (0, 'Dat Project', 'dat://datproject.org', 1); INSERT INTO bookmarks (profileId, title, url, pinned) VALUES (0, '@BeakerBrowser', 'https://twitter.com/beakerbrowser', 1); INSERT INTO bookmarks (profileId, title, url, pinned) VALUES (0, 'Hashbase', 'https://hashbase.io', 1); INSERT INTO bookmarks (profileId, title, url, pinned) VALUES (0, 'Documentation', 'dat://beakerbrowser.com/docs', 1); INSERT INTO bookmarks (profileId, title, url, pinned) VALUES (0, 'Report an issue', 'https://github.com/beakerbrowser/beaker/issues', 1); INSERT INTO bookmarks (profileId, title, url, pinned) VALUES (0, 'Explore the p2p Web', 'dat://taravancil.com/explore-the-p2p-web.md', 1); INSERT INTO bookmarks (profileId, title, url, pinned) VALUES (0, 'Support Beaker', 'https://opencollective.com/beaker', 1); PRAGMA user_version = 1; `