From 681fc6e5eaae008fcd2f45c83434851792501ea2 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 3 Nov 2012 21:48:42 -0500 Subject: [PATCH] * VRFS-34 and VRFS-61; session.tracks and instruments --- up/tracks.sql | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 up/tracks.sql diff --git a/up/tracks.sql b/up/tracks.sql new file mode 100644 index 000000000..af261a328 --- /dev/null +++ b/up/tracks.sql @@ -0,0 +1,41 @@ +CREATE TABLE connections_tracks ( + id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4(), + connection_id VARCHAR(64) REFERENCES connections(id) ON DELETE CASCADE, + instrument_id VARCHAR(64) REFERENCES instruments(id) ON DELETE CASCADE, + sound VARCHAR(64) NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +UPDATE genres set id = lower(description); + +DELETE FROM instruments; + +--popularity: 3 High, 2 Mid, 1 Low, 0 user-defined +ALTER TABLE instruments ADD COLUMN popularity INTEGER NOT NULL DEFAULT 0; + +INSERT INTO instruments (id, description, popularity) VALUES + ('acoustic guitar', 'Acoustic Guitar', 3), + ('bass guitar', 'Bass Guitar', 3), + ('computer', 'Computer', 3), + ('drums', 'Drums', 3), + ('electric guitar', 'Electric Guitar', 3), + ('keyboard', 'Keyboard', 3), + ('voice', 'Voice', 3), + ('flute', 'Flute', 2), + ('clarinet', 'Clarinet', 2), + ('saxophone', 'Saxophone', 2), + ('trumpet', 'Trumpet', 2), + ('violin', 'Violin', 2), + ('trombone', 'Trombone', 2), + ('banjo', 'Banjo', 2), + ('harmonica', 'Harmonica', 2), + ('accordion', 'Accordion', 2), + ('french horn', 'French Horn', 1), + ('euphonium', 'Euphonium', 1), + ('tuba', 'Tuba', 1), + ('oboe', 'Oboe', 1), + ('ukulele', 'Ukulele', 1), + ('cello', 'Cello', 1), + ('viola', 'Viola', 1), + ('mandolin', 'Mandolin', 1);