Switch to postgresql, finish minimum viable task_tracker/ws_bucket integration

This commit is contained in:
simon987
2019-03-27 19:34:05 -04:00
parent b170f9bfd8
commit b9f25630b4
8 changed files with 160 additions and 109 deletions

View File

@@ -1,22 +1,22 @@
PRAGMA journal_mode=WAL;
DROP TABLE IF EXISTS Website, Admin, BlacklistedWebsite, ApiClient, SearchLogEntry;
CREATE TABLE Website (
id INTEGER PRIMARY KEY NOT NULL,
id SERIAL PRIMARY KEY NOT NULL,
url TEXT,
logged_ip TEXT,
logged_useragent TEXT,
last_modified INTEGER DEFAULT CURRENT_TIMESTAMP
last_modified TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE Admin (
username TEXT PRIMARY KEY NOT NULL,
password TEXT,
password BYTEA,
role TEXT
);
CREATE TABLE BlacklistedWebsite (
id INTEGER PRIMARY KEY NOT NULL,
id SERIAL PRIMARY KEY NOT NULL,
url TEXT
);
@@ -25,16 +25,15 @@ CREATE TABLE ApiClient (
token TEXT NOT NULL
);
CREATE TABLE SearchLogEntry (
id INTEGER PRIMARY KEY,
id SERIAL PRIMARY KEY,
search_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
remote_addr TEXT,
forwarded_for TEXT,
query TEXT,
extensions TEXT,
page INT,
blocked INT DEFAULT 0,
blocked BOOLEAN DEFAULT FALSE,
results INT DEFAULT 0,
took INT DEFAULT 0
);