diff --git a/.gitignore b/.gitignore index 1a2a4de..00abf46 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ __image_snapshots_/ __diff_output__/ trace/ .node-persist/ +public/audio/ *snap.png @@ -23,7 +24,6 @@ trace/ *.pptx *.mp4 *.mp3 - *.db *.codio diff --git a/modules/accounts.js b/modules/accounts.js index fa12066..2ac2e93 100644 --- a/modules/accounts.js +++ b/modules/accounts.js @@ -15,6 +15,30 @@ module.exports = class User { // we need this table to store the user accounts const sql = 'CREATE TABLE IF NOT EXISTS users (user TEXT PRIMARY KEY, pass TEXT);' await this.db.run(sql) + await this.db.run(`CREATE TABLE IF NOT EXISTS "uploads" ( + "uploadID" INTEGER, + "user" TEXT, + "name" TEXT, + "artist" TEXT, + "genre" TEXT, + "album" TEXT, + "playlist" TEXT, + FOREIGN KEY("user") REFERENCES "users"("user"), + PRIMARY KEY("uploadID" AUTOINCREMENT) + );`) + await this.db.run(`CREATE TABLE IF NOT EXISTS "playlists" ( + "playlistID" INTEGER, + "user" TEXT, + "name" TEXT, + "imageName" TEXT, + FOREIGN KEY("user") REFERENCES "users"("user"), + PRIMARY KEY("playlistID") + );`) + await this.db.run(`CREATE TABLE IF NOT EXISTS "audio_ratings" ( + "value" TINYINT, + "user" TEXT, + "uploadId" INTEGER + );`) return this })() } diff --git a/public/playlist_image/5.jpg b/public/playlist_image/5.jpg deleted file mode 100644 index 88e8a50..0000000 Binary files a/public/playlist_image/5.jpg and /dev/null differ diff --git a/public/website.db b/public/website.db deleted file mode 100644 index 9c9cfba..0000000 Binary files a/public/website.db and /dev/null differ