From 1c406e480f603381f086bcedd376d4dd809b3c13 Mon Sep 17 00:00:00 2001
From: Per Cederqvist <ceder@lysator.liu.se>
Date: Mon, 21 Apr 2003 19:02:41 +0000
Subject: [PATCH] Populate the database with /movies/dc, /movies/olymp, and the
 media batches that I currently have. (media_batch): New table. (media): New
 column: batch_id.

---
 createdb.sql | 48 ++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 46 insertions(+), 2 deletions(-)

diff --git a/createdb.sql b/createdb.sql
index 256e46d..fb5d90d 100644
--- a/createdb.sql
+++ b/createdb.sql
@@ -37,8 +37,31 @@ create table file (
 	INDEX(size)
 );
 
+create table media_batch (
+	batch_id int32 auto_increment	primary key not null,
+	purchase_date datetime		not null,
+
+	# Capacity in number of blocks.
+	capacity int32			not null,
+
+	# 2048 for CD-R and CD-RW.
+	blocksize int16			not null,
+
+	# True for CD-R, false for CD-RW.
+	permanent bool			not null,
+	
+	speed int16			not null,	
+
+	manufacturer varchar(255)	not null,
+	label varchar(255)		not null,
+
+	INDEX(permanent)
+);
+	
+	
 create table media (
 	media_id int32 auto_increment	primary key not null,
+	batch_id int32		     not null references media_batch(batch_id),
 	written datetime		not null,
 	verified datetime		null,
 	broken bool			not null,
@@ -55,5 +78,26 @@ create table contents (
 	INDEX(media)
 );
 
-insert into base (dir_name, active) values ("/movies/olympcopy", 1);
-insert into base (dir_name, active) values ("/movies/dccopy", 1);
+insert into base (dir_name, active) values ("/movies/olymp", 1);
+insert into base (dir_name, active) values ("/movies/dc", 1);
+
+insert into media_batch (purchase_date, capacity, blocksize, permanent, speed,
+	manufacturer, label)
+
+values ('2001-04-21', 336225, 2048, 1, 12,
+	'Traxdata', 'Traxdata silver 12X Speed 74'),
+
+       ('2001-04-26', 335100, 2048, 0, 4,
+	'Arita', 'Arita CD-RW 74H'),
+
+       ('2002-03-15', 337275, 2048, 1, 0,
+	'Biltema', 'Biltema 74 23-555'),
+
+       ('2001-12-24', 335925, 2048, 0, 4,
+	'TDK', 'TDK CD-RW650'),
+
+       ('2003-04-14', 336075, 2048, 0, 24,
+	'Plextor', 'Plextor CD-RW 74'),
+
+       ('2003-04-14', 359847, 2048, 1, 48,
+	'Plextor', 'Plextor CD-R 80 48x multispeed');
-- 
GitLab