Skip to content
Permalink
Browse files
db is now auto-generated and gitignore updated
  • Loading branch information
nealc3 committed Nov 23, 2019
1 parent 033c0ea commit d1d2a8181a15529e52c83c0319d4cc1653e7eccd
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
@@ -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
@@ -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
})()
}
Binary file not shown.
BIN -36 KB public/website.db
Binary file not shown.

0 comments on commit d1d2a81

Please sign in to comment.