2023-07-21 20:52:06 +01:00
|
|
|
DROP TABLE IF EXISTS users;
|
|
|
|
DROP TABLE IF EXISTS notes;
|
2024-07-20 16:45:21 +01:00
|
|
|
DROP TABLE IF EXISTS oauth;
|
2023-07-21 20:52:06 +01:00
|
|
|
|
|
|
|
CREATE TABLE users (
|
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
created TEXT NOT NULL,
|
|
|
|
username TEXT NOT NULL,
|
2024-07-20 20:35:54 +01:00
|
|
|
password TEXT NOT NULL,
|
|
|
|
migrated INTEGER NOT NULL DEFAULT 0
|
2023-07-21 20:52:06 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE notes (
|
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
creator INTEGER NOT NULL,
|
|
|
|
created TEXT NOT NULL,
|
|
|
|
edited TEXT NOT NULL,
|
|
|
|
content TEXT NOT NULL,
|
|
|
|
title TEXT NOT NULL
|
|
|
|
);
|
|
|
|
|
2024-07-20 10:52:18 +01:00
|
|
|
CREATE TABLE oauth (
|
|
|
|
id INTEGER NOT NULL,
|
|
|
|
oauthProvider TEXT NOT NULL,
|
|
|
|
encryptedPasswd TEXT NOT NULL,
|
|
|
|
UNIQUE (id, oauthProvider)
|
|
|
|
)
|