Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

update the initial database to schema version 1226

git-svn-id: http://svn.mythtv.org/svn/trunk@19221 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information...
commit 456caa8950e18560be83abb6094b5fb1ad92790f 1 parent b2de26e
Janne Grunau jannau authored

Showing 2 changed files with 452 additions and 190 deletions. Show diff stats Hide diff stats

  1. +2 2 mythtv/database/mc.sql
  2. +450 188 mythtv/libs/libmythtv/dbcheck.cpp
4 mythtv/database/mc.sql
... ... @@ -1,6 +1,6 @@
1   -CREATE DATABASE if not exists mythconverg;
  1 +CREATE DATABASE IF NOT EXISTS mythconverg;
2 2 GRANT ALL ON mythconverg.* TO mythtv@localhost IDENTIFIED BY "mythtv";
3 3 FLUSH PRIVILEGES;
4 4 GRANT CREATE TEMPORARY TABLES ON mythconverg.* TO mythtv@localhost IDENTIFIED BY "mythtv";
5 5 FLUSH PRIVILEGES;
6   -ALTER DATABASE mythconverg DEFAULT CHARACTER SET latin1;
  6 +ALTER DATABASE mythconverg DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
638 mythtv/libs/libmythtv/dbcheck.cpp
@@ -543,7 +543,7 @@ static bool doUpgradeTVDatabaseSchema(void)
543 543 {
544 544 if (!InitializeDatabase())
545 545 return false;
546   - dbver = "1112";
  546 + dbver = gContext->GetSetting("DBSchemaVer");
547 547 }
548 548
549 549 if (dbver.isEmpty() || dbver.toInt() < 1027)
@@ -4472,6 +4472,23 @@ NULL
4472 4472 return true;
4473 4473 }
4474 4474
  4475 +/**
  4476 + * command to get the the initial database layout from an empty database:
  4477 + *
  4478 + * mysqldump --skip-comments --skip-opt --compact --skip-quote-names \
  4479 + * --ignore-table=schemalock mythconverg | \
  4480 + * sed '/^SET.*;$/d;s/^.*[^;]$/"&"/;s/^);$/");",/'
  4481 + *
  4482 + * don't forget to om
  4483 + *
  4484 + * command to get the initial data:
  4485 + *
  4486 + * mysqldump --skip-comments --skip-opt --compact --skip-quote-names -t \
  4487 + * mythconverg | sed 's/^.*$/"&",/'
  4488 + *
  4489 + * don't forget to delete host specific data
  4490 + *
  4491 + */
4475 4492 bool InitializeDatabase(void)
4476 4493 {
4477 4494 MSqlQuery query(MSqlQuery::InitCon());
@@ -4492,21 +4509,21 @@ bool InitializeDatabase(void)
4492 4509
4493 4510 VERBOSE(VB_IMPORTANT, "Inserting MythTV initial database information.");
4494 4511
4495   - QString qtmp = QString("ALTER DATABASE %1 DEFAULT CHARACTER SET latin1;")
  4512 + QString qtmp = QString("ALTER DATABASE %1 DEFAULT CHARACTER SET utf8;")
4496 4513 .arg(gContext->GetDatabaseParams().dbName);
4497 4514 QByteArray tmp = qtmp.toAscii();
4498 4515
4499 4516 const char *updates[] = {
4500 4517 tmp.constData(),
4501   -"CREATE TABLE IF NOT EXISTS callsignnetworkmap ("
4502   -" id int(11) NOT NULL auto_increment,"
  4518 +"CREATE TABLE callsignnetworkmap ("
  4519 +" id int(11) NOT NULL,"
4503 4520 " callsign varchar(20) NOT NULL default '',"
4504 4521 " network varchar(20) NOT NULL default '',"
4505 4522 " PRIMARY KEY (id),"
4506 4523 " UNIQUE KEY callsign (callsign)"
4507 4524 ");",
4508   -"CREATE TABLE IF NOT EXISTS capturecard ("
4509   -" cardid int(10) unsigned NOT NULL auto_increment,"
  4525 +"CREATE TABLE capturecard ("
  4526 +" cardid int(10) unsigned NOT NULL,"
4510 4527 " videodevice varchar(128) default NULL,"
4511 4528 " audiodevice varchar(128) default NULL,"
4512 4529 " vbidevice varchar(128) default NULL,"
@@ -4515,52 +4532,52 @@ tmp.constData(),
4515 4532 " audioratelimit int(11) default NULL,"
4516 4533 " hostname varchar(64) default NULL,"
4517 4534 " dvb_swfilter int(11) default '0',"
4518   -" dvb_recordts int(11) default '1',"
4519 4535 " dvb_sat_type int(11) NOT NULL default '0',"
4520 4536 " dvb_wait_for_seqstart int(11) NOT NULL default '1',"
4521   -" dvb_dmx_buf_size int(11) NOT NULL default '8192',"
4522   -" dvb_pkt_buf_size int(11) NOT NULL default '8192',"
4523 4537 " skipbtaudio tinyint(1) default '0',"
4524 4538 " dvb_on_demand tinyint(4) NOT NULL default '0',"
4525 4539 " dvb_diseqc_type smallint(6) default NULL,"
4526   -" firewire_port int(10) unsigned NOT NULL default '0',"
4527   -" firewire_node int(10) unsigned NOT NULL default '2',"
4528 4540 " firewire_speed int(10) unsigned NOT NULL default '0',"
4529 4541 " firewire_model varchar(32) default NULL,"
4530 4542 " firewire_connection int(10) unsigned NOT NULL default '0',"
4531   -" dvb_hw_decoder int(11) default '0',"
4532 4543 " dbox2_port int(10) unsigned NOT NULL default '31338',"
4533 4544 " dbox2_httpport int(10) unsigned NOT NULL default '80',"
4534 4545 " dbox2_host varchar(32) default NULL,"
4535 4546 " signal_timeout int(11) NOT NULL default '1000',"
4536 4547 " channel_timeout int(11) NOT NULL default '3000',"
  4548 +" dvb_tuning_delay int(10) unsigned NOT NULL default '0',"
  4549 +" contrast int(11) NOT NULL default '0',"
  4550 +" brightness int(11) NOT NULL default '0',"
  4551 +" colour int(11) NOT NULL default '0',"
  4552 +" hue int(11) NOT NULL default '0',"
  4553 +" diseqcid int(10) unsigned default NULL,"
  4554 +" dvb_eitscan tinyint(1) NOT NULL default '1',"
4537 4555 " PRIMARY KEY (cardid)"
4538 4556 ");",
4539   -"CREATE TABLE IF NOT EXISTS cardinput ("
4540   -" cardinputid int(10) unsigned NOT NULL auto_increment,"
  4557 +"CREATE TABLE cardinput ("
  4558 +" cardinputid int(10) unsigned NOT NULL,"
4541 4559 " cardid int(10) unsigned NOT NULL default '0',"
4542 4560 " sourceid int(10) unsigned NOT NULL default '0',"
4543 4561 " inputname varchar(32) NOT NULL default '',"
4544 4562 " externalcommand varchar(128) default NULL,"
4545   -" preference int(11) NOT NULL default '0',"
4546 4563 " shareable char(1) default 'N',"
4547   -" tunechan varchar(5) NOT NULL default '',"
4548   -" startchan varchar(5) NOT NULL default '',"
  4564 +" tunechan varchar(10) default NULL,"
  4565 +" startchan varchar(10) default NULL,"
4549 4566 " freetoaironly tinyint(1) default '1',"
4550   -" diseqc_port smallint(6) default NULL,"
4551   -" diseqc_pos float default NULL,"
4552   -" lnb_lof_switch int(11) default '11700000',"
4553   -" lnb_lof_hi int(11) default '10600000',"
4554   -" lnb_lof_lo int(11) default '9750000',"
  4567 +" displayname varchar(64) NOT NULL default '',"
  4568 +" radioservices tinyint(1) default '1',"
  4569 +" dishnet_eit tinyint(1) NOT NULL default '0',"
  4570 +" recpriority int(11) NOT NULL default '0',"
  4571 +" quicktune tinyint(4) NOT NULL default '0',"
4555 4572 " PRIMARY KEY (cardinputid)"
4556 4573 ");",
4557   -"CREATE TABLE IF NOT EXISTS channel ("
  4574 +"CREATE TABLE channel ("
4558 4575 " chanid int(10) unsigned NOT NULL default '0',"
4559   -" channum varchar(5) NOT NULL default '',"
  4576 +" channum varchar(10) NOT NULL default '',"
4560 4577 " freqid varchar(10) default NULL,"
4561 4578 " sourceid int(10) unsigned default NULL,"
4562 4579 " callsign varchar(20) NOT NULL default '',"
4563   -" name varchar(64) NOT NULL default '',"
  4580 +" `name` varchar(64) NOT NULL default '',"
4564 4581 " icon varchar(255) NOT NULL default 'none',"
4565 4582 " finetune int(11) default NULL,"
4566 4583 " videofilters varchar(255) NOT NULL default '',"
@@ -4571,34 +4588,153 @@ tmp.constData(),
4571 4588 " colour int(11) default '32768',"
4572 4589 " hue int(11) default '32768',"
4573 4590 " tvformat varchar(10) NOT NULL default 'Default',"
4574   -" commfree tinyint(4) NOT NULL default '0',"
4575 4591 " visible tinyint(1) NOT NULL default '1',"
4576 4592 " outputfilters varchar(255) NOT NULL default '',"
4577 4593 " useonairguide tinyint(1) default '0',"
4578 4594 " mplexid smallint(6) default NULL,"
4579 4595 " serviceid mediumint(8) unsigned default NULL,"
4580   -" atscsrcid int(11) default NULL,"
  4596 +" tmoffset int(11) NOT NULL default '0',"
  4597 +" atsc_major_chan int(10) unsigned NOT NULL default '0',"
  4598 +" atsc_minor_chan int(10) unsigned NOT NULL default '0',"
  4599 +" last_record datetime NOT NULL,"
  4600 +" default_authority varchar(32) NOT NULL default '',"
  4601 +" commmethod int(11) NOT NULL default '-1',"
4581 4602 " PRIMARY KEY (chanid),"
4582   -" KEY channel_src (channum,sourceid)"
  4603 +" KEY channel_src (channum,sourceid),"
  4604 +" KEY sourceid (sourceid,xmltvid,chanid),"
  4605 +" KEY visible (visible)"
  4606 +");",
  4607 +"CREATE TABLE channelscan ("
  4608 +" scanid int(3) unsigned NOT NULL,"
  4609 +" cardid int(3) unsigned NOT NULL,"
  4610 +" sourceid int(3) unsigned NOT NULL,"
  4611 +" processed tinyint(1) unsigned NOT NULL,"
  4612 +" scandate datetime NOT NULL,"
  4613 +" PRIMARY KEY (scanid)"
4583 4614 ");",
4584   -"CREATE TABLE IF NOT EXISTS codecparams ("
4585   -" profile int(10) unsigned NOT NULL default '0',"
4586   -" name varchar(128) NOT NULL default '',"
4587   -" value varchar(128) default NULL,"
4588   -" PRIMARY KEY (profile,name)"
  4615 +"CREATE TABLE channelscan_channel ("
  4616 +" transportid int(6) unsigned NOT NULL,"
  4617 +" scanid int(3) unsigned NOT NULL,"
  4618 +" mplex_id smallint(6) NOT NULL,"
  4619 +" source_id int(3) unsigned NOT NULL,"
  4620 +" channel_id int(3) unsigned NOT NULL default '0',"
  4621 +" callsign varchar(20) NOT NULL default '',"
  4622 +" service_name varchar(64) NOT NULL default '',"
  4623 +" chan_num varchar(10) NOT NULL default '',"
  4624 +" service_id mediumint(8) unsigned NOT NULL default '0',"
  4625 +" atsc_major_channel int(4) unsigned NOT NULL default '0',"
  4626 +" atsc_minor_channel int(4) unsigned NOT NULL default '0',"
  4627 +" use_on_air_guide tinyint(1) NOT NULL default '0',"
  4628 +" hidden tinyint(1) NOT NULL default '0',"
  4629 +" hidden_in_guide tinyint(1) NOT NULL default '0',"
  4630 +" freqid varchar(10) NOT NULL default '',"
  4631 +" icon varchar(255) NOT NULL default '',"
  4632 +" tvformat varchar(10) NOT NULL default 'Default',"
  4633 +" xmltvid varchar(64) NOT NULL default '',"
  4634 +" pat_tsid int(5) unsigned NOT NULL default '0',"
  4635 +" vct_tsid int(5) unsigned NOT NULL default '0',"
  4636 +" vct_chan_tsid int(5) unsigned NOT NULL default '0',"
  4637 +" sdt_tsid int(5) unsigned NOT NULL default '0',"
  4638 +" orig_netid int(5) unsigned NOT NULL default '0',"
  4639 +" netid int(5) unsigned NOT NULL default '0',"
  4640 +" si_standard varchar(10) NOT NULL,"
  4641 +" in_channels_conf tinyint(1) unsigned NOT NULL default '0',"
  4642 +" in_pat tinyint(1) unsigned NOT NULL default '0',"
  4643 +" in_pmt tinyint(1) unsigned NOT NULL default '0',"
  4644 +" in_vct tinyint(1) unsigned NOT NULL default '0',"
  4645 +" in_nit tinyint(1) unsigned NOT NULL default '0',"
  4646 +" in_sdt tinyint(1) unsigned NOT NULL default '0',"
  4647 +" is_encrypted tinyint(1) unsigned NOT NULL default '0',"
  4648 +" is_data_service tinyint(1) unsigned NOT NULL default '0',"
  4649 +" is_audio_service tinyint(1) unsigned NOT NULL default '0',"
  4650 +" is_opencable tinyint(1) unsigned NOT NULL default '0',"
  4651 +" could_be_opencable tinyint(1) unsigned NOT NULL default '0',"
  4652 +" decryption_status smallint(2) unsigned NOT NULL default '0'"
4589 4653 ");",
4590   -"CREATE TABLE IF NOT EXISTS credits ("
  4654 +"CREATE TABLE channelscan_dtv_multiplex ("
  4655 +" transportid int(6) unsigned NOT NULL,"
  4656 +" scanid int(3) unsigned NOT NULL,"
  4657 +" mplexid smallint(6) unsigned NOT NULL,"
  4658 +" frequency bigint(12) unsigned NOT NULL,"
  4659 +" inversion char(1) NOT NULL default 'a',"
  4660 +" symbolrate bigint(12) unsigned NOT NULL default '0',"
  4661 +" fec varchar(4) NOT NULL default 'auto',"
  4662 +" polarity char(1) NOT NULL default '',"
  4663 +" hp_code_rate varchar(4) NOT NULL default 'auto',"
  4664 +" lp_code_rate varchar(4) NOT NULL default 'auto',"
  4665 +" modulation varchar(4) NOT NULL default 'auto',"
  4666 +" transmission_mode char(1) NOT NULL default 'a',"
  4667 +" guard_interval varchar(4) NOT NULL default 'auto',"
  4668 +" hierarchy varchar(4) NOT NULL default 'auto',"
  4669 +" bandwidth char(1) NOT NULL default 'a',"
  4670 +" sistandard varchar(10) NOT NULL,"
  4671 +" tuner_type smallint(2) unsigned NOT NULL,"
  4672 +" PRIMARY KEY (transportid)"
  4673 +");",
  4674 +"CREATE TABLE codecparams ("
  4675 +" `profile` int(10) unsigned NOT NULL default '0',"
  4676 +" `name` varchar(128) NOT NULL default '',"
  4677 +" `value` varchar(128) default NULL,"
  4678 +" PRIMARY KEY (`profile`,`name`)"
  4679 +");",
  4680 +"CREATE TABLE credits ("
4591 4681 " person mediumint(8) unsigned NOT NULL default '0',"
4592 4682 " chanid int(10) unsigned NOT NULL default '0',"
4593 4683 " starttime datetime NOT NULL default '0000-00-00 00:00:00',"
4594   -" role set('actor','director','producer','executive_producer','writer',"
4595   -" 'guest_star','host','adapter','presenter','commentator','guest')"
4596   -" NOT NULL default '',"
  4684 +" role set('actor','director','producer','executive_producer','writer','guest_star','host','adapter','presenter','commentator','guest') NOT NULL default '',"
4597 4685 " UNIQUE KEY chanid (chanid,starttime,person,role),"
4598 4686 " KEY person (person,role)"
4599 4687 ");",
4600   -"CREATE TABLE IF NOT EXISTS dtv_multiplex ("
4601   -" mplexid smallint(6) NOT NULL auto_increment,"
  4688 +"CREATE TABLE customexample ("
  4689 +" rulename varchar(64) NOT NULL,"
  4690 +" fromclause text NOT NULL,"
  4691 +" whereclause text NOT NULL,"
  4692 +" search tinyint(4) NOT NULL default '0',"
  4693 +" PRIMARY KEY (rulename)"
  4694 +");",
  4695 +"CREATE TABLE diseqc_config ("
  4696 +" cardinputid int(10) unsigned NOT NULL,"
  4697 +" diseqcid int(10) unsigned NOT NULL,"
  4698 +" `value` varchar(16) NOT NULL default '',"
  4699 +" KEY id (cardinputid)"
  4700 +");",
  4701 +"CREATE TABLE diseqc_tree ("
  4702 +" diseqcid int(10) unsigned NOT NULL,"
  4703 +" parentid int(10) unsigned default NULL,"
  4704 +" ordinal tinyint(3) unsigned NOT NULL,"
  4705 +" `type` varchar(16) NOT NULL default '',"
  4706 +" subtype varchar(16) NOT NULL default '',"
  4707 +" description varchar(32) NOT NULL default '',"
  4708 +" switch_ports tinyint(3) unsigned NOT NULL default '0',"
  4709 +" rotor_hi_speed float NOT NULL default '0',"
  4710 +" rotor_lo_speed float NOT NULL default '0',"
  4711 +" rotor_positions varchar(255) NOT NULL default '',"
  4712 +" lnb_lof_switch int(10) NOT NULL default '0',"
  4713 +" lnb_lof_hi int(10) NOT NULL default '0',"
  4714 +" lnb_lof_lo int(10) NOT NULL default '0',"
  4715 +" cmd_repeat int(11) NOT NULL default '1',"
  4716 +" lnb_pol_inv tinyint(4) NOT NULL default '0',"
  4717 +" PRIMARY KEY (diseqcid),"
  4718 +" KEY parentid (parentid)"
  4719 +");",
  4720 +"CREATE TABLE displayprofilegroups ("
  4721 +" `name` varchar(128) NOT NULL,"
  4722 +" hostname varchar(64) NOT NULL,"
  4723 +" profilegroupid int(10) unsigned NOT NULL,"
  4724 +" PRIMARY KEY (`name`,hostname),"
  4725 +" UNIQUE KEY profilegroupid (profilegroupid)"
  4726 +");",
  4727 +"CREATE TABLE displayprofiles ("
  4728 +" profilegroupid int(10) unsigned NOT NULL,"
  4729 +" profileid int(10) unsigned NOT NULL,"
  4730 +" `value` varchar(128) NOT NULL,"
  4731 +" `data` varchar(255) NOT NULL default '',"
  4732 +" KEY profilegroupid (profilegroupid),"
  4733 +" KEY profileid (profileid,`value`),"
  4734 +" KEY profileid_2 (profileid)"
  4735 +");",
  4736 +"CREATE TABLE dtv_multiplex ("
  4737 +" mplexid smallint(6) NOT NULL,"
4602 4738 " sourceid smallint(6) default NULL,"
4603 4739 " transportid int(11) default NULL,"
4604 4740 " networkid int(11) default NULL,"
@@ -4618,72 +4754,100 @@ tmp.constData(),
4618 4754 " hp_code_rate varchar(10) default 'auto',"
4619 4755 " sistandard varchar(10) default 'dvb',"
4620 4756 " serviceversion smallint(6) default '33',"
4621   -" updatetimestamp timestamp(14) NOT NULL,"
  4757 +" updatetimestamp timestamp NOT NULL default CURRENT_TIMESTAMP,"
4622 4758 " PRIMARY KEY (mplexid)"
4623 4759 ");",
4624   -"CREATE TABLE IF NOT EXISTS dtv_privatetypes ("
  4760 +"CREATE TABLE dtv_privatetypes ("
4625 4761 " sitype varchar(4) NOT NULL default '',"
4626 4762 " networkid int(11) NOT NULL default '0',"
4627 4763 " private_type varchar(20) NOT NULL default '',"
4628 4764 " private_value varchar(100) NOT NULL default ''"
4629 4765 ");",
4630   -"CREATE TABLE IF NOT EXISTS favorites ("
4631   -" favid int(11) unsigned NOT NULL auto_increment,"
  4766 +"CREATE TABLE dvdbookmark ("
  4767 +" serialid varchar(16) NOT NULL default '',"
  4768 +" `name` varchar(32) default NULL,"
  4769 +" title smallint(6) NOT NULL default '0',"
  4770 +" audionum tinyint(4) NOT NULL default '-1',"
  4771 +" subtitlenum tinyint(4) NOT NULL default '-1',"
  4772 +" framenum bigint(20) NOT NULL default '0',"
  4773 +" `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP,"
  4774 +" PRIMARY KEY (serialid)"
  4775 +");",
  4776 +"CREATE TABLE eit_cache ("
  4777 +" chanid int(10) NOT NULL,"
  4778 +" eventid int(10) unsigned NOT NULL default '0',"
  4779 +" tableid tinyint(3) unsigned NOT NULL,"
  4780 +" version tinyint(3) unsigned NOT NULL,"
  4781 +" endtime int(10) unsigned NOT NULL,"
  4782 +" `status` tinyint(4) NOT NULL default '0',"
  4783 +" PRIMARY KEY (chanid,eventid,`status`)"
  4784 +");",
  4785 +"CREATE TABLE favorites ("
  4786 +" favid int(11) unsigned NOT NULL,"
4632 4787 " userid int(11) unsigned NOT NULL default '0',"
4633 4788 " chanid int(11) unsigned NOT NULL default '0',"
4634 4789 " PRIMARY KEY (favid)"
4635 4790 ");",
4636   -"CREATE TABLE IF NOT EXISTS housekeeping ("
  4791 +"CREATE TABLE housekeeping ("
4637 4792 " tag varchar(64) NOT NULL default '',"
4638 4793 " lastrun datetime default NULL,"
4639 4794 " PRIMARY KEY (tag)"
4640 4795 ");",
4641   -"CREATE TABLE IF NOT EXISTS inuseprograms ("
  4796 +"CREATE TABLE inputgroup ("
  4797 +" cardinputid int(10) unsigned NOT NULL,"
  4798 +" inputgroupid int(10) unsigned NOT NULL,"
  4799 +" inputgroupname varchar(32) NOT NULL"
  4800 +");",
  4801 +"CREATE TABLE inuseprograms ("
4642 4802 " chanid int(10) unsigned NOT NULL default '0',"
4643 4803 " starttime datetime NOT NULL default '0000-00-00 00:00:00',"
4644 4804 " recusage varchar(128) NOT NULL default '',"
4645 4805 " lastupdatetime datetime NOT NULL default '0000-00-00 00:00:00',"
4646 4806 " hostname varchar(64) NOT NULL default '',"
4647   -" KEY chanid (chanid,starttime)"
  4807 +" rechost varchar(64) NOT NULL,"
  4808 +" recdir varchar(255) NOT NULL default '',"
  4809 +" KEY chanid (chanid,starttime),"
  4810 +" KEY recusage (recusage,lastupdatetime)"
4648 4811 ");",
4649   -"CREATE TABLE IF NOT EXISTS jobqueue ("
4650   -" id int(11) NOT NULL auto_increment,"
  4812 +"CREATE TABLE jobqueue ("
  4813 +" id int(11) NOT NULL,"
4651 4814 " chanid int(10) NOT NULL default '0',"
4652 4815 " starttime datetime NOT NULL default '0000-00-00 00:00:00',"
4653 4816 " inserttime datetime NOT NULL default '0000-00-00 00:00:00',"
4654   -" type int(11) NOT NULL default '0',"
  4817 +" `type` int(11) NOT NULL default '0',"
4655 4818 " cmds int(11) NOT NULL default '0',"
4656 4819 " flags int(11) NOT NULL default '0',"
4657   -" status int(11) NOT NULL default '0',"
4658   -" statustime timestamp NOT NULL,"
  4820 +" `status` int(11) NOT NULL default '0',"
  4821 +" statustime timestamp NOT NULL default CURRENT_TIMESTAMP,"
4659 4822 " hostname varchar(64) NOT NULL default '',"
4660 4823 " args blob NOT NULL,"
4661   -" comment varchar(128) NOT NULL default '',"
  4824 +" `comment` varchar(128) NOT NULL default '',"
  4825 +" schedruntime datetime NOT NULL default '2007-01-01 00:00:00',"
4662 4826 " PRIMARY KEY (id),"
4663   -" UNIQUE KEY chanid (chanid,starttime,type,inserttime)"
  4827 +" UNIQUE KEY chanid (chanid,starttime,`type`,inserttime)"
4664 4828 ");",
4665   -"CREATE TABLE IF NOT EXISTS jumppoints ("
  4829 +"CREATE TABLE jumppoints ("
4666 4830 " destination varchar(128) NOT NULL default '',"
4667 4831 " description varchar(255) default NULL,"
4668   -" keylist varchar(32) default NULL,"
  4832 +" keylist varchar(128) default NULL,"
4669 4833 " hostname varchar(64) NOT NULL default '',"
4670 4834 " PRIMARY KEY (destination,hostname)"
4671 4835 ");",
4672   -"CREATE TABLE IF NOT EXISTS keybindings ("
4673   -" context varchar(32) NOT NULL default '',"
4674   -" action varchar(32) NOT NULL default '',"
  4836 +"CREATE TABLE keybindings ("
  4837 +" `context` varchar(32) NOT NULL default '',"
  4838 +" `action` varchar(32) NOT NULL default '',"
4675 4839 " description varchar(255) default NULL,"
4676   -" keylist varchar(32) default NULL,"
  4840 +" keylist varchar(128) default NULL,"
4677 4841 " hostname varchar(64) NOT NULL default '',"
4678   -" PRIMARY KEY (context,action,hostname)"
  4842 +" PRIMARY KEY (`context`,`action`,hostname)"
4679 4843 ");",
4680   -"CREATE TABLE IF NOT EXISTS keyword ("
4681   -" phrase varchar(128) NOT NULL default '',"
  4844 +"CREATE TABLE keyword ("
  4845 +" phrase varchar(128) collate utf8_bin NOT NULL default '',"
4682 4846 " searchtype int(10) unsigned NOT NULL default '3',"
4683 4847 " UNIQUE KEY phrase (phrase,searchtype)"
4684 4848 ");",
4685   -"CREATE TABLE IF NOT EXISTS mythlog ("
4686   -" logid int(10) unsigned NOT NULL auto_increment,"
  4849 +"CREATE TABLE mythlog ("
  4850 +" logid int(10) unsigned NOT NULL,"
4687 4851 " module varchar(32) NOT NULL default '',"
4688 4852 " priority int(11) NOT NULL default '0',"
4689 4853 " acknowledged tinyint(1) default '0',"
@@ -4691,26 +4855,27 @@ tmp.constData(),
4691 4855 " host varchar(128) default NULL,"
4692 4856 " message varchar(255) NOT NULL default '',"
4693 4857 " details text,"
4694   -" PRIMARY KEY (logid)"
  4858 +" PRIMARY KEY (logid),"
  4859 +" KEY module (module)"
4695 4860 ");",
4696   -"CREATE TABLE IF NOT EXISTS networkiconmap ("
4697   -" id int(11) NOT NULL auto_increment,"
  4861 +"CREATE TABLE networkiconmap ("
  4862 +" id int(11) NOT NULL,"
4698 4863 " network varchar(20) NOT NULL default '',"
4699 4864 " url varchar(255) NOT NULL default '',"
4700 4865 " PRIMARY KEY (id),"
4701 4866 " UNIQUE KEY network (network)"
4702 4867 ");",
4703   -"CREATE TABLE IF NOT EXISTS oldfind ("
  4868 +"CREATE TABLE oldfind ("
4704 4869 " recordid int(11) NOT NULL default '0',"
4705 4870 " findid int(11) NOT NULL default '0',"
4706 4871 " PRIMARY KEY (recordid,findid)"
4707 4872 ");",
4708   -"CREATE TABLE IF NOT EXISTS oldprogram ("
4709   -" oldtitle varchar(128) NOT NULL default '',"
  4873 +"CREATE TABLE oldprogram ("
  4874 +" oldtitle varchar(128) collate utf8_bin NOT NULL default '',"
4710 4875 " airdate datetime NOT NULL default '0000-00-00 00:00:00',"
4711 4876 " PRIMARY KEY (oldtitle)"
4712 4877 ");",
4713   -"CREATE TABLE IF NOT EXISTS oldrecorded ("
  4878 +"CREATE TABLE oldrecorded ("
4714 4879 " chanid int(10) unsigned NOT NULL default '0',"
4715 4880 " starttime datetime NOT NULL default '0000-00-00 00:00:00',"
4716 4881 " endtime datetime NOT NULL default '0000-00-00 00:00:00',"
@@ -4718,13 +4883,13 @@ tmp.constData(),
4718 4883 " subtitle varchar(128) NOT NULL default '',"
4719 4884 " description text NOT NULL,"
4720 4885 " category varchar(64) NOT NULL default '',"
4721   -" seriesid varchar(12) NOT NULL default '',"
4722   -" programid varchar(20) NOT NULL default '',"
  4886 +" seriesid varchar(40) NOT NULL default '',"
  4887 +" programid varchar(40) NOT NULL default '',"
4723 4888 " findid int(11) NOT NULL default '0',"
4724 4889 " recordid int(11) NOT NULL default '0',"
4725 4890 " station varchar(20) NOT NULL default '',"
4726 4891 " rectype int(10) unsigned NOT NULL default '0',"
4727   -" duplicate tinyint(1) NOT NULL default '0',"
  4892 +" `duplicate` tinyint(1) NOT NULL default '0',"
4728 4893 " recstatus int(11) NOT NULL default '0',"
4729 4894 " reactivate smallint(6) NOT NULL default '0',"
4730 4895 " generic tinyint(1) default '0',"
@@ -4733,38 +4898,48 @@ tmp.constData(),
4733 4898 " KEY title (title),"
4734 4899 " KEY seriesid (seriesid),"
4735 4900 " KEY programid (programid),"
4736   -" KEY recordid (recordid)"
  4901 +" KEY recordid (recordid),"
  4902 +" KEY recstatus (recstatus,programid,seriesid),"
  4903 +" KEY recstatus_2 (recstatus,title,subtitle)"
4737 4904 ");",
4738   -"CREATE TABLE IF NOT EXISTS people ("
4739   -" person mediumint(8) unsigned NOT NULL auto_increment,"
4740   -" name char(128) NOT NULL default '',"
  4905 +"CREATE TABLE people ("
  4906 +" person mediumint(8) unsigned NOT NULL,"
  4907 +" `name` varchar(128) default NULL,"
4741 4908 " PRIMARY KEY (person),"
4742   -" UNIQUE KEY name (name(41))"
  4909 +" UNIQUE KEY `name` (`name`(41))"
4743 4910 ");",
4744   -"CREATE TABLE IF NOT EXISTS pidcache ("
  4911 +"CREATE TABLE pidcache ("
4745 4912 " chanid smallint(6) NOT NULL default '0',"
4746 4913 " pid int(11) NOT NULL default '-1',"
4747 4914 " tableid int(11) NOT NULL default '-1',"
4748 4915 " KEY chanid (chanid)"
4749 4916 ");",
4750   -"CREATE TABLE IF NOT EXISTS playgroup ("
4751   -" name varchar(32) NOT NULL default '',"
  4917 +"CREATE TABLE playgroup ("
  4918 +" `name` varchar(32) NOT NULL default '',"
4752 4919 " titlematch varchar(255) NOT NULL default '',"
4753 4920 " skipahead int(11) NOT NULL default '0',"
4754 4921 " skipback int(11) NOT NULL default '0',"
4755 4922 " timestretch int(11) NOT NULL default '0',"
4756   -" PRIMARY KEY (name)"
  4923 +" jump int(11) NOT NULL default '0',"
  4924 +" PRIMARY KEY (`name`)"
  4925 +");",
  4926 +"CREATE TABLE powerpriority ("
  4927 +" priorityname varchar(64) collate utf8_bin NOT NULL,"
  4928 +" recpriority int(10) NOT NULL default '0',"
  4929 +" selectclause text NOT NULL,"
  4930 +" PRIMARY KEY (priorityname)"
4757 4931 ");",
4758   -"CREATE TABLE IF NOT EXISTS profilegroups ("
4759   -" id int(10) unsigned NOT NULL auto_increment,"
4760   -" name varchar(128) default NULL,"
  4932 +"CREATE TABLE profilegroups ("
  4933 +" id int(10) unsigned NOT NULL,"
  4934 +" `name` varchar(128) default NULL,"
4761 4935 " cardtype varchar(32) NOT NULL default 'V4L',"
4762 4936 " is_default int(1) default '0',"
4763 4937 " hostname varchar(64) default NULL,"
4764 4938 " PRIMARY KEY (id),"
4765   -" UNIQUE KEY name (name,hostname)"
  4939 +" UNIQUE KEY `name` (`name`,hostname),"
  4940 +" KEY cardtype (cardtype)"
4766 4941 ");",
4767   -"CREATE TABLE IF NOT EXISTS program ("
  4942 +"CREATE TABLE program ("
4768 4943 " chanid int(10) unsigned NOT NULL default '0',"
4769 4944 " starttime datetime NOT NULL default '0000-00-00 00:00:00',"
4770 4945 " endtime datetime NOT NULL default '0000-00-00 00:00:00',"
@@ -4783,46 +4958,56 @@ tmp.constData(),
4783 4958 " closecaptioned tinyint(1) NOT NULL default '0',"
4784 4959 " partnumber int(11) NOT NULL default '0',"
4785 4960 " parttotal int(11) NOT NULL default '0',"
4786   -" seriesid varchar(12) NOT NULL default '',"
  4961 +" seriesid varchar(40) NOT NULL default '',"
4787 4962 " originalairdate date default NULL,"
4788 4963 " showtype varchar(30) NOT NULL default '',"
4789 4964 " colorcode varchar(20) NOT NULL default '',"
4790 4965 " syndicatedepisodenumber varchar(20) NOT NULL default '',"
4791   -" programid varchar(20) NOT NULL default '',"
  4966 +" programid varchar(40) NOT NULL default '',"
4792 4967 " manualid int(10) unsigned NOT NULL default '0',"
4793 4968 " generic tinyint(1) default '0',"
  4969 +" listingsource int(11) NOT NULL default '0',"
  4970 +" `first` tinyint(1) NOT NULL default '0',"
  4971 +" `last` tinyint(1) NOT NULL default '0',"
  4972 +" audioprop set('STEREO','MONO','SURROUND','DOLBY','HARDHEAR','VISUALIMPAIR') NOT NULL,"
  4973 +" subtitletypes set('HARDHEAR','NORMAL','ONSCREEN','SIGNED') NOT NULL,"
  4974 +" videoprop set('HDTV','WIDESCREEN','AVC') NOT NULL,"
4794 4975 " PRIMARY KEY (chanid,starttime,manualid),"
4795 4976 " KEY endtime (endtime),"
4796 4977 " KEY title (title),"
4797 4978 " KEY title_pronounce (title_pronounce),"
4798 4979 " KEY seriesid (seriesid),"
4799   -" KEY programid (programid),"
4800   -" KEY id_start_end (chanid,starttime,endtime)"
  4980 +" KEY id_start_end (chanid,starttime,endtime),"
  4981 +" KEY program_manualid (manualid),"
  4982 +" KEY previouslyshown (previouslyshown),"
  4983 +" KEY programid (programid,starttime),"
  4984 +" KEY starttime (starttime)"
4801 4985 ");",
4802   -"CREATE TABLE IF NOT EXISTS programgenres ("
  4986 +"CREATE TABLE programgenres ("
4803 4987 " chanid int(10) unsigned NOT NULL default '0',"
4804 4988 " starttime datetime NOT NULL default '0000-00-00 00:00:00',"
4805 4989 " relevance char(1) NOT NULL default '',"
4806   -" genre char(30) default NULL,"
4807   -" PRIMARY KEY (chanid,starttime,relevance)"
  4990 +" genre varchar(30) default NULL,"
  4991 +" PRIMARY KEY (chanid,starttime,relevance),"
  4992 +" KEY genre (genre)"
4808 4993 ");",
4809   -"CREATE TABLE IF NOT EXISTS programrating ("
  4994 +"CREATE TABLE programrating ("
4810 4995 " chanid int(10) unsigned NOT NULL default '0',"
4811 4996 " starttime datetime NOT NULL default '0000-00-00 00:00:00',"
4812   -" system char(8) NOT NULL default '',"
4813   -" rating char(8) NOT NULL default '',"
  4997 +" system varchar(8) default NULL,"
  4998 +" rating varchar(16) default NULL,"
4814 4999 " UNIQUE KEY chanid (chanid,starttime,system,rating),"
4815 5000 " KEY starttime (starttime,system)"
4816 5001 ");",
4817   -"CREATE TABLE IF NOT EXISTS recgrouppassword ("
4818   -" recgroup varchar(32) NOT NULL default '',"
4819   -" password varchar(10) NOT NULL default '',"
  5002 +"CREATE TABLE recgrouppassword ("
  5003 +" recgroup varchar(32) collate utf8_bin NOT NULL default '',"
  5004 +" `password` varchar(10) NOT NULL default '',"
4820 5005 " PRIMARY KEY (recgroup),"
4821 5006 " UNIQUE KEY recgroup (recgroup)"
4822 5007 ");",
4823   -"CREATE TABLE IF NOT EXISTS record ("
4824   -" recordid int(10) unsigned NOT NULL auto_increment,"
4825   -" type int(10) unsigned NOT NULL default '0',"
  5008 +"CREATE TABLE record ("
  5009 +" recordid int(10) unsigned NOT NULL,"
  5010 +" `type` int(10) unsigned NOT NULL default '0',"
4826 5011 " chanid int(10) unsigned default NULL,"
4827 5012 " starttime time NOT NULL default '00:00:00',"
4828 5013 " startdate date NOT NULL default '0000-00-00',"
@@ -4832,7 +5017,7 @@ tmp.constData(),
4832 5017 " subtitle varchar(128) NOT NULL default '',"
4833 5018 " description text NOT NULL,"
4834 5019 " category varchar(64) NOT NULL default '',"
4835   -" profile varchar(128) NOT NULL default 'Default',"
  5020 +" `profile` varchar(128) NOT NULL default 'Default',"
4836 5021 " recpriority int(10) NOT NULL default '0',"
4837 5022 " autoexpire int(11) NOT NULL default '0',"
4838 5023 " maxepisodes int(11) NOT NULL default '0',"
@@ -4843,8 +5028,8 @@ tmp.constData(),
4843 5028 " dupmethod int(11) NOT NULL default '6',"
4844 5029 " dupin int(11) NOT NULL default '15',"
4845 5030 " station varchar(20) NOT NULL default '',"
4846   -" seriesid varchar(12) NOT NULL default '',"
4847   -" programid varchar(20) NOT NULL default '',"
  5031 +" seriesid varchar(40) NOT NULL default '',"
  5032 +" programid varchar(40) NOT NULL default '',"
4848 5033 " search int(10) unsigned NOT NULL default '0',"
4849 5034 " autotranscode tinyint(1) NOT NULL default '0',"
4850 5035 " autocommflag tinyint(1) NOT NULL default '0',"
@@ -4860,13 +5045,22 @@ tmp.constData(),
4860 5045 " transcoder int(11) NOT NULL default '0',"
4861 5046 " tsdefault float NOT NULL default '1',"
4862 5047 " playgroup varchar(32) NOT NULL default 'Default',"
  5048 +" prefinput int(10) NOT NULL default '0',"
  5049 +" next_record datetime NOT NULL,"
  5050 +" last_record datetime NOT NULL,"
  5051 +" last_delete datetime NOT NULL,"
  5052 +" storagegroup varchar(32) NOT NULL default 'Default',"
  5053 +" avg_delay int(11) NOT NULL default '100',"
4863 5054 " PRIMARY KEY (recordid),"
4864 5055 " KEY chanid (chanid,starttime),"
4865 5056 " KEY title (title),"
4866 5057 " KEY seriesid (seriesid),"
4867   -" KEY programid (programid)"
  5058 +" KEY programid (programid),"
  5059 +" KEY maxepisodes (maxepisodes),"
  5060 +" KEY search (search),"
  5061 +" KEY `type` (`type`)"
4868 5062 ");",
4869   -"CREATE TABLE IF NOT EXISTS recorded ("
  5063 +"CREATE TABLE recorded ("
4870 5064 " chanid int(10) unsigned NOT NULL default '0',"
4871 5065 " starttime datetime NOT NULL default '0000-00-00 00:00:00',"
4872 5066 " endtime datetime NOT NULL default '0000-00-00 00:00:00',"
@@ -4875,16 +5069,16 @@ tmp.constData(),
4875 5069 " description text NOT NULL,"
4876 5070 " category varchar(64) NOT NULL default '',"
4877 5071 " hostname varchar(64) NOT NULL default '',"
4878   -" bookmark varchar(128) default NULL,"
  5072 +" bookmark tinyint(1) NOT NULL default '0',"
4879 5073 " editing int(10) unsigned NOT NULL default '0',"
4880   -" cutlist text,"
  5074 +" cutlist tinyint(1) NOT NULL default '0',"
4881 5075 " autoexpire int(11) NOT NULL default '0',"
4882 5076 " commflagged int(10) unsigned NOT NULL default '0',"
4883 5077 " recgroup varchar(32) NOT NULL default 'Default',"
4884 5078 " recordid int(11) default NULL,"
4885   -" seriesid varchar(12) NOT NULL default '',"
4886   -" programid varchar(20) NOT NULL default '',"
4887   -" lastmodified timestamp(14) NOT NULL,"
  5079 +" seriesid varchar(40) NOT NULL default '',"
  5080 +" programid varchar(40) NOT NULL default '',"
  5081 +" lastmodified timestamp NOT NULL default CURRENT_TIMESTAMP,"
4888 5082 " filesize bigint(20) NOT NULL default '0',"
4889 5083 " stars float NOT NULL default '0',"
4890 5084 " previouslyshown tinyint(1) default '0',"
@@ -4895,37 +5089,59 @@ tmp.constData(),
4895 5089 " transcoder int(11) NOT NULL default '0',"
4896 5090 " timestretch float NOT NULL default '1',"
4897 5091 " recpriority int(11) NOT NULL default '0',"
4898   -" basename varchar(128) NOT NULL default '',"
  5092 +" basename varchar(255) NOT NULL,"
4899 5093 " progstart datetime NOT NULL default '0000-00-00 00:00:00',"
4900 5094 " progend datetime NOT NULL default '0000-00-00 00:00:00',"
4901 5095 " playgroup varchar(32) NOT NULL default 'Default',"
4902   -" profile varchar(32) NOT NULL default '',"
  5096 +" `profile` varchar(32) NOT NULL default '',"
  5097 +" `duplicate` tinyint(1) NOT NULL default '0',"
  5098 +" transcoded tinyint(1) NOT NULL default '0',"
  5099 +" watched tinyint(4) NOT NULL default '0',"
  5100 +" storagegroup varchar(32) NOT NULL default 'Default',"
4903 5101 " PRIMARY KEY (chanid,starttime),"
4904 5102 " KEY endtime (endtime),"
4905 5103 " KEY seriesid (seriesid),"
4906 5104 " KEY programid (programid),"
4907 5105 " KEY title (title),"
4908   -" KEY recordid (recordid)"
  5106 +" KEY recordid (recordid),"
  5107 +" KEY deletepending (deletepending,lastmodified),"
  5108 +" KEY recgroup (recgroup,endtime)"
4909 5109 ");",
4910   -"CREATE TABLE IF NOT EXISTS recordedcredits ("
  5110 +"CREATE TABLE recordedcredits ("
4911 5111 " person mediumint(8) unsigned NOT NULL default '0',"
4912 5112 " chanid int(10) unsigned NOT NULL default '0',"
4913 5113 " starttime datetime NOT NULL default '0000-00-00 00:00:00',"
4914   -" role set('actor','director','producer','executive_producer','writer',"
4915   -" 'guest_star','host','adapter','presenter','commentator','guest')"
4916   -" NOT NULL default '',"
  5114 +" role set('actor','director','producer','executive_producer','writer','guest_star','host','adapter','presenter','commentator','guest') NOT NULL default '',"
4917 5115 " UNIQUE KEY chanid (chanid,starttime,person,role),"
4918 5116 " KEY person (person,role)"
4919 5117 ");",
4920   -"CREATE TABLE IF NOT EXISTS recordedmarkup ("
  5118 +"CREATE TABLE recordedfile ("
4921 5119 " chanid int(10) unsigned NOT NULL default '0',"
4922 5120 " starttime datetime NOT NULL default '0000-00-00 00:00:00',"
4923   -" mark bigint(20) NOT NULL default '0',"
4924   -" offset varchar(32) default NULL,"
4925   -" type int(11) NOT NULL default '0',"
4926   -" PRIMARY KEY (chanid,starttime,mark,type)"
  5121 +" basename varchar(128) NOT NULL default '',"
  5122 +" filesize bigint(20) NOT NULL default '0',"
  5123 +" width smallint(5) unsigned NOT NULL default '0',"
  5124 +" height smallint(5) unsigned NOT NULL default '0',"
  5125 +" fps float(6,3) NOT NULL default '0.000',"
  5126 +" aspect float(8,6) NOT NULL default '0.000000',"
  5127 +" audio_sample_rate smallint(5) unsigned NOT NULL default '0',"
  5128 +" audio_bits_per_sample smallint(5) unsigned NOT NULL default '0',"
  5129 +" audio_channels tinyint(3) unsigned NOT NULL default '0',"
  5130 +" audio_type varchar(255) NOT NULL default '',"
  5131 +" video_type varchar(255) NOT NULL default '',"
  5132 +" `comment` varchar(255) NOT NULL default '',"
  5133 +" PRIMARY KEY (chanid,starttime),"
  5134 +" KEY basename (basename)"
4927 5135 ");",
4928   -"CREATE TABLE IF NOT EXISTS recordedprogram ("
  5136 +"CREATE TABLE recordedmarkup ("
  5137 +" chanid int(10) unsigned NOT NULL default '0',"
  5138 +" starttime datetime NOT NULL default '0000-00-00 00:00:00',"
  5139 +" mark mediumint(8) unsigned NOT NULL default '0',"
  5140 +" `type` tinyint(4) NOT NULL default '0',"
  5141 +" `data` int(11) unsigned default NULL,"
  5142 +" PRIMARY KEY (chanid,starttime,`type`,mark)"
  5143 +");",
  5144 +"CREATE TABLE recordedprogram ("
4929 5145 " chanid int(10) unsigned NOT NULL default '0',"
4930 5146 " starttime datetime NOT NULL default '0000-00-00 00:00:00',"
4931 5147 " endtime datetime NOT NULL default '0000-00-00 00:00:00',"
@@ -4944,14 +5160,20 @@ tmp.constData(),
4944 5160 " closecaptioned tinyint(1) NOT NULL default '0',"
4945 5161 " partnumber int(11) NOT NULL default '0',"
4946 5162 " parttotal int(11) NOT NULL default '0',"
4947   -" seriesid varchar(12) NOT NULL default '',"
  5163 +" seriesid varchar(40) NOT NULL default '',"
4948 5164 " originalairdate date default NULL,"
4949 5165 " showtype varchar(30) NOT NULL default '',"
4950 5166 " colorcode varchar(20) NOT NULL default '',"
4951 5167 " syndicatedepisodenumber varchar(20) NOT NULL default '',"
4952   -" programid varchar(20) NOT NULL default '',"
  5168 +" programid varchar(40) NOT NULL default '',"
4953 5169 " manualid int(10) unsigned NOT NULL default '0',"
4954 5170 " generic tinyint(1) default '0',"
  5171 +" listingsource int(11) NOT NULL default '0',"
  5172 +" `first` tinyint(1) NOT NULL default '0',"
  5173 +" `last` tinyint(1) NOT NULL default '0',"
  5174 +" audioprop set('STEREO','MONO','SURROUND','DOLBY','HARDHEAR','VISUALIMPAIR') NOT NULL,"
  5175 +" subtitletypes set('HARDHEAR','NORMAL','ONSCREEN','SIGNED') NOT NULL,"
  5176 +" videoprop set('HDTV','WIDESCREEN','AVC') NOT NULL,"
4955 5177 " PRIMARY KEY (chanid,starttime,manualid),"
4956 5178 " KEY endtime (endtime),"
4957 5179 " KEY title (title),"
@@ -4960,36 +5182,58 @@ tmp.constData(),
4960 5182 " KEY programid (programid),"
4961 5183 " KEY id_start_end (chanid,starttime,endtime)"
4962 5184 ");",
4963   -"CREATE TABLE IF NOT EXISTS recordedrating ("
  5185 +"CREATE TABLE recordedrating ("
4964 5186 " chanid int(10) unsigned NOT NULL default '0',"
4965 5187 " starttime datetime NOT NULL default '0000-00-00 00:00:00',"
4966   -" system char(8) NOT NULL default '',"
4967   -" rating char(8) NOT NULL default '',"
  5188 +" system varchar(8) default NULL,"
  5189 +" rating varchar(16) default NULL,"
4968 5190 " UNIQUE KEY chanid (chanid,starttime,system,rating),"
4969 5191 " KEY starttime (starttime,system)"
4970 5192 ");",
4971   -"CREATE TABLE IF NOT EXISTS recordingprofiles ("
4972   -" id int(10) unsigned NOT NULL auto_increment,"
4973   -" name varchar(128) default NULL,"
  5193 +"CREATE TABLE recordedseek ("
  5194 +" chanid int(10) unsigned NOT NULL default '0',"
  5195 +" starttime datetime NOT NULL default '0000-00-00 00:00:00',"
  5196 +" mark mediumint(8) unsigned NOT NULL default '0',"
  5197 +" `offset` bigint(20) unsigned NOT NULL,"
  5198 +" `type` tinyint(4) NOT NULL default '0',"
  5199 +" PRIMARY KEY (chanid,starttime,`type`,mark)"
  5200 +");",
  5201 +"CREATE TABLE recordingprofiles ("
  5202 +" id int(10) unsigned NOT NULL,"
  5203 +" `name` varchar(128) default NULL,"
4974 5204 " videocodec varchar(128) default NULL,"
4975 5205 " audiocodec varchar(128) default NULL,"
4976 5206 " profilegroup int(10) unsigned NOT NULL default '0',"
4977   -" PRIMARY KEY (id)"
  5207 +" PRIMARY KEY (id),"
  5208 +" KEY profilegroup (profilegroup)"
4978 5209 ");",
4979   -"CREATE TABLE IF NOT EXISTS recordmatch ("
  5210 +"CREATE TABLE recordmatch ("
4980 5211 " recordid int(10) unsigned default NULL,"
4981 5212 " chanid int(10) unsigned default NULL,"
4982 5213 " starttime datetime default NULL,"
4983 5214 " manualid int(10) unsigned default NULL,"
  5215 +" oldrecduplicate tinyint(1) default NULL,"
  5216 +" recduplicate tinyint(1) default NULL,"
  5217 +" findduplicate tinyint(1) default NULL,"
  5218 +" oldrecstatus int(11) default NULL,"
4984 5219 " KEY recordid (recordid)"
4985 5220 ");",
4986   -"CREATE TABLE IF NOT EXISTS settings ("
4987   -" value varchar(128) NOT NULL default '',"
4988   -" data text,"
  5221 +"CREATE TABLE settings ("
  5222 +" `value` varchar(128) NOT NULL default '',"
  5223 +" `data` text,"
4989 5224 " hostname varchar(64) default NULL,"
4990   -" KEY value (value,hostname)"
  5225 +" KEY `value` (`value`,hostname)"
4991 5226 ");",
4992   -"CREATE TABLE IF NOT EXISTS tvchain ("
  5227 +"CREATE TABLE storagegroup ("
  5228 +" id int(11) NOT NULL,"
  5229 +" groupname varchar(32) NOT NULL,"
  5230 +" hostname varchar(64) NOT NULL default '',"
  5231 +" dirname varchar(235) collate utf8_bin NOT NULL default '',"
  5232 +" PRIMARY KEY (id),"
  5233 +" UNIQUE KEY grouphostdir (groupname,hostname,dirname),"
  5234 +" KEY hostname (hostname)"
  5235 +");",
  5236 +"CREATE TABLE tvchain ("
4993 5237 " chanid int(10) unsigned NOT NULL default '0',"
4994 5238 " starttime datetime NOT NULL default '0000-00-00 00:00:00',"
4995 5239 " chainid varchar(128) NOT NULL default '',"
@@ -5000,44 +5244,44 @@ tmp.constData(),
5000 5244 " cardtype varchar(32) NOT NULL default 'V4L',"
5001 5245 " input varchar(32) NOT NULL default '',"
5002 5246 " channame varchar(32) NOT NULL default '',"
  5247 +" endtime datetime NOT NULL default '0000-00-00 00:00:00',"
5003 5248 " PRIMARY KEY (chanid,starttime)"
5004 5249 ");",
5005   -"CREATE TABLE IF NOT EXISTS videobookmarks ("
5006   -" filename varchar(255) NOT NULL default '',"
5007   -" bookmark varchar(128) default NULL,"
5008   -" PRIMARY KEY (filename)"
  5250 +"CREATE TABLE upnpmedia ("
  5251 +" intid int(10) unsigned NOT NULL default '0',"
  5252 +" class varchar(64) NOT NULL default '',"
  5253 +" itemtype varchar(128) NOT NULL default '',"
  5254 +" parentid int(10) unsigned NOT NULL default '0',"
  5255 +" itemproperties varchar(255) NOT NULL default '',"
  5256 +" filepath varchar(512) NOT NULL default '',"
  5257 +" title varchar(255) NOT NULL default '',"
  5258 +" filename varchar(512) NOT NULL default '',"
  5259 +" coverart varchar(512) NOT NULL default '',"
  5260 +" PRIMARY KEY (intid),"
  5261 +" KEY class (class),"
  5262 +" KEY filepath (filepath(333)),"
  5263 +" KEY parentid (parentid)"
5009 5264 ");",
5010   -"CREATE TABLE IF NOT EXISTS videosource ("
5011   -" sourceid int(10) unsigned NOT NULL auto_increment,"
5012   -" name varchar(128) NOT NULL default '',"
  5265 +"CREATE TABLE videosource ("
  5266 +" sourceid int(10) unsigned NOT NULL,"
  5267 +" `name` varchar(128) NOT NULL default '',"
5013 5268 " xmltvgrabber varchar(128) default NULL,"
5014 5269 " userid varchar(128) NOT NULL default '',"
5015 5270 " freqtable varchar(16) NOT NULL default 'default',"
5016 5271 " lineupid varchar(64) default NULL,"
5017   -" password varchar(64) default NULL,"
  5272 +" `password` varchar(64) default NULL,"
5018 5273 " useeit smallint(6) NOT NULL default '0',"
5019 5274 " PRIMARY KEY (sourceid),"
5020   -" UNIQUE KEY name (name)"
5021   -");",
5022   -"CREATE TABLE IF NOT EXISTS xvmc_buffer_settings ("
5023   -" id int(11) NOT NULL auto_increment,"
5024   -" description varchar(255) NOT NULL default '',"
5025   -" osd_num int(11) NOT NULL default '0',"
5026   -" osd_res_num int(11) NOT NULL default '0',"
5027   -" min_surf int(11) NOT NULL default '0',"
5028   -" max_surf int(11) NOT NULL default '0',"
5029   -" decode_num int(11) NOT NULL default '0',"
5030   -" agressive int(11) NOT NULL default '1',"
5031   -" PRIMARY KEY (id)"
  5275 +" UNIQUE KEY `name` (`name`)"
5032 5276 ");",
  5277 +
  5278 +"INSERT INTO customexample VALUES ('New Flix','','program.category_type = ''movie'' AND program.airdate >= \n YEAR(DATE_SUB(NOW(), INTERVAL 1 YEAR)) \nAND program.stars > 0.5 ',1);",
5033 5279 "INSERT INTO dtv_privatetypes VALUES ('dvb',9018,'channel_numbers','131');",
5034 5280 "INSERT INTO dtv_privatetypes VALUES ('dvb',9018,'guide_fixup','2');",
5035 5281 "INSERT INTO dtv_privatetypes VALUES ('dvb',256,'guide_fixup','1');",
5036 5282 "INSERT INTO dtv_privatetypes VALUES ('dvb',257,'guide_fixup','1');",
5037   -"INSERT INTO dtv_privatetypes VALUES ('dvb',256,'tv_types',"
5038   -" '1,150,134,133');",
5039   -"INSERT INTO dtv_privatetypes VALUES ('dvb',257,'tv_types',"
5040   -" '1,150,134,133');",
  5283 +"INSERT INTO dtv_privatetypes VALUES ('dvb',256,'tv_types','1,150,134,133');",
  5284 +"INSERT INTO dtv_privatetypes VALUES ('dvb',257,'tv_types','1,150,134,133');",
5041 5285 "INSERT INTO dtv_privatetypes VALUES ('dvb',4100,'sdt_mapping','1');",
5042 5286 "INSERT INTO dtv_privatetypes VALUES ('dvb',4101,'sdt_mapping','1');",
5043 5287 "INSERT INTO dtv_privatetypes VALUES ('dvb',4102,'sdt_mapping','1');",
@@ -5066,38 +5310,36 @@ tmp.constData(),
5066 5310 "INSERT INTO dtv_privatetypes VALUES ('dvb',4105,'guide_fixup','1');",
5067 5311 "INSERT INTO dtv_privatetypes VALUES ('dvb',4106,'guide_fixup','1');",
5068 5312 "INSERT INTO dtv_privatetypes VALUES ('dvb',4107,'guide_fixup','1');",
5069   -"INSERT INTO dtv_privatetypes VALUES ('dvb',4096,'guide_fixup','5');",
  5313 +"INSERT INTO dtv_privatetypes VALUES ('dvb',4096,'guide_fixup','5');",
5070 5314 "INSERT INTO dtv_privatetypes VALUES ('dvb',4097,'guide_fixup','1');",
5071 5315 "INSERT INTO dtv_privatetypes VALUES ('dvb',4098,'guide_fixup','1');",
5072 5316 "INSERT INTO dtv_privatetypes VALUES ('dvb',94,'tv_types','1,128');",
5073 5317 "INSERT INTO dtv_privatetypes VALUES ('atsc',1793,'guide_fixup','3');",
5074 5318 "INSERT INTO dtv_privatetypes VALUES ('dvb',40999,'guide_fixup','4');",
5075   -"INSERT INTO dtv_privatetypes VALUES ('dvb',70,'force_guide_present',"
5076   -" 'yes');",
5077   -"INSERT INTO dtv_privatetypes VALUES ('dvb',70,'guide_ranges',"
5078   -" '80,80,96,96');",
  5319 +"INSERT INTO dtv_privatetypes VALUES ('dvb',70,'force_guide_present','yes');",
  5320 +"INSERT INTO dtv_privatetypes VALUES ('dvb',70,'guide_ranges','80,80,96,96');",
5079 5321 "INSERT INTO dtv_privatetypes VALUES ('dvb',4112,'channel_numbers','131');",
5080 5322 "INSERT INTO dtv_privatetypes VALUES ('dvb',4115,'channel_numbers','131');",
5081 5323 "INSERT INTO dtv_privatetypes VALUES ('dvb',4116,'channel_numbers','131');",
5082 5324 "INSERT INTO dtv_privatetypes VALUES ('dvb',12802,'channel_numbers','131');",
5083 5325 "INSERT INTO dtv_privatetypes VALUES ('dvb',12803,'channel_numbers','131');",
5084 5326 "INSERT INTO dtv_privatetypes VALUES ('dvb',12829,'channel_numbers','131');",
5085   -"INSERT INTO dtv_privatetypes VALUES ('dvb',40999,'parse_subtitle_list',"
5086   -" '1070,1308,1041,1306,1307,1030,1016,1131,1068,1069');",
5087   -"INSERT INTO playgroup VALUES ('Default','',30,5,100);",
5088   -"INSERT INTO profilegroups VALUES (1,'Software Encoders (v4l based)','V4L',"
5089   -" 1,NULL);",
5090   -"INSERT INTO profilegroups VALUES (2,'MPEG-2 Encoders (PVR-x50, PVR-500)',"
5091   -" 'MPEG',1,NULL);",
5092   -"INSERT INTO profilegroups VALUES (3,"
5093   -" 'Hardware MJPEG Encoders (Matrox G200-TV, Miro DC10, etc)','MJPEG',1,NULL);",
  5327 +"INSERT INTO dtv_privatetypes VALUES ('dvb',40999,'parse_subtitle_list','1070,1308,1041,1306,1307,1030,1016,1131,1068,1069');",
  5328 +"INSERT INTO dtv_privatetypes VALUES ('dvb',4096,'guide_fixup','5');",
  5329 +"INSERT INTO playgroup VALUES ('Default','',30,5,100,0);",
  5330 +"INSERT INTO profilegroups VALUES (1,'Software Encoders (v4l based)','V4L',1,NULL);",
  5331 +"INSERT INTO profilegroups VALUES (2,'MPEG-2 Encoders (PVR-x50, PVR-500)','MPEG',1,NULL);",
  5332 +"INSERT INTO profilegroups VALUES (3,'Hardware MJPEG Encoders (Matrox G200-TV, Miro DC10, etc)','MJPEG',1,NULL);",
5094 5333 "INSERT INTO profilegroups VALUES (4,'Hardware HDTV','HDTV',1,NULL);",
5095 5334 "INSERT INTO profilegroups VALUES (5,'Hardware DVB Encoders','DVB',1,NULL);",
5096 5335 "INSERT INTO profilegroups VALUES (6,'Transcoders','TRANSCODE',1,NULL);",
5097 5336 "INSERT INTO profilegroups VALUES (7,'FireWire Input','FIREWIRE',1,NULL);",
5098   -"INSERT INTO profilegroups VALUES (8,"
5099   -" 'USB Mpeg-4 Encoder (Plextor ConvertX, etc)','GO7007',1,NULL);",
  5337 +"INSERT INTO profilegroups VALUES (8,'USB Mpeg-4 Encoder (Plextor ConvertX, etc)','GO7007',1,NULL);",
5100 5338 "INSERT INTO profilegroups VALUES (9,'DBOX2 Input','DBOX2',1,NULL);",
  5339 +"INSERT INTO profilegroups VALUES (10,'Freebox Input','Freebox',1,NULL);",
  5340 +"INSERT INTO profilegroups VALUES (11,'HDHomeRun Recorders','HDHOMERUN',1,NULL);",
  5341 +"INSERT INTO profilegroups VALUES (12,'CRC IP Recorders','CRC_IP',1,NULL);",
  5342 +"INSERT INTO profilegroups VALUES (13,'HD-PVR Recorders','HDPVR',1,NULL);",
5101 5343 "INSERT INTO recordingprofiles VALUES (1,'Default',NULL,NULL,1);",
5102 5344 "INSERT INTO recordingprofiles VALUES (2,'Live TV',NULL,NULL,1);",
5103 5345 "INSERT INTO recordingprofiles VALUES (3,'High Quality',NULL,NULL,1);",
@@ -5127,22 +5369,42 @@ tmp.constData(),
5127 5369 "INSERT INTO recordingprofiles VALUES (27,'High Quality',NULL,NULL,6);",
5128 5370 "INSERT INTO recordingprofiles VALUES (28,'Medium Quality',NULL,NULL,6);",
5129 5371 "INSERT INTO recordingprofiles VALUES (29,'Low Quality',NULL,NULL,6);",
  5372 +"INSERT INTO recordingprofiles VALUES (30,'Default',NULL,NULL,10);",
  5373 +"INSERT INTO recordingprofiles VALUES (31,'Live TV',NULL,NULL,10);",
  5374 +"INSERT INTO recordingprofiles VALUES (32,'High Quality',NULL,NULL,10);",
  5375 +"INSERT INTO recordingprofiles VALUES (33,'Low Quality',NULL,NULL,10);",
  5376 +"INSERT INTO recordingprofiles VALUES (34,'Default',NULL,NULL,11);",
  5377 +"INSERT INTO recordingprofiles VALUES (35,'Live TV',NULL,NULL,11);",
  5378 +"INSERT INTO recordingprofiles VALUES (36,'High Quality',NULL,NULL,11);",
  5379 +"INSERT INTO recordingprofiles VALUES (37,'Low Quality',NULL,NULL,11);",
  5380 +"INSERT INTO recordingprofiles VALUES (38,'Default',NULL,NULL,12);",
  5381 +"INSERT INTO recordingprofiles VALUES (39,'Live TV',NULL,NULL,12);",
  5382 +"INSERT INTO recordingprofiles VALUES (40,'High Quality',NULL,NULL,12);",
  5383 +"INSERT INTO recordingprofiles VALUES (41,'Low Quality',NULL,NULL,12);",
  5384 +"INSERT INTO recordingprofiles VALUES (42,'Default',NULL,NULL,7);",
  5385 +"INSERT INTO recordingprofiles VALUES (43,'Live TV',NULL,NULL,7);",
  5386 +"INSERT INTO recordingprofiles VALUES (44,'High Quality',NULL,NULL,7);",
  5387 +"INSERT INTO recordingprofiles VALUES (45,'Low Quality',NULL,NULL,7);",
  5388 +"INSERT INTO recordingprofiles VALUES (46,'Default',NULL,NULL,9);",
  5389 +"INSERT INTO recordingprofiles VALUES (47,'Live TV',NULL,NULL,9);",
  5390 +"INSERT INTO recordingprofiles VALUES (48,'High Quality',NULL,NULL,9);",
  5391 +"INSERT INTO recordingprofiles VALUES (49,'Low Quality',NULL,NULL,9);",
  5392 +"INSERT INTO recordingprofiles VALUES (50,'Default',NULL,NULL,13);",
  5393 +"INSERT INTO recordingprofiles VALUES (51,'Live TV',NULL,NULL,13);",
  5394 +"INSERT INTO recordingprofiles VALUES (52,'High Quality',NULL,NULL,13);",
  5395 +"INSERT INTO recordingprofiles VALUES (53,'Low Quality',NULL,NULL,13);",
5130 5396 "INSERT INTO settings VALUES ('mythfilldatabaseLastRunStart',NULL,NULL);",
5131 5397 "INSERT INTO settings VALUES ('mythfilldatabaseLastRunEnd',NULL,NULL);",
5132 5398 "INSERT INTO settings VALUES ('mythfilldatabaseLastRunStatus',NULL,NULL);",
5133 5399 "INSERT INTO settings VALUES ('DataDirectMessage',NULL,NULL);",
5134 5400 "INSERT INTO settings VALUES ('HaveRepeats','0',NULL);",
5135   -"INSERT INTO settings VALUES ('DBSchemaVer','1112',NULL);",
  5401 +"INSERT INTO settings VALUES ('DBSchemaVer','1226',NULL);",
5136 5402 "INSERT INTO settings VALUES ('DefaultTranscoder','0',NULL);",
5137   -"INSERT INTO xvmc_buffer_settings VALUES (1,'Default / nVidia',"
5138   -" 2,2,8,16,8,1);",
5139   -"INSERT INTO xvmc_buffer_settings VALUES (2,'VLD (More decode buffers)',"
5140   -" 2,2,8,16,16,1);",
5141 5403 NULL
5142 5404 };
5143 5405
5144 5406 QString dbver = "";
5145   - if (!performActualUpdate(updates, "1112", dbver))
  5407 + if (!performActualUpdate(updates, "1226", dbver))
5146 5408 return false;
5147 5409 return true;
5148 5410 }

0 comments on commit 456caa8

Please sign in to comment.
Something went wrong with that request. Please try again.