Compare commits

...

4 Commits

Author SHA1 Message Date
f4f1e4b96f Move schema module to server only
All checks were successful
Push Workflows / rustfmt (push) Successful in 4s
Push Workflows / tailwind-build (push) Successful in 5s
Push Workflows / docs (push) Successful in 39s
Push Workflows / clippy (push) Successful in 42s
Push Workflows / test (push) Successful in 52s
Push Workflows / build (push) Successful in 1m26s
Push Workflows / nix-build (push) Successful in 5m3s
2026-06-26 18:10:13 -04:00
1bf5c0f2da Ignore diesel lock file 2026-06-26 18:08:52 -04:00
773d8dffd1 Create users table 2026-06-26 18:08:03 -04:00
fb3afaf31c Add chrono
Enable chrono feature for diesel
2026-06-26 17:46:50 -04:00
7 changed files with 29 additions and 2 deletions

2
.gitignore vendored
View File

@@ -16,3 +16,5 @@ config.ron
config.toml config.toml
config.yaml config.yaml
config.yml config.yml
/migrations/.diesel_lock

3
Cargo.lock generated
View File

@@ -325,6 +325,7 @@ dependencies = [
"iana-time-zone", "iana-time-zone",
"js-sys", "js-sys",
"num-traits", "num-traits",
"serde",
"wasm-bindgen", "wasm-bindgen",
"windows-link", "windows-link",
] ]
@@ -738,6 +739,7 @@ checksum = "29fe29a87fb84c631ffb3ba21798c4b1f3a964701ba78f0dce4bf8668562ec88"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"byteorder", "byteorder",
"chrono",
"diesel_derives", "diesel_derives",
"downcast-rs", "downcast-rs",
"itoa", "itoa",
@@ -2306,6 +2308,7 @@ dependencies = [
name = "libretunes" name = "libretunes"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"chrono",
"config", "config",
"diesel", "diesel",
"diesel-async", "diesel-async",

View File

@@ -9,8 +9,9 @@ edition = "2024"
build = "src/build.rs" build = "src/build.rs"
[dependencies] [dependencies]
chrono = { version = "0.4.45", features = ["serde"] }
config = { version = "0.15.24", optional = true } config = { version = "0.15.24", optional = true }
diesel = { version = "2.3.10", optional = true } diesel = { version = "2.3.10", optional = true, features = ["chrono"] }
diesel-async = { version = "0.9.1", optional = true, features = ["postgres", "deadpool", "migrations"] } diesel-async = { version = "0.9.1", optional = true, features = ["postgres", "deadpool", "migrations"] }
diesel_migrations = { version = "2.3.2", optional = true } diesel_migrations = { version = "2.3.2", optional = true }
dioxus = { version = "0.7.9", features = ["router", "fullstack"] } dioxus = { version = "0.7.9", features = ["router", "fullstack"] }

View File

@@ -0,0 +1,2 @@
DROP INDEX users_username_idx;
DROP TABLE users;

View File

@@ -0,0 +1,8 @@
CREATE TABLE users (
id INTEGER PRIMARY KEY UNIQUE NOT NULL GENERATED ALWAYS AS IDENTITY,
username VARCHAR UNIQUE NOT NULL,
hashed_password VARCHAR NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE UNIQUE INDEX users_username_idx ON users(username);

View File

@@ -3,9 +3,11 @@ pub mod app;
pub mod components; pub mod components;
pub mod models; pub mod models;
pub mod pages; pub mod pages;
pub mod schema;
pub mod util; pub mod util;
#[cfg(feature = "server")]
pub mod schema;
#[cfg(feature = "server")] #[cfg(feature = "server")]
pub mod server; pub mod server;

View File

@@ -1 +1,10 @@
// @generated automatically by Diesel CLI. // @generated automatically by Diesel CLI.
diesel::table! {
users (id) {
id -> Int4,
username -> Varchar,
hashed_password -> Varchar,
created_at -> Timestamptz,
}
}