Parcourir la source

Add missing SQL files

Toni Fadjukoff il y a 6 ans
Parent
révision
3c556808b1
3 fichiers modifiés avec 90 ajouts et 0 suppressions
  1. 6 0
      sql/clear-schema.sql
  2. 15 0
      sql/create-test-database.sql
  3. 69 0
      sql/database-test.sql

+ 6 - 0
sql/clear-schema.sql Voir le fichier

@@ -0,0 +1,6 @@
1
+drop table if exists "user" cascade;
2
+drop table if exists "user_panel" cascade;
3
+drop table if exists "panel" cascade;
4
+drop table if exists "entry" cascade;
5
+drop table if exists "round" cascade;
6
+drop table if exists "round_playlist" cascade;

+ 15 - 0
sql/create-test-database.sql Voir le fichier

@@ -0,0 +1,15 @@
1
+
2
+-- User: levyraati
3
+
4
+-- DROP USER levyraati;
5
+
6
+CREATE USER levyraati_test;
7
+
8
+-- Database: levyraati
9
+
10
+-- DROP DATABASE levyraati;
11
+
12
+CREATE DATABASE levyraati_test
13
+    WITH 
14
+    OWNER = levyraati_test
15
+    ENCODING = 'UTF8';

+ 69 - 0
sql/database-test.sql Voir le fichier

@@ -0,0 +1,69 @@
1
+INSERT INTO public.user (username, password) VALUES
2
+('Lamperi', 'Q243hXSZxCKATLc=$FcztjyQivs8NZuDux7L3sh6eMmc1jIlSul9fFywBVVk=');
3
+
4
+INSERT INTO public.panel (name, article) VALUES
5
+('Levyraati 2018', 'Levyraati 2018');
6
+
7
+INSERT INTO public.user_panel (user_id, panel_id) VALUES
8
+(1, 1);
9
+
10
+INSERT INTO public.round (start, "end", panel_id, section) VALUES
11
+('2018-01-01 00:00:00 +0200', '2018-01-07 23:59:59 +0200', 1, 'Viikko 01'),
12
+('2018-01-08 00:00:00 +0200', '2018-01-14 23:59:59 +0200', 1, 'Viikko 02'),
13
+('2018-01-15 00:00:00 +0200', '2018-01-21 23:59:59 +0200', 1, 'Viikko 03'),
14
+('2018-01-22 00:00:00 +0200', '2018-01-28 23:59:59 +0200', 1, 'Viikko 04'),
15
+('2018-01-29 00:00:00 +0200', '2018-02-04 23:59:59 +0200', 1, 'Viikko 05'),
16
+('2018-02-05 00:00:00 +0200', '2018-02-11 23:59:59 +0200', 1, 'Viikko 06'),
17
+('2018-02-12 00:00:00 +0200', '2018-02-18 23:59:59 +0200', 1, 'Viikko 07'),
18
+('2018-02-19 00:00:00 +0200', '2018-02-25 23:59:59 +0200', 1, 'Viikko 08'),
19
+('2018-02-26 00:00:00 +0200', '2018-03-04 23:59:59 +0200', 1, 'Viikko 09'),
20
+('2018-03-05 00:00:00 +0200', '2018-03-11 23:59:59 +0200', 1, 'Viikko 10'),
21
+('2018-03-12 00:00:00 +0200', '2018-03-18 23:59:59 +0200', 1, 'Viikko 11'),
22
+('2018-03-19 00:00:00 +0200', '2018-03-25 23:59:59 +0300', 1, 'Viikko 12'),
23
+('2018-03-26 00:00:00 +0300', '2018-04-01 23:59:59 +0300', 1, 'Viikko 13'),
24
+('2018-04-02 00:00:00 +0300', '2018-04-08 23:59:59 +0300', 1, 'Viikko 14'),
25
+('2018-04-09 00:00:00 +0300', '2018-04-15 23:59:59 +0300', 1, 'Viikko 15'),
26
+('2018-04-16 00:00:00 +0300', '2018-04-22 23:59:59 +0300', 1, 'Viikko 16'),
27
+('2018-04-23 00:00:00 +0300', '2018-04-29 23:59:59 +0300', 1, 'Viikko 17'),
28
+('2018-04-30 00:00:00 +0300', '2018-05-06 23:59:59 +0300', 1, 'Viikko 18'),
29
+('2018-05-07 00:00:00 +0300', '2018-05-13 23:59:59 +0300', 1, 'Viikko 19'),
30
+('2018-05-14 00:00:00 +0300', '2018-05-20 23:59:59 +0300', 1, 'Viikko 20'),
31
+('2018-05-21 00:00:00 +0300', '2018-05-27 23:59:59 +0300', 1, 'Viikko 21'),
32
+('2018-05-28 00:00:00 +0300', '2018-06-03 23:59:59 +0300', 1, 'Viikko 22'),
33
+('2018-06-04 00:00:00 +0300', '2018-06-10 23:59:59 +0300', 1, 'Viikko 23'),
34
+('2018-06-11 00:00:00 +0300', '2018-06-17 23:59:59 +0300', 1, 'Viikko 24'),
35
+('2018-06-18 00:00:00 +0300', '2018-06-24 23:59:59 +0300', 1, 'Viikko 25'),
36
+('2018-06-25 00:00:00 +0300', '2018-07-01 23:59:59 +0300', 1, 'Viikko 26'),
37
+('2018-07-02 00:00:00 +0300', '2018-07-08 23:59:59 +0300', 1, 'Viikko 27'),
38
+('2018-07-09 00:00:00 +0300', '2018-07-15 23:59:59 +0300', 1, 'Viikko 28'),
39
+('2018-07-16 00:00:00 +0300', '2018-07-22 23:59:59 +0300', 1, 'Viikko 29'),
40
+('2018-07-23 00:00:00 +0300', '2018-07-29 23:59:59 +0300', 1, 'Viikko 30'),
41
+('2018-07-30 00:00:00 +0300', '2018-08-05 23:59:59 +0300', 1, 'Viikko 31'),
42
+('2018-08-06 00:00:00 +0300', '2018-08-12 23:59:59 +0300', 1, 'Viikko 32'),
43
+('2018-08-13 00:00:00 +0300', '2018-08-19 23:59:59 +0300', 1, 'Viikko 33'),
44
+('2018-08-20 00:00:00 +0300', '2018-08-26 23:59:59 +0300', 1, 'Viikko 34'),
45
+('2018-08-27 00:00:00 +0300', '2018-09-02 23:59:59 +0300', 1, 'Viikko 35'),
46
+('2018-09-03 00:00:00 +0300', '2018-09-09 23:59:59 +0300', 1, 'Viikko 36'),
47
+('2018-09-10 00:00:00 +0300', '2018-09-16 23:59:59 +0300', 1, 'Viikko 37'),
48
+('2018-09-17 00:00:00 +0300', '2018-09-23 23:59:59 +0300', 1, 'Viikko 38'),
49
+('2018-09-24 00:00:00 +0300', '2018-09-30 23:59:59 +0300', 1, 'Viikko 39'),
50
+('2018-10-01 00:00:00 +0300', '2018-10-07 23:59:59 +0300', 1, 'Viikko 40'),
51
+('2018-10-08 00:00:00 +0300', '2018-10-14 23:59:59 +0300', 1, 'Viikko 41'),
52
+('2018-10-15 00:00:00 +0300', '2018-10-21 23:59:59 +0300', 1, 'Viikko 42'),
53
+('2018-10-22 00:00:00 +0300', '2018-10-28 23:59:59 +0200', 1, 'Viikko 43'),
54
+('2018-10-29 00:00:00 +0200', '2018-11-04 23:59:59 +0200', 1, 'Viikko 44'),
55
+('2018-11-05 00:00:00 +0200', '2018-11-11 23:59:59 +0200', 1, 'Viikko 45'),
56
+('2018-11-12 00:00:00 +0200', '2018-11-18 23:59:59 +0200', 1, 'Viikko 46'),
57
+('2018-11-19 00:00:00 +0200', '2018-11-25 23:59:59 +0200', 1, 'Viikko 47'),
58
+('2018-11-26 00:00:00 +0200', '2018-12-02 23:59:59 +0200', 1, 'Viikko 48'),
59
+('2018-12-03 00:00:00 +0200', '2018-12-09 23:59:59 +0200', 1, 'Viikko 49'),
60
+('2018-12-10 00:00:00 +0200', '2018-12-16 23:59:59 +0200', 1, 'Viikko 50'),
61
+('2018-12-17 00:00:00 +0200', '2018-12-23 23:59:59 +0200', 1, 'Viikko 51'),
62
+('2018-12-24 00:00:00 +0200', '2018-12-30 23:59:59 +0200', 1, 'Viikko 52');
63
+
64
+INSERT INTO public.entry (user_id, round_id, artist, title, spotify_url, synced) VALUES
65
+(1, 1, 'Antti Tuisku feat. Nikke Ankara', 'Party (papiidipaadi)', 'https://open.spotify.com/album/4T5cveHFQ5qZkRfZAJPcP7?si=ll_ktjrpQeW-U9KBOAcgvQ', true),
66
+(1, 2, 'Eläkeläiset', 'Poro', 'https://open.spotify.com/track/7BGxxc7n5rGkFhiV50pVC6', true),
67
+(1, 3, 'Vesala', 'Rakkaus ja maailmanloppu', 'https://open.spotify.com/track/5fLiaYOzIAk0PpwJ2VQUpT', true),
68
+(1, 4, 'Haloo Helsinki!', 'Pulp Fiction', 'https://open.spotify.com/track/6aZ6jat6EhEm4bPplxmS7Z', false),
69
+(1, 26, 'Bryan Adams', 'Summer of ''69', 'https://open.spotify.com/track/3bYCGWnZdLQjndiKogqA3G', false);