diff --git a/createdb.sql b/createdb.sql index 256e46da1b820826518bbb66fa8b9648f8b3da58..fb5d90d4930f7c3ee5955fd0e051238a1b0d417e 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');