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:
@ -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;
|
53
service/src/main/sql/20170209113022-create-schema-up.sql
Normal file
53
service/src/main/sql/20170209113022-create-schema-up.sql
Normal 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);
|
@ -0,0 +1,5 @@
|
||||
-- # New Life Songs DB
|
||||
-- @author Jonathan Bernard <jdb@jdb-labs.com>
|
||||
--
|
||||
-- Remove performances.rank
|
||||
ALTER TABLE performances DROP COLUMN rank;
|
@ -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;
|
Reference in New Issue
Block a user