2023-07-21 20:52:06 +01:00
|
|
|
DROP TABLE IF EXISTS users;
|
|
|
|
DROP TABLE IF EXISTS notes;
|
|
|
|
DROP TABLE IF EXISTS sessions;
|
|
|
|
|
|
|
|
CREATE TABLE users (
|
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
created TEXT NOT NULL,
|
|
|
|
username TEXT NOT NULL,
|
2024-06-24 16:55:48 +01:00
|
|
|
password TEXT NOT NULL,
|
|
|
|
versionTwoLegacyPassword TEXT NOT NULL DEFAULT 'nil',
|
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
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE sessions (
|
2023-08-19 14:17:23 +01:00
|
|
|
sessionid INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
|
|
session TEXT NOT NULL,
|
|
|
|
id INTEGER NOT NULL,
|
2024-04-29 00:15:40 +01:00
|
|
|
device TEXT NOT NULL DEFAULT '?'
|
2023-07-21 20:52:06 +01:00
|
|
|
);
|