#	$Id: schema.sql,v 1.3 2005/02/22 11:21:23 fred Exp $
# DB installation schema for phpdvdprofiler
# replace DVDPROFILER_ with your $tableprefix
# --------------------------------------------------------
#
# Table Structure for Table `dvd`
#
CREATE TABLE DVDPROFILER_dvd (
  id char(20) default NULL,
  upc varchar(30) default NULL,
  mediatypedvd tinyint(1) unsigned default NULL,
  mediatypehddvd tinyint(1) unsigned default NULL,
  mediatypebluray tinyint(1) unsigned default NULL,
  title varchar(250) default NULL,
  sorttitle varchar(250) default NULL,
  originaltitle varchar(250) default NULL,
  description varchar(255) default NULL,
  countryoforigin varchar(255) default NULL,
  region varchar(10) default NULL,
  collectiontype varchar(20) default NULL,
  auxcolltype varchar(250) default NULL,
  collectionnumber int(10) unsigned default NULL,
  rating varchar(40) default NULL,
  ratingsystem varchar(80) default NULL,
  ratingage varchar(20) default NULL,
  ratingvariant varchar(20) default NULL,
  ratingdetails varchar(255) default NULL,
  productionyear varchar(4) default NULL,
  released int(11) unsigned default NULL,
  runningtime smallint(6) unsigned default NULL,
  casetype varchar(20) default NULL,
  caseslipcover tinyint(1) unsigned default NULL,
  primegenre varchar(80) default NULL,
  isadulttitle tinyint(1) unsigned default NULL,
  formataspectratio varchar(10) default NULL,
  formatvideostandard varchar(10) default NULL,
  formatletterbox tinyint(1) unsigned default NULL,
  formatpanandscan tinyint(1) unsigned default NULL,
  formatfullframe tinyint(1) unsigned default NULL,
  format16x9 tinyint(1) unsigned default NULL,
  formatdualsided tinyint(1) unsigned default NULL,
  formatduallayered tinyint(1) unsigned default NULL,
  featuresceneaccess tinyint(1) unsigned default NULL,
  featurecommentary tinyint(1) unsigned default NULL,
  featuretrailer tinyint(1) unsigned default NULL,
  featurephotogallery tinyint(1) unsigned default NULL,
  featuredeletedscenes tinyint(1) unsigned default NULL,
  featuremakingof tinyint(1) unsigned default NULL,
  featureproductionnotes tinyint(1) unsigned default NULL,
  featuregame tinyint(1) unsigned default NULL,
  featuredvdromcontent tinyint(1) unsigned default NULL,
  featuremultiangle tinyint(1) unsigned default NULL,
  featuremusicvideos tinyint(1) unsigned default NULL,
  featureinterviews tinyint(1) unsigned default NULL,
  featurestoryboardcomparisons tinyint(1) unsigned default NULL,
  featureouttakes tinyint(1) unsigned default NULL,
  featureclosedcaptioned tinyint(1) unsigned default NULL,
  featurethxcertified tinyint(1) unsigned default NULL,
  featureother varchar(255) default NULL,
  reviewfilm smallint(4) unsigned default NULL,
  reviewvideo smallint(4) unsigned default NULL,
  reviewaudio smallint(4) unsigned default NULL,
  reviewextras smallint(4) unsigned default NULL,
  srp varchar(10) default NULL,
  srpcurrencyid varchar(10) default NULL,
  srpcurrencyname varchar(100) default NULL,
  srpdec decimal(10,3) default NULL,
  purchaseprice varchar(10) default NULL,
  purchasepricecurrencyid varchar(10) default NULL,
  purchasepricecurrencyname varchar(100) default NULL,
  paid decimal(10,3) default NULL,
  purchasedate int(11) unsigned default NULL,
  purchaseplace int default NULL,
  loaninfo varchar(250) default NULL,
  loandue int(11) unsigned default NULL,
  overview mediumtext default NULL,
  eastereggs mediumtext default NULL,
  lastedited int(11) unsigned default NULL,
  hashprofile varchar(10) default NULL,
  hashnocolid varchar(10) default NULL,
  hashcast varchar(10) default NULL,
  hashcrew varchar(10) default NULL,
  notes text default NULL,
  wishpriority tinyint(1) unsigned default NULL,
  boxparent varchar(20) default NULL,
  boxchild tinyint unsigned default NULL,
  PRIMARY KEY (id),
  KEY sorttitle (sorttitle),
  KEY collectiontype (collectiontype)
) TYPE=MyISAM DEFAULT CHARSET=latin1;
# --------------------------------------------------------
#
# Table Structure for Table `dvd_common_actor`
#
CREATE TABLE DVDPROFILER_dvd_common_actor (
  caid int NOT NULL AUTO_INCREMENT,
  firstname varchar(50) default NULL,
  middlename varchar(50) default NULL,
  lastname varchar(50) default NULL,
  birthyear varchar(10) default NULL,
  fullname varchar(200) default NULL,
  PRIMARY KEY (caid),
  KEY fullname (fullname)
) TYPE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO DVDPROFILER_dvd_common_actor VALUES (1, '__DiViDeR__', '__DiViDeR__', '__DiViDeR__', '0', '__DiViDeR__');
# --------------------------------------------------------
#
# Table Structure for Table `dvd_actor`
#
CREATE TABLE DVDPROFILER_dvd_actor (
  id char(20) NOT NULL,
  lineno smallint(4) NOT NULL,
  caid int default NULL,
  creditedas varchar(250) default NULL,
  role varchar(250) default NULL,
  voice tinyint(1) unsigned default NULL,
  uncredited tinyint(1) unsigned default NULL,
  PRIMARY KEY (id,lineno),
  KEY caid (caid)
) TYPE=MyISAM DEFAULT CHARSET=latin1;
# --------------------------------------------------------
#
# Table Structure for Table `dvd_events`
#
CREATE TABLE DVDPROFILER_dvd_events (
  id char(20) NOT NULL,
  firstname varchar(30) default NULL,
  lastname varchar(30) default NULL,
  phonenumber varchar(30) default NULL,
  emailaddress varchar(30) default NULL,
  eventtype varchar(30) default NULL,
  note varchar(250) default NULL,
  timestamp DATETIME default NULL,
  KEY id (id)
) TYPE=MyISAM DEFAULT CHARSET=latin1;
# --------------------------------------------------------
#
# Table Structure for Table `dvd_discs`
#
CREATE TABLE DVDPROFILER_dvd_discs (
  id char(20) NOT NULL,
  discno smallint(4) default NULL,
  discdescsidea varchar(250) default NULL,
  discdescsideb varchar(250) default NULL,
  discidsidea varchar(16) default NULL,
  discidsideb varchar(16) default NULL,
  labelsidea varchar(50) default NULL,
  labelsideb varchar(50) default NULL,
  duallayeredsidea tinyint(1) unsigned default NULL,
  duallayeredsideb tinyint(1) unsigned default NULL,
  dualsided tinyint(1) unsigned default NULL,
  location varchar(250) default NULL,
  slot varchar(250) default NULL,
  KEY id (id)
) TYPE=MyISAM DEFAULT CHARSET=latin1;
# --------------------------------------------------------
#
# Table Structure for Table `dvd_audio`
#
CREATE TABLE DVDPROFILER_dvd_audio (
  id char(20) NOT NULL,
  dborder smallint(4) default NULL,
  audiocontent varchar(250) default NULL,
  audioformat varchar(250) default NULL,
  KEY id (id)
) TYPE=MyISAM DEFAULT CHARSET=latin1;
# --------------------------------------------------------
#
# Table Structure for Table `dvd_common_credits`
#
CREATE TABLE DVDPROFILER_dvd_common_credits (
  caid int NOT NULL AUTO_INCREMENT,
  firstname varchar(50) default NULL,
  middlename varchar(50) default NULL,
  lastname varchar(50) default NULL,
  birthyear varchar(10) default NULL,
  fullname varchar(200) default NULL,
  PRIMARY KEY (caid),
  KEY fullname (fullname)
) TYPE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO DVDPROFILER_dvd_common_credits VALUES (1, '__DiViDeR__', '__DiViDeR__', '__DiViDeR__', '0', '__DiViDeR__');
# --------------------------------------------------------
#
# Table Structure for Table `dvd_credits`
#
CREATE TABLE DVDPROFILER_dvd_credits (
  id char(20) NOT NULL,
  lineno smallint(4) NOT NULL,
  caid int default NULL,
  creditedas varchar(250) default NULL,
  credittype varchar(250) default NULL,
  creditsubtype varchar(250) default NULL,
  customrole varchar(250) default NULL,
  PRIMARY KEY (id,lineno),
  KEY caid (caid)
) TYPE=MyISAM DEFAULT CHARSET=latin1;
# --------------------------------------------------------
#
# Table Structure for Table `dvd_genres`
#
CREATE TABLE DVDPROFILER_dvd_genres (
  id char(20) NOT NULL,
  dborder smallint(4) default NULL,
  genre varchar(250) default NULL,
  KEY id (id)
) TYPE=MyISAM DEFAULT CHARSET=latin1;
# --------------------------------------------------------
#
# Table Structure for Table `dvd_boxset`
#
CREATE TABLE DVDPROFILER_dvd_boxset (
  id char(20) NOT NULL,
  child varchar(20) default NULL,
  KEY id (id)
) TYPE=MyISAM DEFAULT CHARSET=latin1;
# --------------------------------------------------------
#
# Table Structure for Table `dvd_studio`
#
CREATE TABLE DVDPROFILER_dvd_studio (
  id char(20) NOT NULL,
  ismediacompany tinyint(1) unsigned default NULL,
  dborder smallint(4) default NULL,
  studio varchar(250) default NULL,
  KEY id (id)
) TYPE=MyISAM DEFAULT CHARSET=latin1;
# --------------------------------------------------------
#
# Table Structure for Table `dvd_subtitle`
#
CREATE TABLE DVDPROFILER_dvd_subtitle (
  id char(20) NOT NULL,
  dborder smallint(4) default NULL,
  subtitle varchar(250) default NULL,
  KEY id (id)
) TYPE=MyISAM DEFAULT CHARSET=latin1;
# --------------------------------------------------------
#
# Table Structure for Table `dvd_tags`
#
CREATE TABLE DVDPROFILER_dvd_tags (
  id char(20) NOT NULL,
  name varchar(250) default NULL,
  fullyqualifiedname varchar(250) default NULL,
  KEY id (id)
) TYPE=MyISAM DEFAULT CHARSET=latin1;
# --------------------------------------------------------
#
# Table Structure for Table `dvd_stats`
#
CREATE TABLE DVDPROFILER_dvd_stats (
  stattype varchar(20) NOT NULL,
  namestring1 varchar(250) default NULL,
  namestring2 varchar(250) default NULL,
  id char(20) default NULL,
  counts int unsigned default NULL,
  KEY stattype (stattype)
) TYPE=MyISAM DEFAULT CHARSET=latin1;
# --------------------------------------------------------
#
# Table Structure for Table `dvd_locks`
#
CREATE TABLE DVDPROFILER_dvd_locks (
  id char(20) UNIQUE NOT NULL,
  entire BOOL default NULL,
  covers BOOL default NULL,
  title BOOL default NULL,
  mediatype BOOL default NULL,
  overview BOOL default NULL,
  regions BOOL default NULL,
  genres BOOL default NULL,
  srp BOOL default NULL,
  studios BOOL default NULL,
  discinfo BOOL default NULL,
  cast BOOL default NULL,
  crew BOOL default NULL,
  features BOOL default NULL,
  audio BOOL default NULL,
  subtitles BOOL default NULL,
  eastereggs BOOL default NULL,
  runningtime BOOL default NULL,
  releasedate BOOL default NULL,
  productionyear BOOL default NULL,
  casetype BOOL default NULL,
  videoformats BOOL default NULL,
  rating BOOL default NULL,
  PRIMARY KEY (id)
) TYPE=MyISAM DEFAULT CHARSET=latin1;
# --------------------------------------------------------
#
# Table Structure for Table `dvd_supplier`
#
CREATE TABLE DVDPROFILER_dvd_supplier (
  sid int NOT NULL AUTO_INCREMENT,
  suppliername varchar(250) UNIQUE,
  supplierurl varchar(250) default NULL,
  suppliertype char(1) default NULL,
  PRIMARY KEY (sid)
#  KEY suppliername (suppliername)
) TYPE=MyISAM DEFAULT CHARSET=latin1;
# --------------------------------------------------------
#
# Table Structure for Table `dvd_properties`
#
CREATE TABLE DVDPROFILER_dvd_properties (
  property varchar(100) NOT NULL,
  value varchar(250) default NULL,
  PRIMARY KEY (property)
) TYPE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO DVDPROFILER_dvd_properties VALUES ("db_schema_version", "2.4");
# --------------------------------------------------------
