Create the initial database migration

This commit is contained in:
Savanni D'Gerinel 2023-10-03 13:31:43 -04:00
parent 535ea6cd9d
commit 6aedff8cda
4 changed files with 15 additions and 0 deletions

1
Cargo.lock generated
View File

@ -743,6 +743,7 @@ dependencies = [
name = "file-service"
version = "0.1.0"
dependencies = [
"base64ct",
"build_html",
"bytes",
"chrono",

View File

@ -27,6 +27,7 @@ thiserror = "1.0.20"
tokio = { version = "1", features = [ "full" ] }
uuid = { version = "0.4", features = [ "serde", "v4" ] }
warp = { version = "0.3" }
base64ct = { version = "1", features = [ "alloc" ] }
[dev-dependencies]
cool_asserts = { version = "2" }

View File

@ -0,0 +1,12 @@
-- Add migration script here
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY NOT NULL,
username TEXT NOT NULL,
token TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS session_tokens (
token TEXT NOT NULL,
user INTEGER,
FOREIGN KEY(user) REFERENCES user(id)
);

View File

@ -43,6 +43,7 @@
pkgs.cargo-nextest
pkgs.crate2nix
pkgs.wasm-pack
pkgs.sqlx-cli
typeshare.packages."x86_64-linux".default
];
LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib";