Re-organized into two submodules: service and uploader.

Moved all the existing service code into the `service` submodule.

Stubbed out project and GUI frame for the uploader. Idea is to have a GUI that
infers all the correct meta-data from media tag values and creates service,
songs, and performance records appropriately based on the tagged mp3/ogg files
of the performances.
This commit is contained in:
Jonathan Bernard
2017-02-11 23:53:04 -06:00
parent a6a68a5320
commit 7d7f2eed87
59 changed files with 156 additions and 86 deletions

View File

@ -0,0 +1,9 @@
-- # New Life Songs DB
-- @author Jonathan Bernard <jdb@jdb-labs.com>
--
-- PostgreSQL database un-creation sript.
DROP TABLE performances;
DROP TABLE services;
DROP TABLE songs;
DROP TABLE tokens;
DROP TABLE users;

View File

@ -0,0 +1,53 @@
-- # New Life Songs DB
-- @author Jonathan Bernard <jdb@jdb-labs.com>
--
-- PostgreSQL database creation sript.
-- Services table
CREATE TABLE services (
id SERIAL,
date DATE NOT NULL,
service_type VARCHAR(16) DEFAULT NULL,
description VARCHAR(255) DEFAULT NULL,
CONSTRAINT uc_serviceTypeAndDate UNIQUE (date, service_type),
PRIMARY KEY (id));
-- Songs table
CREATE TABLE songs (
id SERIAL,
name VARCHAR(128) NOT NULL,
artists VARCHAR(256) DEFAULT NULL,
CONSTRAINT uc_songNameAndArtist UNIQUE (name, artists),
PRIMARY KEY (id));
-- performances table
CREATE TABLE performances (
service_id INTEGER NOT NULL,
song_id INTEGER NOT NULL,
pianist VARCHAR(64) DEFAULT NULL,
organist VARCHAR(64) DEFAULT NULL,
bassist VARCHAR(64) DEFAULT NULL,
drummer VARCHAR(64) DEFAULT NULL,
guitarist VARCHAR(64) DEFAULT NULL,
leader VARCHAR(64) DEFAULT NULL,
PRIMARY KEY (service_id, song_id),
FOREIGN KEY (service_id) REFERENCES services (id) ON DELETE CASCADE,
FOREIGN KEY (song_id) REFERENCES songs (id) ON DELETE CASCADE);
-- Users table
CREATE TABLE users (
id SERIAL,
username VARCHAR(64) UNIQUE NOT NULL,
pwd VARCHAR(80),
role VARCHAR(16) NOT NULL,
PRIMARY KEY (id));
-- Tokens table
CREATE TABLE tokens (
token VARCHAR(64),
user_id INTEGER NOT NULL,
expires TIMESTAMP NOT NULL,
PRIMARY KEY (token),
FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE);

View File

@ -0,0 +1,5 @@
-- # New Life Songs DB
-- @author Jonathan Bernard <jdb@jdb-labs.com>
--
-- Remove performances.rank
ALTER TABLE performances DROP COLUMN rank;

View File

@ -0,0 +1,6 @@
-- # New Life Songs DB
-- @author Jonathan Bernard <jdb@jdb-labs.com>
--
-- Add performances.rank: the rank of the performance in the service, aka. the
-- "track number" if the service were an album.
ALTER TABLE performances ADD COLUMN rank integer NOT NULL DEFAULT 0;