feat(db): add albums table

This commit is contained in:
2024-11-28 02:49:55 +01:00
parent e69b45ca24
commit 05b2e11ab4

View File

@@ -37,6 +37,16 @@ pub fn initialize_database(
[],
)?;
connection.execute(
"CREATE TABLE IF NOT EXISTS albums (
name TEXT NOT NULL,
artist_id INTEGER NOT NULL,
PRIMARY KEY (name, artist_id),
FOREIGN KEY (artist_id) REFERENCES artists (id) ON DELETE CASCADE
)",
[],
)?;
connection.execute(
"
CREATE TABLE IF NOT EXISTS tracks (