Integrate with db

This commit is contained in:
Alexander
2026-06-26 19:53:50 +02:00
parent 3d1f9a206f
commit a5023a6441
7 changed files with 2599 additions and 22 deletions
+20
View File
@@ -0,0 +1,20 @@
CREATE TABLE items (
inode BIGINT PRIMARY KEY,
name TEXT NOT NULL,
original_path TEXT NOT NULL,
local_path TEXT NOT NULL,
file_type TEXT NOT NULL CHECK (file_type IN ('directory', 'file')),
hash BIGINT NOT NULL
);
CREATE TABLE music_metadata (
inode BIGINT PRIMARY KEY REFERENCES items(inode) ON DELETE CASCADE,
track_title TEXT NOT NULL,
album TEXT NOT NULL,
track_number INTEGER NOT NULL
);
CREATE TABLE music_metadata_artists (
inode BIGINT NOT NULL REFERENCES music_metadata(inode) ON DELETE CASCADE,
artist TEXT NOT NULL
);