From b73c8b20a034a4e8ac9ab8740453e35160c20833 Mon Sep 17 00:00:00 2001
From: Jon Bergli Heier <snakebite@jvnv.net>
Date: Tue, 4 Jan 2011 02:10:27 +0100
Subject: Implemented music::update(), needs some work to make queries work on
 different engines.

---
 init.postgresql.sql | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 init.postgresql.sql

(limited to 'init.postgresql.sql')

diff --git a/init.postgresql.sql b/init.postgresql.sql
new file mode 100644
index 0000000..96ddca5
--- /dev/null
+++ b/init.postgresql.sql
@@ -0,0 +1,31 @@
+BEGIN;
+
+CREATE SEQUENCE artists_id_seq;
+CREATE TABLE artists (
+	id INTEGER PRIMARY KEY DEFAULT nextval('artists_id_seq'),
+	name VARCHAR UNIQUE);
+ALTER SEQUENCE artists_id_seq OWNED BY artists.id;
+
+CREATE SEQUENCE albums_id_seq;
+CREATE TABLE albums (
+	id INTEGER PRIMARY KEY DEFAULT nextval('albums_id_seq'),
+	artist_id INTEGER REFERENCES artists (id) NULL,
+	name VARCHAR,
+	tracks INTEGER,
+	UNIQUE(artist_id, name));
+ALTER SEQUENCE albums_id_seq OWNED BY albums.id;
+
+CREATE SEQUENCE tracks_id_seq;
+CREATE TABLE tracks (
+	id INTEGER PRIMARY KEY DEFAULT nextval('tracks_id_seq'),
+	artist_id INTEGER REFERENCES artists (id) NULL,
+	album_id INTEGER REFERENCES albums (id) NULL,
+	name VARCHAR,
+	length INTEGER,
+	num INTEGER,
+	file_name VARCHAR,
+	file_index INTEGER,
+	UNIQUE(artist_id, name));
+ALTER SEQUENCE tracks_id_seq OWNED BY tracks.id;
+
+COMMIT;
-- 
cgit v1.2.3

