From ea90fad5f2904e6d427c286f417acac4a6021005 Mon Sep 17 00:00:00 2001
From: Masfehico <clyhtsuriva@gmail.com>
Date: Wed, 18 Nov 2020 21:58:16 +0100
Subject: Added CSVs

I added some csvs by exracting my ampache mysql DB.
Also started to write on the README file already.
---
 test.sql | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 test.sql

(limited to 'test.sql')

diff --git a/test.sql b/test.sql
new file mode 100644
index 0000000..ae8d13b
--- /dev/null
+++ b/test.sql
@@ -0,0 +1,45 @@
+--album
+SELECT
+	al.id as "ID",
+	al.name as "Title",
+	ar.name as "Artist",
+	al.original_year as "Release Year",
+	SUM(s.time) as "Duration"
+FROM album al
+JOIN artist ar ON ar.id=al.album_artist
+JOIN song s ON s.album=al.id
+GROUP BY al.id
+INTO OUTFILE '/var/lib/mysql-files/albums.csv'
+FIELDS ENCLOSED BY '"'
+TERMINATED BY ';'
+ESCAPED BY '"'
+LINES TERMINATED BY '\r\n';
+
+--song
+SELECT
+	s.id as "ID",
+	s.title as "Title",
+	ar.name as "Artist",
+	s.time as "Duration",
+	s.file as "Content"
+FROM song s
+JOIN artist ar ON ar.id=s.artist
+INTO OUTFILE '/var/lib/mysql-files/songs.csv'
+FIELDS ENCLOSED BY '"'
+TERMINATED BY ';'
+ESCAPED BY '"'
+LINES TERMINATED BY '\r\n';
+
+--playlist
+SELECT
+	p.id as "ID",
+	p.name as "Name",
+	s.title as "Song"
+FROM playlist_data pd
+JOIN playlist p ON p.id=pd.playlist
+JOIN song s ON s.id=pd.object_id
+INTO OUTFILE '/var/lib/mysql-files/playlists.csv'
+FIELDS ENCLOSED BY '"'
+TERMINATED BY ';'
+ESCAPED BY '"'
+LINES TERMINATED BY '\r\n';
-- 
cgit v1.2.3

