This commit introduces the foundational elements of the project: - `.gitignore` file to exclude build artifacts and environment variables. - `Cargo.lock` and `Cargo.toml` defining project dependencies and metadata. - `diesel.toml` for Diesel CLI configuration. - Initial migration files (`down.sql`, `up.sql`) for database schema setup. - `rustfmt.toml` for code formatting. - Basic module structure for database, routes, schema, state, and types. - `src/main.rs` with basic Axum server setup and dotenv loading. - `src/routes/system_router.rs` for basic API endpoint. - `src/state.rs` for managing application state and database connection pool. - Type definitions for Subsonic API responses and extensions.
29 lines
1.5 KiB
SQL
29 lines
1.5 KiB
SQL
-- Your SQL goes here
|
|
CREATE TABLE users (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
username TEXT NOT NULL UNIQUE,
|
|
password TEXT NOT NULL,
|
|
email TEXT NOT NULL UNIQUE,
|
|
|
|
ldapAuthenticated BOOLEAN NOT NULL DEFAULT 0 CHECK (ldapAuthenticated IN (0,1)),
|
|
adminRole BOOLEAN NOT NULL DEFAULT 0 CHECK (adminRole IN (0,1)),
|
|
settingsRole BOOLEAN NOT NULL DEFAULT 1 CHECK (settingsRole IN (0,1)),
|
|
streamRole BOOLEAN NOT NULL DEFAULT 1 CHECK (streamRole IN (0,1)),
|
|
jukeboxRole BOOLEAN NOT NULL DEFAULT 0 CHECK (jukeboxRole IN (0,1)),
|
|
downloadRole BOOLEAN NOT NULL DEFAULT 0 CHECK (downloadRole IN (0,1)),
|
|
uploadRole BOOLEAN NOT NULL DEFAULT 0 CHECK (uploadRole IN (0,1)),
|
|
playlistRole BOOLEAN NOT NULL DEFAULT 0 CHECK (playlistRole IN (0,1)),
|
|
coverArtRole BOOLEAN NOT NULL DEFAULT 0 CHECK (coverArtRole IN (0,1)),
|
|
commentRole BOOLEAN NOT NULL DEFAULT 0 CHECK (commentRole IN (0,1)),
|
|
podcastRole BOOLEAN NOT NULL DEFAULT 0 CHECK (podcastRole IN (0,1)),
|
|
shareRole BOOLEAN NOT NULL DEFAULT 0 CHECK (shareRole IN (0,1)),
|
|
videoConversionRole BOOLEAN NOT NULL DEFAULT 0 CHECK (videoConversionRole IN (0,1))
|
|
);
|
|
|
|
CREATE TABLE user_music_folders (
|
|
user_id INTEGER NOT NULL,
|
|
music_folder_id INTEGER NOT NULL,
|
|
PRIMARY KEY (user_id, music_folder_id),
|
|
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
|
|
);
|