10 #include "libmythbase/mythconfig.h"
15 #include "libmythbase/mythversion.h"
27 #define MINIMUM_DBMS_VERSION 5,0,15
33 #if CONFIG_SYSTEMD_NOTIFY
34 #include <systemd/sd-daemon.h>
37 sd_notifyf(0,
"STATUS=Database update: %s", str);
362 const bool upgradeIfNoUI,
363 const bool informSystemd)
365 #ifdef IGNORE_SCHEMA_VER_MISMATCH
368 #if CONFIG_SYSTEMD_NOTIFY == 0
369 Q_UNUSED(informSystemd);
375 GetMythDB()->SetSuppressDBMessages(
true);
381 for (
uint i = 0; i < 2*60 && !locked; i++)
385 LOG(VB_GENERAL, LOG_INFO,
"Waiting for database schema upgrade lock");
388 LOG(VB_GENERAL, LOG_INFO,
"Got schema upgrade lock");
392 LOG(VB_GENERAL, LOG_INFO,
"Failed to get schema upgrade lock");
393 goto upgrade_error_exit;
399 if (schema_wizard->
Compare() == 0)
400 goto upgrade_ok_exit;
403 LOG(VB_GENERAL, LOG_WARNING,
"Not allowed to upgrade the database.");
412 goto upgrade_ok_exit;
415 goto upgrade_error_exit;
420 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Newest MythTV Schema Version : %1")
428 LOG(VB_GENERAL, LOG_ERR,
"Database schema upgrade failed.");
429 goto upgrade_error_exit;
432 LOG(VB_GENERAL, LOG_INFO,
"Database schema upgrade complete.");
442 GetMythDB()->SetSuppressDBMessages(
false);
451 GetMythDB()->SetSuppressDBMessages(
false);
475 auto ss2ba = [](
const auto & ss){
return QByteArray::fromStdString(ss); };
476 auto qs2ba = [](
const auto & item){
return item.constData(); };
477 auto add_start_end = [order](
const auto & field){
478 return QString(
"UPDATE %1 "
479 "SET starttime = CONVERT_TZ(starttime, 'SYSTEM', 'Etc/UTC'), "
480 " endtime = CONVERT_TZ(endtime, 'SYSTEM', 'Etc/UTC') "
482 .arg(QString::fromStdString(field)).arg(order).toLocal8Bit(); };
483 auto add_start = [order](
const auto & field){
484 return QString(
"UPDATE %1 "
485 "SET starttime = CONVERT_TZ(starttime, 'SYSTEM', 'Etc/UTC') "
487 .arg(QString::fromStdString(field)).arg(order).toLocal8Bit(); };
498 if (!query.
exec(QString(
"ALTER DATABASE %1 DEFAULT "
499 "CHARACTER SET utf8 COLLATE utf8_general_ci;")
513 if (dbver.isEmpty() || dbver.toInt() < 1027)
515 LOG(VB_GENERAL, LOG_ERR,
"Unrecognized database schema version. "
516 "Unable to upgrade database.");
519 if (dbver.toInt() < 1244)
521 LOG(VB_GENERAL, LOG_ERR,
"Your database version is too old to upgrade "
522 "with this version of MythTV. You will need "
523 "to use mythtv-setup from MythTV 0.22, 0.23, "
524 "or 0.24 to upgrade your database before "
525 "upgrading to this version of MythTV.");
532 "ALTER TABLE cardinput DROP COLUMN freetoaironly;",
533 "ALTER TABLE cardinput DROP COLUMN radioservices;"
536 updates,
"1245", dbver))
543 "DELETE FROM capturecard WHERE cardtype = 'DBOX2';",
544 "DELETE FROM profilegroups WHERE cardtype = 'DBOX2';",
545 "ALTER TABLE capturecard DROP COLUMN dbox2_port;",
546 "ALTER TABLE capturecard DROP COLUMN dbox2_httpport;",
547 "ALTER TABLE capturecard DROP COLUMN dbox2_host;"
550 updates,
"1246", dbver))
557 "ALTER TABLE recorded ADD COLUMN bookmarkupdate timestamp default 0 NOT NULL",
558 "UPDATE recorded SET bookmarkupdate = lastmodified+1 WHERE bookmark = 1",
559 "UPDATE recorded SET bookmarkupdate = lastmodified WHERE bookmark = 0"
562 updates,
"1247", dbver))
569 "INSERT INTO profilegroups SET name = \"Import Recorder\", cardtype = 'IMPORT', is_default = 1;",
570 "INSERT INTO recordingprofiles SET name = \"Default\", profilegroup = 14;",
571 "INSERT INTO recordingprofiles SET name = \"Live TV\", profilegroup = 14;",
572 "INSERT INTO recordingprofiles SET name = \"High Quality\", profilegroup = 14;",
573 "INSERT INTO recordingprofiles SET name = \"Low Quality\", profilegroup = 14;"
576 updates,
"1248", dbver))
583 "DELETE FROM keybindings WHERE action = 'CUSTOMEDIT' "
584 "AND context = 'TV Frontend' AND keylist = 'E';"
587 updates,
"1249", dbver))
593 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1250");
596 select.
prepare(
"SELECT hostname, data FROM settings "
597 " WHERE value = 'StickyKeys'");
606 while (select.
next())
609 QString sticky_keys = select.
value(1).toString();
611 if (
"1" == sticky_keys)
614 update.
prepare(
"UPDATE keybindings "
615 " SET keylist = :KEYS "
616 " WHERE context = 'TV Playback' AND "
617 " action = :ACTION AND "
618 " hostname = :HOSTNAME AND "
619 " keylist = :DEFAULT_KEYS");
621 QString keylist =
"";
622 QString
action =
"SEEKFFWD";
623 QString default_keys =
"Right";
628 update.
bindValue(
":DEFAULT_KEYS", default_keys);
635 default_keys =
"Left";
640 update.
bindValue(
":DEFAULT_KEYS", default_keys);
645 keylist =
">,.,Right";
647 default_keys =
">,.";
652 update.
bindValue(
":DEFAULT_KEYS", default_keys);
657 keylist =
",,<,Left";
659 default_keys =
",,<";
664 update.
bindValue(
":DEFAULT_KEYS", default_keys);
679 "UPDATE recorded SET bookmark = 1 WHERE bookmark != 0;"
682 updates,
"1251", dbver))
688 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1252");
691 query.
prepare(
"SHOW INDEX FROM recgrouppassword");
696 "recgrouppassword.", query);
702 QString index_name = query.
value(2).toString();
704 if (
"recgroup" == index_name)
707 update.
prepare(
"ALTER TABLE recgrouppassword "
708 " DROP INDEX recgroup");
713 "recgrouppassword. Ignoring.",
727 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1253");
730 select.
prepare(
"SELECT hostname, data FROM settings "
731 " WHERE value = 'StickyKeys'");
740 while (select.
next())
743 QString sticky_keys = select.
value(1).toString();
745 if (
"1" == sticky_keys)
748 update.
prepare(
"UPDATE keybindings "
749 " SET keylist = :KEYS "
750 " WHERE context = 'TV Playback' AND "
751 " action = :ACTION AND "
752 " hostname = :HOSTNAME AND "
753 " keylist = :DEFAULT_KEYS");
755 QString keylist =
">,.";
756 QString
action =
"FFWDSTICKY";
757 QString default_keys =
">,.,Right";
762 update.
bindValue(
":DEFAULT_KEYS", default_keys);
769 default_keys =
",,<,Left";
774 update.
bindValue(
":DEFAULT_KEYS", default_keys);
791 LOG(VB_GENERAL, LOG_CRIT,
792 "Upgrading to MythTV schema version 1254");
799 "ALTER TABLE videosource ADD dvb_nit_id INT(6) DEFAULT -1;"
802 updates,
"1254", dbver))
810 "ALTER TABLE cardinput DROP COLUMN shareable;"
813 updates,
"1255", dbver))
820 "INSERT INTO keybindings (SELECT 'Main Menu', 'EXIT', 'System Exit', "
821 "(CASE data WHEN '1' THEN 'Ctrl+Esc' WHEN '2' THEN 'Meta+Esc' "
822 "WHEN '3' THEN 'Alt+Esc' WHEN '4' THEN 'Esc' ELSE '' END), hostname "
823 "FROM settings WHERE value = 'AllowQuitShutdown' GROUP BY hostname) "
824 "ON DUPLICATE KEY UPDATE keylist = VALUES(keylist);"
827 updates,
"1256", dbver))
834 "ALTER TABLE record DROP COLUMN tsdefault;"
837 updates,
"1257", dbver))
844 "CREATE TABLE internetcontent "
845 "( name VARCHAR(255) NOT NULL,"
846 " thumbnail VARCHAR(255),"
847 " type SMALLINT(3) NOT NULL,"
848 " author VARCHAR(128) NOT NULL,"
849 " description TEXT NOT NULL,"
850 " commandline TEXT NOT NULL,"
851 " version DOUBLE NOT NULL,"
852 " updated DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',"
853 " search BOOL NOT NULL,"
854 " tree BOOL NOT NULL,"
855 " podcast BOOL NOT NULL,"
856 " download BOOL NOT NULL,"
857 " host VARCHAR(128)) ENGINE=MyISAM DEFAULT CHARSET=utf8;",
858 "CREATE TABLE internetcontentarticles "
859 "( feedtitle VARCHAR(255) NOT NULL,"
860 " path TEXT NOT NULL,"
861 " paththumb TEXT NOT NULL,"
862 " title VARCHAR(255) NOT NULL,"
863 " subtitle VARCHAR(255) NOT NULL,"
864 " season SMALLINT(5) NOT NULL DEFAULT '0',"
865 " episode SMALLINT(5) NOT NULL DEFAULT '0',"
866 " description TEXT NOT NULL,"
867 " url TEXT NOT NULL,"
868 " type SMALLINT(3) NOT NULL,"
869 " thumbnail TEXT NOT NULL,"
870 " mediaURL TEXT NOT NULL,"
871 " author VARCHAR(255) NOT NULL,"
872 " date DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',"
873 " time INT NOT NULL,"
874 " rating VARCHAR(255) NOT NULL,"
875 " filesize BIGINT NOT NULL,"
876 " player VARCHAR(255) NOT NULL,"
877 " playerargs TEXT NOT NULL,"
878 " download VARCHAR(255) NOT NULL,"
879 " downloadargs TEXT NOT NULL,"
880 " width SMALLINT NOT NULL,"
881 " height SMALLINT NOT NULL,"
882 " language VARCHAR(128) NOT NULL,"
883 " podcast BOOL NOT NULL,"
884 " downloadable BOOL NOT NULL,"
885 " customhtml BOOL NOT NULL,"
886 " countries VARCHAR(255) NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8;"
889 updates,
"1258", dbver))
895 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1259");
898 select.
prepare(
"SELECT hostname, data FROM settings "
899 " WHERE value = 'IndividualMuteControl'");
909 while (select.
next())
912 QString individual_mute = select.
value(1).toString();
914 if (
"1" == individual_mute)
916 update.
prepare(
"DELETE FROM keybindings "
917 " WHERE action = 'CYCLEAUDIOCHAN' AND "
918 " hostname = :HOSTNAME AND "
919 " context IN ('TV Frontend', "
931 update.
prepare(
"UPDATE keybindings "
932 " SET action = 'CYCLEAUDIOCHAN', "
933 " description = 'Cycle audio channels'"
934 " WHERE action = 'MUTE' AND "
935 " hostname = :HOSTNAME AND "
936 " context IN ('TV Frontend', "
948 update.
prepare(
"REPLACE INTO keybindings "
949 " VALUES (:CONTEXT, 'MUTE', 'Mute', "
952 update.
bindValue(
":CONTEXT",
"TV Playback");
960 update.
bindValue(
":CONTEXT",
"TV Frontend");
978 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1260");
981 query.
prepare(
"DELETE FROM keybindings WHERE "
982 "action IN ('PAGEUP','PAGEDOWN') AND "
983 "context = 'TV FRONTEND'");
990 query.
prepare(
"SELECT data FROM settings "
991 " WHERE value = 'EPGEnableJumpToChannel'");
1001 while (query.
next())
1003 QString EPGEnableJumpToChannel = query.
value(0).toString();
1005 if (
"1" == EPGEnableJumpToChannel)
1007 bindings.
prepare(
"SELECT action, context, hostname, keylist "
1008 " FROM keybindings "
1009 " WHERE action IN ('DAYLEFT', "
1010 " 'DAYRIGHT', 'TOGGLEEPGORDER') AND "
1011 " context IN ('TV Frontend', "
1014 if (!bindings.
exec())
1020 while (bindings.
next())
1023 QString context = bindings.
value(1).toString();
1025 QStringList oldKeylist = bindings.
value(3).toString().split(
',');
1026 QStringList newKeyList;
1028 QStringList::iterator it;
1029 for (it = oldKeylist.begin(); it != oldKeylist.end();++it)
1032 int num = (*it).toInt(&ok);
1033 if (!ok && num >= 0 && num <= 9)
1034 newKeyList << (*it);
1036 QString keyList = newKeyList.join(
",");
1039 update.
prepare(
"UPDATE keybindings "
1040 " SET keylist = :KEYLIST "
1041 " WHERE action = :ACTION "
1042 " AND context = :CONTEXT "
1043 " AND hostname = :HOSTNAME");
1064 if (dbver ==
"1260")
1068 LOG(VB_GENERAL, LOG_CRIT,
1069 "Upgrading to MythTV schema version 1261");
1077 "UPDATE recorded SET programid=CONCAT(SUBSTRING(programid, 1, 2), '00', "
1078 " SUBSTRING(programid, 3)) WHERE length(programid) = 12;",
1079 "UPDATE oldrecorded SET programid=CONCAT(SUBSTRING(programid, 1, 2), '00', "
1080 " SUBSTRING(programid, 3)) WHERE length(programid) = 12;",
1081 "UPDATE program SET programid=CONCAT(SUBSTRING(programid, 1, 2), '00', "
1082 " SUBSTRING(programid, 3)) WHERE length(programid) = 12;"
1085 updates,
"1261", dbver))
1090 if (dbver ==
"1261")
1093 "UPDATE program SET description = '' WHERE description IS NULL;",
1094 "UPDATE record SET description = '' WHERE description IS NULL;",
1095 "UPDATE recorded SET description = '' WHERE description IS NULL;",
1096 "UPDATE recordedprogram SET description = '' WHERE description IS NULL;",
1097 "UPDATE oldrecorded SET description = '' WHERE description IS NULL;",
1098 "UPDATE mythlog SET details = '' WHERE details IS NULL;",
1099 "UPDATE settings SET data = '' WHERE data IS NULL;",
1100 "UPDATE powerpriority SET selectclause = '' WHERE selectclause IS NULL;",
1101 "UPDATE customexample SET fromclause = '' WHERE fromclause IS NULL;",
1102 "UPDATE customexample SET whereclause = '' WHERE whereclause IS NULL;",
1104 "ALTER TABLE program MODIFY COLUMN description VARCHAR(16000) "
1105 " NOT NULL default '';",
1106 "ALTER TABLE record MODIFY COLUMN description VARCHAR(16000) "
1107 " NOT NULL default '';",
1108 "ALTER TABLE recorded MODIFY COLUMN description VARCHAR(16000) "
1109 " NOT NULL default '';",
1110 "ALTER TABLE recordedprogram MODIFY COLUMN description VARCHAR(16000) "
1111 " NOT NULL default '';",
1112 "ALTER TABLE oldrecorded MODIFY COLUMN description VARCHAR(16000) "
1113 " NOT NULL default '';",
1114 "ALTER TABLE mythlog MODIFY COLUMN details VARCHAR(16000) "
1115 " NOT NULL default '';",
1116 "ALTER TABLE settings MODIFY COLUMN data VARCHAR(16000) "
1117 " NOT NULL default '';",
1118 "ALTER TABLE powerpriority MODIFY COLUMN selectclause VARCHAR(16000) "
1119 " NOT NULL default '';",
1120 "ALTER TABLE customexample MODIFY COLUMN fromclause VARCHAR(10000) "
1121 " NOT NULL default '';",
1122 "ALTER TABLE customexample MODIFY COLUMN whereclause VARCHAR(10000) "
1123 " NOT NULL default '';"
1126 updates,
"1262", dbver))
1130 if (dbver ==
"1262")
1133 "INSERT INTO recgrouppassword (recgroup, password) SELECT 'All Programs',data FROM settings WHERE value='AllRecGroupPassword' LIMIT 1;",
1134 "DELETE FROM settings WHERE value='AllRecGroupPassword';"
1137 updates,
"1263", dbver))
1141 if (dbver ==
"1263")
1144 "UPDATE settings SET hostname = NULL WHERE value='ISO639Language0' AND data != 'aar' AND hostname IS NOT NULL LIMIT 1;",
1145 "UPDATE settings SET hostname = NULL WHERE value='ISO639Language1' AND data != 'aar' AND hostname IS NOT NULL LIMIT 1;",
1146 "DELETE FROM settings WHERE value='ISO639Language0' AND hostname IS NOT NULL;",
1147 "DELETE FROM settings WHERE value='ISO639Language1' AND hostname IS NOT NULL;"
1150 updates,
"1264", dbver))
1154 if (dbver ==
"1264")
1158 "DELETE FROM displayprofiles WHERE profilegroupid IN "
1159 " (SELECT profilegroupid FROM displayprofilegroups "
1160 " WHERE name IN ('CPU++', 'CPU+', 'CPU--'))",
1161 "DELETE FROM displayprofilegroups WHERE name IN ('CPU++', 'CPU+', 'CPU--')",
1162 "DELETE FROM settings WHERE value = 'DefaultVideoPlaybackProfile' "
1163 " AND data IN ('CPU++', 'CPU+', 'CPU--')",
1164 "UPDATE displayprofiles SET data = 'ffmpeg' WHERE data = 'libmpeg2'",
1165 "UPDATE displayprofiles SET data = 'ffmpeg' WHERE data = 'xvmc'",
1166 "UPDATE displayprofiles SET data = 'xv-blit' WHERE data = 'xvmc-blit'",
1167 "UPDATE displayprofiles SET data = 'softblend' WHERE data = 'ia44blend'"
1170 updates,
"1265", dbver))
1174 if (dbver ==
"1265")
1177 "ALTER TABLE dtv_multiplex MODIFY COLUMN updatetimestamp "
1178 " TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;",
1179 "ALTER TABLE dvdbookmark MODIFY COLUMN `timestamp` "
1180 " TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;",
1181 "ALTER TABLE jobqueue MODIFY COLUMN statustime "
1182 " TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;",
1183 "ALTER TABLE recorded MODIFY COLUMN lastmodified "
1184 " TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;"
1187 updates,
"1266", dbver))
1191 if (dbver ==
"1266")
1197 "DELETE FROM settings WHERE value = 'mythvideo.DBSchemaVer'"
1200 updates,
"1267", dbver))
1204 if (dbver ==
"1267")
1207 "ALTER TABLE channel MODIFY xmltvid VARCHAR(255) NOT NULL DEFAULT '';"
1210 updates,
"1268", dbver))
1214 if (dbver ==
"1268")
1218 "DELETE FROM keybindings WHERE action='PREVSOURCE' AND keylist='Ctrl+Y';"
1221 updates,
"1269", dbver))
1225 if (dbver ==
"1269")
1228 "DELETE FROM profilegroups WHERE id >= 15;",
1229 "DELETE FROM recordingprofiles WHERE profilegroup >= 15;",
1231 "INSERT INTO profilegroups SET id = '15', name = 'ASI Recorder (DVEO)',"
1232 " cardtype = 'ASI', is_default = 1;",
1233 "INSERT INTO recordingprofiles SET name = \"Default\", profilegroup = 15;",
1234 "INSERT INTO recordingprofiles SET name = \"Live TV\", profilegroup = 15;",
1235 "INSERT INTO recordingprofiles SET name = \"High Quality\", profilegroup = 15;",
1236 "INSERT INTO recordingprofiles SET name = \"Low Quality\", profilegroup = 15;",
1237 "INSERT INTO profilegroups SET id = '16', name = 'OCUR Recorder (CableLabs)',"
1238 " cardtype = 'OCUR', is_default = 1;",
1239 "INSERT INTO recordingprofiles SET name = \"Default\", profilegroup = 16;",
1240 "INSERT INTO recordingprofiles SET name = \"Live TV\", profilegroup = 16;",
1241 "INSERT INTO recordingprofiles SET name = \"High Quality\", profilegroup = 16;",
1242 "INSERT INTO recordingprofiles SET name = \"Low Quality\", profilegroup = 16;"
1245 updates,
"1270", dbver))
1249 if (dbver ==
"1270")
1252 "ALTER TABLE oldrecorded ADD future TINYINT(1) NOT NULL DEFAULT 0;",
1253 "UPDATE oldrecorded SET future=0;"
1256 updates,
"1271", dbver))
1260 if (dbver ==
"1271")
1263 "ALTER TABLE recordmatch MODIFY recordid INT UNSIGNED NOT NULL;",
1264 "ALTER TABLE recordmatch MODIFY chanid INT UNSIGNED NOT NULL;",
1265 "ALTER TABLE recordmatch MODIFY starttime DATETIME NOT NULL;",
1266 "ALTER TABLE recordmatch MODIFY manualid INT UNSIGNED NOT NULL;",
1267 "ALTER TABLE recordmatch ADD INDEX (starttime, chanid);",
1268 "ALTER TABLE oldrecorded MODIFY generic TINYINT(1) NOT NULL;",
1269 "ALTER TABLE oldrecorded ADD INDEX (future);",
1270 "ALTER TABLE oldrecorded ADD INDEX (starttime, chanid);"
1273 updates,
"1272", dbver))
1277 if (dbver ==
"1272")
1280 "DROP INDEX starttime ON recordmatch;",
1281 "DROP INDEX starttime ON oldrecorded;",
1282 "ALTER TABLE recordmatch ADD INDEX (chanid, starttime, manualid);",
1283 "ALTER TABLE oldrecorded ADD INDEX (chanid, starttime);"
1286 updates,
"1273", dbver))
1290 if (dbver ==
"1273")
1293 "ALTER TABLE internetcontent MODIFY COLUMN updated "
1294 " DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00';",
1295 "ALTER TABLE internetcontentarticles MODIFY COLUMN `date` "
1296 " DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00';"
1300 updates,
"1274", dbver))
1304 if (dbver ==
"1274")
1308 "UPDATE cardinput SET tunechan=NULL"
1309 " WHERE inputname='DVBInput' OR inputname='MPEG2TS';"
1310 "UPDATE dtv_multiplex SET symbolrate = NULL"
1311 " WHERE modulation LIKE 't%' OR modulation LIKE '%t';",
1312 "UPDATE dtv_multiplex"
1313 " SET bandwidth=SUBSTR(modulation,2,1)"
1314 " WHERE SUBSTR(modulation,3,3)='qam' OR"
1315 " SUBSTR(modulation,3,4)='qpsk';",
1316 "UPDATE dtv_multiplex"
1317 " SET bandwidth=SUBSTR(modulation,5,1)"
1318 " WHERE SUBSTR(modulation,1,4)='auto' AND"
1319 " LENGTH(modulation)=6;",
1320 "UPDATE dtv_multiplex SET modulation='auto'"
1321 " WHERE modulation LIKE 'auto%';",
1322 "UPDATE dtv_multiplex SET modulation='qam_16'"
1323 " WHERE modulation LIKE '%qam16%';",
1324 "UPDATE dtv_multiplex SET modulation='qam_32'"
1325 " WHERE modulation LIKE '%qam32%';",
1326 "UPDATE dtv_multiplex SET modulation='qam_64'"
1327 " WHERE modulation LIKE '%qam64%';",
1328 "UPDATE dtv_multiplex SET modulation='qam_128'"
1329 " WHERE modulation LIKE '%qam128%';",
1330 "UPDATE dtv_multiplex SET modulation='qam_256'"
1331 " WHERE modulation LIKE '%qam256%';"
1334 updates,
"1275", dbver))
1338 if (dbver ==
"1275")
1341 "DROP TABLE IF EXISTS `logging`;",
1342 "CREATE TABLE `logging` ( "
1343 " `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, "
1344 " `host` varchar(64) NOT NULL, "
1345 " `application` varchar(64) NOT NULL, "
1346 " `pid` int(11) NOT NULL, "
1347 " `thread` varchar(64) NOT NULL, "
1348 " `msgtime` datetime NOT NULL, "
1349 " `level` int(11) NOT NULL, "
1350 " `message` varchar(2048) NOT NULL, "
1351 " PRIMARY KEY (`id`), "
1352 " KEY `host` (`host`,`application`,`pid`,`msgtime`), "
1353 " KEY `msgtime` (`msgtime`), "
1354 " KEY `level` (`level`) "
1355 ") ENGINE=MyISAM DEFAULT CHARSET=utf8; "
1358 updates,
"1276", dbver))
1362 if (dbver ==
"1276")
1365 "ALTER TABLE record ADD COLUMN filter INT UNSIGNED NOT NULL DEFAULT 0;",
1366 "CREATE TABLE IF NOT EXISTS recordfilter ("
1367 " filterid INT UNSIGNED NOT NULL PRIMARY KEY,"
1368 " description VARCHAR(64) DEFAULT NULL,"
1369 " clause VARCHAR(256) DEFAULT NULL,"
1370 " newruledefault TINYINT(1) DEFAULT 0) ENGINE=MyISAM DEFAULT CHARSET=utf8;",
1372 "INSERT INTO recordfilter (filterid, description, clause, newruledefault) "
1373 " VALUES (0, 'New episode', 'program.previouslyshown = 0', 0);",
1374 "INSERT INTO recordfilter (filterid, description, clause, newruledefault) "
1375 " VALUES (1, 'Identifiable episode', 'program.generic = 0', 0);",
1376 "INSERT INTO recordfilter (filterid, description, clause, newruledefault) "
1377 " VALUES (2, 'First showing', 'program.first > 0', 0);",
1378 "INSERT INTO recordfilter (filterid, description, clause, newruledefault) "
1379 " VALUES (3, 'Primetime', 'HOUR(program.starttime) >= 19 AND HOUR(program.starttime) < 23', 0);",
1380 "INSERT INTO recordfilter (filterid, description, clause, newruledefault) "
1381 " VALUES (4, 'Commercial free', 'channel.commmethod = -2', 0);",
1382 "INSERT INTO recordfilter (filterid, description, clause, newruledefault) "
1383 " VALUES (5, 'High definition', 'program.hdtv > 0', 0);"
1387 updates,
"1277", dbver))
1391 if (dbver ==
"1277")
1395 "ALTER TABLE record ADD autometadata TINYINT(1) NOT NULL DEFAULT "
1396 " 0 AFTER autouserjob4;",
1397 "ALTER TABLE record ADD inetref VARCHAR(40) NOT NULL AFTER programid;",
1398 "ALTER TABLE record ADD season SMALLINT(5) NOT NULL AFTER description;",
1399 "ALTER TABLE record ADD episode SMALLINT(5) NOT NULL AFTER season;",
1400 "ALTER TABLE recorded ADD inetref VARCHAR(40) NOT NULL AFTER programid;",
1401 "ALTER TABLE recorded ADD season SMALLINT(5) NOT NULL AFTER description;",
1402 "ALTER TABLE recorded ADD episode SMALLINT(5) NOT NULL AFTER season;",
1403 "ALTER TABLE oldrecorded ADD inetref VARCHAR(40) NOT NULL AFTER programid;",
1404 "ALTER TABLE oldrecorded ADD season SMALLINT(5) NOT NULL AFTER description;",
1405 "ALTER TABLE oldrecorded ADD episode SMALLINT(5) NOT NULL AFTER season;"
1408 updates,
"1278", dbver))
1412 if (dbver ==
"1278")
1415 "CREATE TABLE recordedartwork ( "
1416 " inetref VARCHAR(255) NOT NULL, "
1417 " season SMALLINT(5) NOT NULL, "
1418 " host TEXT NOT NULL, "
1419 " coverart TEXT NOT NULL, "
1420 " fanart TEXT NOT NULL, "
1421 " banner TEXT NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8;"
1424 updates,
"1279", dbver))
1428 if (dbver ==
"1279")
1430 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1280");
1434 select.
prepare(
"SELECT hostname, data FROM settings "
1435 " WHERE value = 'NoPromptOnExit'");
1443 while (select.
next())
1447 QString prompt_on_exit = select.
value(1).toString();
1449 update.
prepare(
"DELETE FROM keybindings "
1450 " WHERE action = 'EXITPROMPT' "
1451 " AND context = 'Main Menu' "
1452 " AND hostname = :HOSTNAME ;");
1458 if (
"0" == prompt_on_exit)
1462 update.
prepare(
"INSERT INTO keybindings (context, action, "
1463 " description, keylist, hostname) "
1464 "VALUES ('Main Menu', 'EXITPROMPT', '', "
1465 " '', :HOSTNAME );");
1474 update.
prepare(
"UPDATE keybindings "
1475 " SET action = 'EXITPROMPT' "
1476 " WHERE action = 'EXIT' "
1477 " AND context = 'Main Menu' "
1478 " AND hostname = :HOSTNAME ;");
1491 if (dbver ==
"1280")
1494 "ALTER TABLE program ADD INDEX (subtitle);",
1495 "ALTER TABLE program ADD INDEX (description(255));",
1496 "ALTER TABLE oldrecorded ADD INDEX (subtitle);",
1497 "ALTER TABLE oldrecorded ADD INDEX (description(255));"
1500 updates,
"1281", dbver))
1504 if (dbver ==
"1281")
1507 "ALTER TABLE cardinput ADD changer_device VARCHAR(128) "
1508 "AFTER externalcommand;",
1509 "ALTER TABLE cardinput ADD changer_model VARCHAR(128) "
1510 "AFTER changer_device;"
1513 updates,
"1282", dbver))
1517 if (dbver ==
"1282")
1521 " SET data = SUBSTR(data, INSTR(data, 'share/mythtv/metadata')+13)"
1523 " IN ('TelevisionGrabber', "
1525 " 'mythgame.MetadataGrabber');"
1529 updates,
"1283", dbver))
1533 if (dbver ==
"1283")
1536 "UPDATE record SET filter = filter | 1 WHERE record.dupin & 0x20",
1537 "UPDATE record SET filter = filter | 2 WHERE record.dupin & 0x40",
1538 "UPDATE record SET filter = filter | 5 WHERE record.dupin & 0x80",
1539 "UPDATE record SET dupin = dupin & ~0xe0",
1541 "INSERT INTO recordfilter (filterid, description, clause, newruledefault) "
1542 " VALUES (6, 'This Episode', '(program.programid <> '''' AND program.programid = RECTABLE.programid) OR (program.programid = '''' AND program.subtitle = RECTABLE.subtitle AND program.description = RECTABLE.description)', 0);"
1546 updates,
"1284", dbver))
1550 if (dbver ==
"1284")
1553 "REPLACE INTO recordfilter (filterid, description, clause, newruledefault) "
1554 " VALUES (6, 'This Episode', '(RECTABLE.programid <> '''' AND program.programid = RECTABLE.programid) OR (RECTABLE.programid = '''' AND program.subtitle = RECTABLE.subtitle AND program.description = RECTABLE.description)', 0);"
1558 updates,
"1285", dbver))
1562 if (dbver ==
"1285")
1565 "DELETE FROM profilegroups WHERE id >= 17;",
1566 "DELETE FROM recordingprofiles WHERE profilegroup >= 17;",
1568 "INSERT INTO profilegroups SET id = '17', name = 'Ceton Recorder',"
1569 " cardtype = 'CETON', is_default = 1;",
1570 "INSERT INTO recordingprofiles SET name = \"Default\", profilegroup = 17;",
1571 "INSERT INTO recordingprofiles SET name = \"Live TV\", profilegroup = 17;",
1572 "INSERT INTO recordingprofiles SET name = \"High Quality\", profilegroup = 17;",
1573 "INSERT INTO recordingprofiles SET name = \"Low Quality\", profilegroup = 17;"
1576 updates,
"1286", dbver))
1580 if (dbver ==
"1286")
1582 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1287");
1584 query.
prepare(
"SELECT cardid, videodevice "
1586 "WHERE cardtype='CETON'");
1589 LOG(VB_GENERAL, LOG_ERR,
1590 "Unable to query capturecard table for upgrade to 1287.");
1595 update.
prepare(
"UPDATE capturecard SET videodevice=:VIDDEV "
1596 "WHERE cardid=:CARDID");
1597 while (query.
next())
1600 QString videodevice = query.
value(1).toString();
1601 QStringList parts = videodevice.split(
"-");
1602 if (parts.size() != 2)
1604 LOG(VB_GENERAL, LOG_ERR,
1605 "Unable to parse videodevice in upgrade to 1287.");
1608 if (parts[1].contains(
"."))
1611 int input = std::max(parts[1].toInt() - 1, 0);
1612 videodevice = parts[0] + QString(
"-0.%1").arg(input);
1614 update.
bindValue(
":VIDDEV", videodevice);
1617 LOG(VB_GENERAL, LOG_ERR,
1618 "Failed to update videodevice in upgrade to 1287.");
1627 if (dbver ==
"1287")
1630 "CREATE TABLE IF NOT EXISTS livestream ( "
1631 " id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, "
1632 " width INT UNSIGNED NOT NULL, "
1633 " height INT UNSIGNED NOT NULL, "
1634 " bitrate INT UNSIGNED NOT NULL, "
1635 " audiobitrate INT UNSIGNED NOT NULL, "
1636 " samplerate INT UNSIGNED NOT NULL, "
1637 " audioonlybitrate INT UNSIGNED NOT NULL, "
1638 " segmentsize INT UNSIGNED NOT NULL DEFAULT 10, "
1639 " maxsegments INT UNSIGNED NOT NULL DEFAULT 0, "
1640 " startsegment INT UNSIGNED NOT NULL DEFAULT 0, "
1641 " currentsegment INT UNSIGNED NOT NULL DEFAULT 0, "
1642 " segmentcount INT UNSIGNED NOT NULL DEFAULT 0, "
1643 " percentcomplete INT UNSIGNED NOT NULL DEFAULT 0, "
1644 " created DATETIME NOT NULL, "
1645 " lastmodified DATETIME NOT NULL, "
1646 " relativeurl VARCHAR(512) NOT NULL, "
1647 " fullurl VARCHAR(1024) NOT NULL, "
1648 " status INT UNSIGNED NOT NULL DEFAULT 0, "
1649 " statusmessage VARCHAR(256) NOT NULL, "
1650 " sourcefile VARCHAR(512) NOT NULL, "
1651 " sourcehost VARCHAR(64) NOT NULL, "
1652 " sourcewidth INT UNSIGNED NOT NULL DEFAULT 0, "
1653 " sourceheight INT UNSIGNED NOT NULL DEFAULT 0, "
1654 " outdir VARCHAR(256) NOT NULL, "
1655 " outbase VARCHAR(128) NOT NULL "
1656 ") ENGINE=MyISAM DEFAULT CHARSET=utf8; "
1660 updates,
"1288", dbver))
1664 if (dbver ==
"1288")
1667 "ALTER TABLE recordedprogram CHANGE COLUMN videoprop videoprop "
1668 " SET('HDTV', 'WIDESCREEN', 'AVC', '720', '1080', 'DAMAGED') NOT NULL; "
1671 updates,
"1289", dbver))
1675 if (dbver ==
"1289")
1678 "DROP TABLE IF EXISTS netvisionrssitems;",
1679 "DROP TABLE IF EXISTS netvisionsearchgrabbers;",
1680 "DROP TABLE IF EXISTS netvisionsites;",
1681 "DROP TABLE IF EXISTS netvisiontreegrabbers;",
1682 "DROP TABLE IF EXISTS netvisiontreeitems;"
1686 updates,
"1290", dbver))
1690 if (dbver ==
"1290")
1693 "ALTER TABLE logging "
1694 " ALTER COLUMN host SET DEFAULT '', "
1695 " ALTER COLUMN application SET DEFAULT '', "
1696 " ALTER COLUMN pid SET DEFAULT '0', "
1697 " ALTER COLUMN thread SET DEFAULT '', "
1698 " ALTER COLUMN level SET DEFAULT '0';",
1699 "ALTER TABLE logging "
1700 " ADD COLUMN tid INT(11) NOT NULL DEFAULT '0' AFTER pid, "
1701 " ADD COLUMN filename VARCHAR(255) NOT NULL DEFAULT '' AFTER thread, "
1702 " ADD COLUMN line INT(11) NOT NULL DEFAULT '0' AFTER filename, "
1703 " ADD COLUMN `function` VARCHAR(255) NOT NULL DEFAULT '' AFTER line;"
1707 updates,
"1291", dbver))
1711 if (dbver ==
"1291")
1714 "UPDATE recorded r, recordedprogram rp SET r.duplicate=0 "
1715 " WHERE r.chanid=rp.chanid AND r.progstart=rp.starttime AND "
1716 " FIND_IN_SET('DAMAGED', rp.videoprop);"
1720 updates,
"1292", dbver))
1724 if (dbver ==
"1292")
1727 "ALTER TABLE cardinput "
1728 " ADD COLUMN schedorder INT(10) UNSIGNED NOT NULL DEFAULT '0', "
1729 " ADD COLUMN livetvorder INT(10) UNSIGNED NOT NULL DEFAULT '0';",
1730 "UPDATE cardinput SET schedorder = cardinputid;",
1731 "UPDATE cardinput SET livetvorder = cardid;"
1737 "UPDATE cardinput SET livetvorder = "
1738 " (SELECT MAX(cardid) FROM capturecard) - cardid + 1;";
1742 updates,
"1293", dbver))
1746 if (dbver ==
"1293")
1749 "TRUNCATE TABLE recordmatch",
1750 "ALTER TABLE recordmatch DROP INDEX recordid",
1751 "ALTER TABLE recordmatch ADD UNIQUE INDEX (recordid, chanid, starttime)",
1752 "UPDATE recordfilter SET description='Prime time' WHERE filterid=3",
1753 "UPDATE recordfilter SET description='This episode' WHERE filterid=6",
1755 "REPLACE INTO recordfilter (filterid, description, clause, newruledefault) "
1756 " VALUES (7, 'This series', '(RECTABLE.seriesid <> '''' AND program.seriesid = RECTABLE.seriesid)', 0);"
1760 updates,
"1294", dbver))
1764 if (dbver ==
"1294")
1767 "CREATE TABLE videocollection ("
1768 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
1769 " title varchar(256) NOT NULL,"
1770 " contenttype set('MOVIE', 'TELEVISION', 'ADULT', 'MUSICVIDEO', 'HOMEVIDEO') NOT NULL default '',"
1772 " network varchar(128) DEFAULT NULL,"
1773 " inetref varchar(128) NOT NULL,"
1774 " certification varchar(128) DEFAULT NULL,"
1775 " genre int(10) unsigned DEFAULT '0',"
1776 " releasedate date DEFAULT NULL,"
1777 " language varchar(10) DEFAULT NULL,"
1778 " status varchar(64) DEFAULT NULL,"
1779 " rating float DEFAULT 0,"
1780 " ratingcount int(10) DEFAULT 0,"
1781 " runtime smallint(5) unsigned DEFAULT '0',"
1785 " PRIMARY KEY (intid),"
1786 " KEY title (title)"
1787 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
1788 "CREATE TABLE videopathinfo ("
1789 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
1791 " contenttype set('MOVIE', 'TELEVISION', 'ADULT', 'MUSICVIDEO', 'HOMEVIDEO') NOT NULL default '',"
1792 " collectionref int(10) default '0',"
1793 " recurse tinyint(1) default '0',"
1794 " PRIMARY KEY (intid)"
1795 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
1796 "ALTER TABLE videometadata ADD collectionref int(10) NOT NULL DEFAULT '0' AFTER inetref;",
1797 "ALTER TABLE videometadata ADD playcount int(10) NOT NULL DEFAULT '0' AFTER length;",
1798 "ALTER TABLE videometadata ADD contenttype set('MOVIE', 'TELEVISION', 'ADULT', 'MUSICVIDEO', 'HOMEVIDEO') NOT NULL default ''",
1799 "UPDATE videometadata SET contenttype = 'MOVIE';",
1800 "UPDATE videometadata SET contenttype = 'TELEVISION' WHERE season > 0 OR episode > 0;"
1804 updates,
"1295", dbver))
1808 if (dbver ==
"1295")
1810 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1296");
1812 query.
prepare(
"SELECT data, hostname "
1814 "WHERE value='BackendServerIP'");
1817 LOG(VB_GENERAL, LOG_ERR,
1818 "Unable to repair IP addresses for IPv4/IPv6 split.");
1824 update.
prepare(
"UPDATE settings "
1825 "SET data=:IP4ADDY "
1826 "WHERE value='BackendServerIP' "
1827 "AND hostname=:HOSTNAME");
1828 insert.
prepare(
"INSERT INTO settings "
1829 "SET value='BackendServerIP6',"
1831 "hostname=:HOSTNAME");
1832 while (query.
next())
1834 QHostAddress oldaddr(query.
value(0).toString());
1840 if (oldaddr.protocol() == QAbstractSocket::IPv6Protocol)
1842 update.
bindValue(
":IP4ADDY",
"127.0.0.1");
1845 else if (oldaddr.protocol() == QAbstractSocket::IPv4Protocol)
1852 update.
bindValue(
":IP4ADDY",
"127.0.0.1");
1854 LOG(VB_GENERAL, LOG_CRIT,
1855 QString(
"Invalid address string '%1' found on %2. "
1856 "Reverting to localhost defaults.")
1860 if (!update.
exec() || !insert.
exec())
1862 LOG(VB_GENERAL, LOG_ERR, QString(
"Failed to separate IPv4 "
1863 "and IPv6 addresses for %1").arg(
hostname));
1873 if (dbver ==
"1296")
1876 "ALTER TABLE videocollection CHANGE inetref collectionref "
1877 "VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci "
1879 "ALTER TABLE videocollection CHANGE genre genre VARCHAR(128) NULL DEFAULT ''"
1883 updates,
"1297", dbver))
1887 if (dbver ==
"1297")
1890 "ALTER TABLE videometadata CHANGE collectionref collectionref INT(10) "
1891 "NOT NULL DEFAULT -1",
1892 "UPDATE videometadata SET collectionref = '-1'"
1896 updates,
"1298", dbver))
1900 if (dbver ==
"1298")
1902 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1299");
1915 queryStr =
"UPDATE settings SET data='-1' WHERE "
1916 "value='DeletedMaxAge' AND data='0'";
1920 queryStr =
"UPDATE settings SET data='0' WHERE "
1921 "value='DeletedMaxAge'";
1936 if (dbver ==
"1299")
1939 "ALTER TABLE recordmatch ADD COLUMN findid INT NOT NULL DEFAULT 0",
1940 "ALTER TABLE recordmatch ADD INDEX (recordid, findid)"
1944 updates,
"1300", dbver))
1948 if (dbver ==
"1300")
1951 "ALTER TABLE channel ADD COLUMN iptvid SMALLINT(6) UNSIGNED;",
1952 "CREATE TABLE iptv_channel ("
1953 " iptvid SMALLINT(6) UNSIGNED NOT NULL auto_increment,"
1954 " chanid INT(10) UNSIGNED NOT NULL,"
1955 " url TEXT NOT NULL,"
1956 " type set('data', "
1957 " 'rfc2733-1','rfc2733-2', "
1958 " 'rfc5109-1','rfc5109-2', "
1959 " 'smpte2022-1','smpte2022-2'),"
1960 " bitrate INT(10) UNSIGNED NOT NULL,"
1961 " PRIMARY KEY (iptvid)"
1962 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;"
1966 updates,
"1301", dbver))
1970 if (dbver ==
"1301")
1972 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1302");
2012 if (dbver ==
"1302")
2014 QDateTime loc = QDateTime::currentDateTime();
2015 QDateTime utc = loc.toUTC();
2016 loc = QDateTime(loc.date(), loc.time(), Qt::UTC);
2017 int utc_offset = loc.secsTo(utc) / 60;
2019 QList<QByteArray> updates_ba;
2022 const std::array<const std::string,2> pre_sql {
2023 "CREATE TEMPORARY TABLE recordupdate ("
2024 "recid INT, starttime DATETIME, endtime DATETIME)",
2025 "INSERT INTO recordupdate (recid, starttime, endtime) "
2027 " CONCAT(startdate, ' ', starttime), "
2028 " CONCAT(enddate, ' ', endtime) FROM record",
2030 std::transform(pre_sql.cbegin(), pre_sql.cend(),
2031 std::back_inserter(updates_ba), ss2ba);
2034 if (0 != utc_offset)
2036 const std::array<const std::string,4> with_endtime {
2037 "program",
"recorded",
"oldrecorded",
"recordupdate",
2039 const std::array<const std::string,4> without_endtime {
2040 "programgenres",
"programrating",
"credits",
2043 order = (utc_offset > 0) ?
"-starttime" :
"starttime";
2044 std::transform(with_endtime.cbegin(), with_endtime.cend(),
2045 std::back_inserter(updates_ba), add_start_end);
2046 std::transform(without_endtime.cbegin(), without_endtime.cend(),
2047 std::back_inserter(updates_ba), add_start);
2049 updates_ba.push_back(
2050 QString(
"UPDATE oldprogram "
2052 " CONVERT_TZ(airdate, 'SYSTEM', 'Etc/UTC') "
2054 .arg((utc_offset > 0) ?
"-airdate" :
2055 "airdate").toLocal8Bit());
2057 updates_ba.push_back(
2058 QString(
"UPDATE recorded "
2060 " CONVERT_TZ(progstart, 'SYSTEM', 'Etc/UTC'), "
2062 " CONVERT_TZ(progend, 'SYSTEM', 'Etc/UTC') ")
2067 const std::array<const std::string,2> post_sql {
2068 "UPDATE record, recordupdate "
2069 "SET record.startdate = DATE(recordupdate.starttime), "
2070 " record.starttime = TIME(recordupdate.starttime), "
2071 " record.enddate = DATE(recordupdate.endtime), "
2072 " record.endtime = TIME(recordupdate.endtime), "
2073 " record.last_record = "
2074 " CONVERT_TZ(last_record, 'SYSTEM', 'Etc/UTC'), "
2075 " record.last_delete = "
2076 " CONVERT_TZ(last_delete, 'SYSTEM', 'Etc/UTC') "
2077 "WHERE recordid = recid",
2078 "DROP TABLE recordupdate",
2081 std::transform(post_sql.cbegin(), post_sql.cend(),
2082 std::back_inserter(updates_ba), ss2ba);
2086 std::transform(updates_ba.cbegin(), updates_ba.cend(),
2087 std::back_inserter(updates), qs2ba);
2091 updates,
"1303", dbver))
2095 if (dbver ==
"1303")
2097 QDateTime loc = QDateTime::currentDateTime();
2098 QDateTime utc = loc.toUTC();
2099 loc = QDateTime(loc.date(), loc.time(), Qt::UTC);
2100 int utc_offset = loc.secsTo(utc) / 60;
2102 QList<QByteArray> updates_ba;
2105 if (0 != utc_offset)
2107 const std::array<const std::string,1> with_endtime = {
2110 const std::array<const std::string,4> without_endtime = {
2111 "recordedseek",
"recordedmarkup",
"recordedrating",
2114 order = (utc_offset > 0) ?
"-starttime" :
"starttime";
2115 std::transform(with_endtime.cbegin(), with_endtime.cend(),
2116 std::back_inserter(updates_ba), add_start_end);
2117 std::transform(without_endtime.cbegin(), without_endtime.cend(),
2118 std::back_inserter(updates_ba), add_start);
2123 std::transform(updates_ba.cbegin(), updates_ba.cend(),
2124 std::back_inserter(updates), qs2ba);
2128 updates,
"1304", dbver))
2132 if (dbver ==
"1304")
2134 QList<QByteArray> updates_ba;
2136 updates_ba.push_back(
2137 "UPDATE recordfilter SET clause="
2138 "'HOUR(CONVERT_TZ(program.starttime, ''Etc/UTC'', ''SYSTEM'')) >= 19 AND "
2139 "HOUR(CONVERT_TZ(program.starttime, ''Etc/UTC'', ''SYSTEM'')) < 22' "
2140 "WHERE filterid=3");
2142 updates_ba.push_back(QString(
2143 "UPDATE record SET findday = "
2144 " DAYOFWEEK(CONVERT_TZ(ADDTIME('2012-06-02 00:00:00', findtime), "
2145 " 'SYSTEM', 'Etc/UTC') + INTERVAL findday DAY) "
2146 "WHERE findday > 0").toLocal8Bit());
2148 updates_ba.push_back(QString(
2149 "UPDATE record SET findtime = "
2150 " TIME(CONVERT_TZ(ADDTIME('2012-06-02 00:00:00', findtime), "
2151 " 'SYSTEM', 'Etc/UTC')) ")
2156 std::transform(updates_ba.cbegin(), updates_ba.cend(),
2157 std::back_inserter(updates), qs2ba);
2160 updates,
"1305", dbver))
2164 if (dbver ==
"1305")
2169 QList<QByteArray> updates_ba;
2171 updates_ba.push_back(QString(
2172 "UPDATE record SET findday = "
2173 " DAYOFWEEK(CONVERT_TZ(ADDTIME('2012-06-02 00:00:00', findtime), "
2174 " 'Etc/UTC', 'SYSTEM') + INTERVAL findday DAY) "
2175 "WHERE findday > 0").toLocal8Bit());
2177 updates_ba.push_back(QString(
2178 "UPDATE record SET findtime = "
2179 " TIME(CONVERT_TZ(ADDTIME('2012-06-02 00:00:00', findtime), "
2180 " 'Etc/UTC', 'SYSTEM')) ").toLocal8Bit());
2184 std::transform(updates_ba.cbegin(), updates_ba.cend(),
2185 std::back_inserter(updates), qs2ba);
2188 updates,
"1306", dbver))
2192 if (dbver ==
"1306")
2198 "CREATE TABLE scannerfile ("
2199 " `fileid` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,"
2200 " `filesize` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,"
2201 " `filehash` VARCHAR(64) NOT NULL DEFAULT '',"
2202 " `added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,"
2203 " PRIMARY KEY (`fileid`),"
2204 " UNIQUE KEY filehash (`filehash`)"
2205 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
2206 "CREATE TABLE scannerpath ("
2207 " `fileid` BIGINT(20) UNSIGNED NOT NULL,"
2208 " `hostname` VARCHAR(64) NOT NULL DEFAULT 'localhost',"
2209 " `storagegroup` VARCHAR(32) NOT NULL DEFAULT 'Default',"
2210 " `filename` VARCHAR(255) NOT NULL DEFAULT '',"
2211 " PRIMARY KEY (`fileid`)"
2212 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
2213 "CREATE TABLE videopart ("
2214 " `fileid` BIGINT(20) UNSIGNED NOT NULL,"
2215 " `videoid` INT(10) UNSIGNED NOT NULL,"
2216 " `order` SMALLINT UNSIGNED NOT NULL DEFAULT 1,"
2217 " PRIMARY KEY `part` (`videoid`, `order`)"
2218 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;"
2225 updates,
"1307", dbver))
2229 if (dbver ==
"1307")
2232 "ALTER TABLE channel MODIFY COLUMN icon varchar(255) NOT NULL DEFAULT '';",
2233 "UPDATE channel SET icon='' WHERE icon='none';"
2236 updates,
"1308", dbver))
2240 if (dbver ==
"1308")
2245 "REPLACE INTO recordfilter (filterid, description, clause, newruledefault) "
2246 " VALUES (8, 'This time', 'ABS(TIMESTAMPDIFF(MINUTE, CONVERT_TZ("
2247 " ADDTIME(RECTABLE.startdate, RECTABLE.starttime), ''Etc/UTC'', ''SYSTEM''), "
2248 " CONVERT_TZ(program.starttime, ''Etc/UTC'', ''SYSTEM''))) MOD 1440 <= 10', 0)",
2250 "REPLACE INTO recordfilter (filterid, description, clause, newruledefault) "
2251 " VALUES (9, 'This day and time', 'ABS(TIMESTAMPDIFF(MINUTE, CONVERT_TZ("
2252 " ADDTIME(RECTABLE.startdate, RECTABLE.starttime), ''Etc/UTC'', ''SYSTEM''), "
2253 " CONVERT_TZ(program.starttime, ''Etc/UTC'', ''SYSTEM''))) MOD 10080 <= 10', 0)",
2255 "UPDATE record SET type = 3, filter = filter|256 "
2256 " WHERE type = 2 AND search = 0",
2258 "UPDATE record SET type = 3, filter = filter|512 "
2259 " WHERE type = 5 AND search = 0",
2261 "UPDATE record SET type = 2, search = 1, chanid = 0, station = '', "
2262 " subtitle = '', description = CONCAT('program.title = ''', "
2263 " REPLACE(title, '''', ''''''), ''''), "
2264 " title = CONCAT(title, ' (Power Search)') WHERE type = 9 AND search = 0",
2266 "UPDATE record SET type = 5, search = 1, chanid = 0, station = '', "
2267 " subtitle = '', description = CONCAT('program.title = ''', "
2268 " REPLACE(title, '''', ''''''), ''''), "
2269 " title = CONCAT(title, ' (Power Search)') WHERE type = 10 AND search = 0",
2271 "UPDATE record SET type = 2 WHERE type = 9",
2273 "UPDATE record SET type = 5 WHERE type = 10"
2276 updates,
"1309", dbver))
2280 if (dbver ==
"1309")
2284 "REPLACE INTO recordfilter (filterid, description, clause, newruledefault) "
2285 " VALUES (10, 'This channel', 'channel.callsign = RECTABLE.station', 0)",
2287 "UPDATE record SET type = 4, filter = filter|1024 WHERE type = 3"
2290 updates,
"1310", dbver))
2294 if (dbver ==
"1310")
2298 "RENAME TABLE `housekeeping` TO `oldhousekeeping`;",
2300 "CREATE TABLE `housekeeping` ("
2301 " `tag` VARCHAR(64) NOT NULL,"
2302 " `hostname` VARCHAR(64),"
2303 " `lastrun` DATETIME,"
2304 " UNIQUE KEY `task` (`tag`, `hostname`)"
2305 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
2307 "INSERT INTO `housekeeping` (`tag`, `hostname`, `lastrun`)"
2308 " SELECT SUBSTRING_INDEX(`tag`, '-', 1) AS `tag`,"
2309 " IF(LOCATE('-', `tag`) > 0,"
2310 " SUBSTRING(`tag` FROM LENGTH(SUBSTRING_INDEX(`tag`, '-', 1)) +2),"
2311 " NULL) AS `hostname`,"
2313 " FROM `oldhousekeeping`;",
2315 "DROP TABLE `oldhousekeeping`;"
2319 updates,
"1311", dbver))
2323 if (dbver ==
"1311")
2328 "INSERT INTO `settings` (`value`, `hostname`, `data`)"
2329 " SELECT 'HardwareProfileEnabled',"
2331 " IF((SELECT COUNT(1)"
2333 " WHERE `value` = 'HardwareProfileLastUpdated' > 0),"
2336 "INSERT INTO `housekeeping` (`tag`, `hostname`, `lastrun`)"
2337 " SELECT 'HardwareProfiler',"
2341 " WHERE `value` = 'HardwareProfileLastUpdated';",
2343 "DELETE FROM `settings` WHERE `value` = 'HardwareProfileLastUpdated';"
2346 updates,
"1312", dbver))
2350 if (dbver ==
"1312")
2354 "DELETE FROM `dvdbookmark` WHERE `framenum` = 0;",
2355 "ALTER TABLE dvdbookmark ADD COLUMN dvdstate varchar(1024) NOT NULL DEFAULT '';"
2358 updates,
"1313", dbver))
2362 if (dbver ==
"1313")
2368 "UPDATE capturecard SET channel_timeout = 3000 WHERE "
2369 "cardtype = \"DVB\" AND channel_timeout < 3000;",
2370 "UPDATE capturecard SET channel_timeout = 30000 WHERE "
2371 "cardtype = \"FREEBOX\" AND channel_timeout < 30000;",
2372 "UPDATE capturecard SET channel_timeout = 9000 WHERE "
2373 "cardtype = \"FIREWIRE\" AND channel_timeout < 9000;",
2374 "UPDATE capturecard SET channel_timeout = 3000 WHERE "
2375 "cardtype = \"HDHOMERUN\" AND channel_timeout < 3000;",
2376 "UPDATE capturecard SET channel_timeout = 15000 WHERE "
2377 "cardtype = \"HDPVR\" AND channel_timeout < 15000;",
2378 "UPDATE capturecard SET channel_timeout = 12000 WHERE "
2379 "cardtype = \"MPEG\" AND channel_timeout < 12000;"
2382 updates,
"1314", dbver))
2386 if (dbver ==
"1314")
2391 "UPDATE settings SET data=REPLACE(data, 'tmdb.py', 'tmdb3.py') "
2392 "WHERE value='MovieGrabber'"
2395 updates,
"1315", dbver))
2399 if (dbver ==
"1315")
2402 "ALTER TABLE program ADD INDEX title_subtitle_start (title, subtitle, starttime);",
2403 "ALTER TABLE program DROP INDEX title;"
2406 updates,
"1316", dbver))
2410 if (dbver ==
"1316")
2414 "ALTER TABLE oldrecorded CHANGE COLUMN programid programid varchar(64);",
2415 "ALTER TABLE oldrecorded CHANGE COLUMN seriesid seriesid varchar(64);",
2416 "ALTER TABLE record CHANGE COLUMN programid programid varchar(64);",
2417 "ALTER TABLE record CHANGE COLUMN seriesid seriesid varchar(64);",
2418 "ALTER TABLE recorded CHANGE COLUMN programid programid varchar(64);",
2419 "ALTER TABLE recorded CHANGE COLUMN seriesid seriesid varchar(64);",
2420 "ALTER TABLE recordedprogram CHANGE COLUMN programid programid varchar(64);",
2421 "ALTER TABLE recordedprogram CHANGE COLUMN seriesid seriesid varchar(64);"
2424 updates,
"1317", dbver))
2428 if (dbver ==
"1317")
2431 "CREATE TABLE IF NOT EXISTS gallery_directories ("
2432 " dir_id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,"
2433 " filename VARCHAR(255) NOT NULL,"
2434 " name VARCHAR(255) NOT NULL,"
2435 " path VARCHAR(255) NOT NULL,"
2436 " parent_id INT(11) NOT NULL,"
2437 " dir_count INT(11) NOT NULL DEFAULT '0',"
2438 " file_count INT(11) NOT NULL DEFAULT '0',"
2439 " hidden TINYINT(1) NOT NULL DEFAULT '0'"
2440 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
2441 "CREATE TABLE IF NOT EXISTS gallery_files ("
2442 " file_id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,"
2443 " filename VARCHAR(255) NOT NULL,"
2444 " name VARCHAR(255) NOT NULL,"
2445 " path VARCHAR(255) NOT NULL,"
2446 " dir_id INT(11) NOT NULL DEFAULT '0',"
2447 " type INT(11) NOT NULL DEFAULT '0',"
2448 " modtime INT(11) NOT NULL DEFAULT '0',"
2449 " size INT(11) NOT NULL DEFAULT '0',"
2450 " extension VARCHAR(255) NOT NULL,"
2451 " angle INT(11) NOT NULL DEFAULT '0',"
2452 " date INT(11) NOT NULL DEFAULT '0',"
2453 " zoom INT(11) NOT NULL DEFAULT '0',"
2454 " hidden TINYINT(1) NOT NULL DEFAULT '0',"
2455 " orientation INT(11) NOT NULL DEFAULT '0'"
2456 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
2457 "INSERT INTO settings VALUES ('ImageStorageGroupName', 'Images', NULL);",
2458 "INSERT INTO settings VALUES ('ImageSortOrder', 0, NULL);",
2459 "INSERT INTO settings VALUES ('ImageShowHiddenFiles', 0, NULL);",
2460 "INSERT INTO settings VALUES ('ImageSlideShowTime', 3500, NULL);",
2461 "INSERT INTO settings VALUES ('ImageTransitionType', 1, NULL);",
2462 "INSERT INTO settings VALUES ('ImageTransitionTime', 1000, NULL);"
2466 updates,
"1318", dbver))
2470 if (dbver ==
"1318")
2473 "ALTER TABLE program "
2474 " ADD COLUMN season INT(4) NOT NULL DEFAULT '0', "
2475 " ADD COLUMN episode INT(4) NOT NULL DEFAULT '0';",
2476 "ALTER TABLE recordedprogram "
2477 " ADD COLUMN season INT(4) NOT NULL DEFAULT '0', "
2478 " ADD COLUMN episode INT(4) NOT NULL DEFAULT '0';"
2482 updates,
"1319", dbver))
2486 if (dbver ==
"1319")
2490 "ALTER TABLE program "
2491 " ADD COLUMN totalepisodes INT(4) NOT NULL DEFAULT '0';",
2492 "ALTER TABLE recordedprogram "
2493 " ADD COLUMN totalepisodes INT(4) NOT NULL DEFAULT '0';"
2497 updates,
"1320", dbver))
2501 if (dbver ==
"1320")
2504 "CREATE TABLE IF NOT EXISTS recgroups ("
2505 "recgroupid SMALLINT(4) NOT NULL AUTO_INCREMENT, "
2506 "recgroup VARCHAR(64) NOT NULL DEFAULT '', "
2507 "displayname VARCHAR(64) NOT NULL DEFAULT '', "
2508 "password VARCHAR(40) NOT NULL DEFAULT '', "
2509 "special TINYINT(1) NOT NULL DEFAULT '0',"
2510 "PRIMARY KEY (recgroupid), "
2511 "UNIQUE KEY recgroup ( recgroup )"
2512 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
2514 "INSERT INTO recgroups ( recgroupid, recgroup, special ) VALUES ( 1, 'Default', '1' );",
2515 "INSERT INTO recgroups ( recgroupid, recgroup, special ) VALUES ( 2, 'LiveTV', '1' );",
2516 "INSERT INTO recgroups ( recgroupid, recgroup, special ) VALUES ( 3, 'Deleted', '1' );",
2518 "DELETE FROM recgrouppassword WHERE password = '';",
2519 "UPDATE recgroups r, recgrouppassword p SET r.password = p.password WHERE r.recgroup = p.recgroup;",
2521 "INSERT IGNORE INTO recgroups ( recgroup, displayname, password ) SELECT DISTINCT recgroup, recgroup, password FROM recgrouppassword;",
2522 "INSERT IGNORE INTO recgroups ( recgroup, displayname ) SELECT DISTINCT recgroup, recgroup FROM record;",
2523 "INSERT IGNORE INTO recgroups ( recgroup, displayname ) SELECT DISTINCT recgroup, recgroup FROM recorded;",
2525 "ALTER TABLE record ADD COLUMN recgroupid SMALLINT(4) NOT NULL DEFAULT '1', ADD INDEX ( recgroupid );",
2526 "ALTER TABLE recorded ADD COLUMN recgroupid SMALLINT(4) NOT NULL DEFAULT '1', ADD INDEX ( recgroupid );",
2528 "UPDATE recorded, recgroups SET recorded.recgroupid = recgroups.recgroupid WHERE recorded.recgroup = recgroups.recgroup;",
2529 "UPDATE record, recgroups SET record.recgroupid = recgroups.recgroupid WHERE record.recgroup = recgroups.recgroup;"
2535 updates,
"1321", dbver))
2539 if (dbver ==
"1321")
2542 "ALTER TABLE `housekeeping` ADD COLUMN `lastsuccess` DATETIME;",
2543 "UPDATE `housekeeping` SET `lastsuccess`=`lastrun`;"
2547 updates,
"1322", dbver))
2551 if (dbver ==
"1322")
2556 "ALTER TABLE program "
2557 " ADD COLUMN inetref varchar(40) DEFAULT '' AFTER videoprop;",
2558 "ALTER TABLE recordedprogram "
2559 " ADD COLUMN inetref varchar(40) DEFAULT '' AFTER videoprop;",
2560 "DELETE FROM settings WHERE value='DefaultStartOffset';",
2561 "DELETE FROM settings WHERE value='DefaultEndOffset';",
2562 "DELETE FROM settings WHERE value='AutoExpireDefault';",
2563 "DELETE FROM settings WHERE value='AutoCommercialFlag';",
2564 "DELETE FROM settings WHERE value='AutoTranscode';",
2565 "DELETE FROM settings WHERE value='DefaultTranscoder';",
2566 "DELETE FROM settings WHERE value='AutoRunUserJob1';",
2567 "DELETE FROM settings WHERE value='AutoRunUserJob2';",
2568 "DELETE FROM settings WHERE value='AutoRunUserJob3';",
2569 "DELETE FROM settings WHERE value='AutoRunUserJob4';",
2570 "DELETE FROM settings WHERE value='AutoMetadataLookup';",
2571 "DELETE FROM housekeeping WHERE tag='DailyCleanup';",
2572 "DELETE FROM housekeeping WHERE tag='ThemeChooserInfoCacheUpdate';"
2575 updates,
"1323", dbver))
2579 if (dbver ==
"1323")
2583 "ALTER TABLE diseqc_tree "
2584 " ADD COLUMN scr_userband INTEGER UNSIGNED NOT NULL DEFAULT 0 AFTER address, "
2585 " ADD COLUMN scr_frequency INTEGER UNSIGNED NOT NULL DEFAULT 1400 AFTER scr_userband, "
2586 " ADD COLUMN scr_pin INTEGER NOT NULL DEFAULT '-1' AFTER scr_frequency;"
2590 updates,
"1324", dbver))
2594 if (dbver ==
"1324")
2597 "ALTER TABLE recorded "
2598 " DROP PRIMARY KEY, "
2599 " ADD recordedid INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, "
2600 " ADD UNIQUE KEY (chanid, starttime) ;"
2604 updates,
"1325", dbver))
2608 if (dbver ==
"1325")
2611 "ALTER TABLE recorded ADD inputname VARCHAR(32);"
2615 updates,
"1326", dbver))
2619 if (dbver ==
"1326")
2623 "REPLACE INTO recordfilter (filterid, description, clause, newruledefault) "
2624 " VALUES (8, 'This time', 'ABS(TIMESTAMPDIFF(MINUTE, CONVERT_TZ("
2625 " ADDTIME(RECTABLE.startdate, RECTABLE.starttime), ''Etc/UTC'', ''SYSTEM''), "
2626 " CONVERT_TZ(program.starttime, ''Etc/UTC'', ''SYSTEM''))) MOD 1440 "
2627 " NOT BETWEEN 11 AND 1429', 0)",
2629 "REPLACE INTO recordfilter (filterid, description, clause, newruledefault) "
2630 " VALUES (9, 'This day and time', 'ABS(TIMESTAMPDIFF(MINUTE, CONVERT_TZ("
2631 " ADDTIME(RECTABLE.startdate, RECTABLE.starttime), ''Etc/UTC'', ''SYSTEM''), "
2632 " CONVERT_TZ(program.starttime, ''Etc/UTC'', ''SYSTEM''))) MOD 10080 "
2633 " NOT BETWEEN 11 AND 10069', 0)"
2636 updates,
"1327", dbver))
2640 if (dbver ==
"1327")
2643 "DELETE r1 FROM record r1, record r2 "
2644 " WHERE r1.chanid = r2.chanid AND "
2645 " r1.starttime = r2.starttime AND "
2646 " r1.startdate = r2.startdate AND "
2647 " r1.title = r2.title AND "
2648 " r1.type = r2.type AND "
2649 " r1.recordid > r2.recordid",
2650 "ALTER TABLE record DROP INDEX chanid",
2651 "ALTER TABLE record ADD UNIQUE INDEX "
2652 " (chanid, starttime, startdate, title, type)"
2655 updates,
"1328", dbver))
2659 if (dbver ==
"1328")
2662 "ALTER TABLE recordedfile "
2663 "DROP KEY `chanid`, "
2664 "DROP COLUMN `chanid`, "
2665 "DROP COLUMN `starttime`;",
2666 "ALTER TABLE recordedfile "
2667 "ADD COLUMN recordedid int(10) unsigned NOT NULL, "
2668 "ADD UNIQUE KEY `recordedid` (recordedid);",
2669 "ALTER TABLE recordedfile "
2670 "CHANGE audio_type audio_codec varchar(255) NOT NULL DEFAULT '';"
2671 "ALTER TABLE recordedfile "
2672 "CHANGE video_type video_codec varchar(255) NOT NULL DEFAULT '';"
2675 updates,
"1329", dbver))
2679 if (dbver ==
"1329")
2682 "ALTER TABLE recordedfile "
2683 "DROP COLUMN audio_bits_per_sample ;",
2684 "ALTER TABLE recordedfile "
2685 "ADD COLUMN container VARCHAR(255) NOT NULL DEFAULT '', "
2686 "ADD COLUMN total_bitrate MEDIUMINT UNSIGNED NOT NULL DEFAULT 0, "
2687 "ADD COLUMN video_avg_bitrate MEDIUMINT UNSIGNED NOT NULL DEFAULT 0, "
2688 "ADD COLUMN video_max_bitrate MEDIUMINT UNSIGNED NOT NULL DEFAULT 0, "
2689 "ADD COLUMN audio_avg_bitrate MEDIUMINT UNSIGNED NOT NULL DEFAULT 0, "
2690 "ADD COLUMN audio_max_bitrate MEDIUMINT UNSIGNED NOT NULL DEFAULT 0 ;"
2693 updates,
"1330", dbver))
2697 if (dbver ==
"1330")
2700 query.
prepare(
"SELECT recordedid FROM recorded");
2702 while (query.
next())
2704 int recordingID = query.
value(0).toInt();
2707 recFile->
m_fileName = recInfo->GetBasename();
2708 recFile->
m_fileSize = recInfo->GetFilesize();
2711 switch (recInfo->QueryAverageAspectRatio())
2728 QSize resolution(recInfo->QueryAverageWidth(),
2729 recInfo->QueryAverageHeight());
2731 recFile->
m_videoFrameRate = (double)recInfo->QueryAverageFrameRate() / 1000.0;
2740 if (dbver ==
"1331")
2742 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1332");
2747 select.
prepare(
"SELECT DISTINCT i1.cardid, i1.cardinputid "
2748 "FROM cardinput i1, cardinput i2 "
2749 "WHERE i1.cardid = i2.cardid AND "
2750 " i1.cardinputid > i2.cardinputid "
2751 "ORDER BY i1.cardid, i1.cardinputid");
2758 while (select.
next())
2760 int cardid = select.
value(0).toInt();
2761 int inputid = select.
value(1).toInt();
2764 update.
prepare(
"INSERT INTO capturecard "
2765 " ( videodevice, audiodevice, vbidevice, "
2766 " cardtype, defaultinput, audioratelimit, "
2767 " hostname, dvb_swfilter, dvb_sat_type, "
2768 " dvb_wait_for_seqstart, skipbtaudio, "
2769 " dvb_on_demand, dvb_diseqc_type, "
2770 " firewire_speed, firewire_model, "
2771 " firewire_connection, signal_timeout, "
2772 " channel_timeout, dvb_tuning_delay, "
2773 " contrast, brightness, colour, hue, "
2774 " diseqcid, dvb_eitscan ) "
2775 "SELECT videodevice, audiodevice, vbidevice, "
2776 " cardtype, defaultinput, audioratelimit, "
2777 " hostname, dvb_swfilter, dvb_sat_type, "
2778 " dvb_wait_for_seqstart, skipbtaudio, "
2779 " dvb_on_demand, dvb_diseqc_type, "
2780 " firewire_speed, firewire_model, "
2781 " firewire_connection, signal_timeout, "
2782 " channel_timeout, dvb_tuning_delay, "
2783 " contrast, brightness, colour, hue, "
2784 " diseqcid, dvb_eitscan "
2785 "FROM capturecard c "
2786 "WHERE c.cardid = :CARDID");
2796 update.
prepare(
"UPDATE cardinput "
2797 "SET cardid = :NEWCARDID "
2798 "WHERE cardinputid = :INPUTID");
2799 update.
bindValue(
":NEWCARDID", newcardid);
2810 "DELETE FROM inputgroup WHERE inputgroupname LIKE 'DVB_%'",
2811 "DELETE FROM inputgroup WHERE inputgroupname LIKE 'CETON_%'",
2812 "DELETE FROM inputgroup WHERE inputgroupname LIKE 'HDHOMERUN_%'",
2815 "ALTER TABLE inputgroup "
2816 " MODIFY COLUMN inputgroupname VARCHAR(48)",
2818 "UPDATE inputgroup "
2819 " SET inputgroupname = CONCAT('user:', inputgroupname)",
2821 "UPDATE inputgroup ig "
2822 " JOIN cardinput i ON ig.cardinputid = i.cardinputid "
2823 " SET ig.cardinputid = i.cardid",
2826 " JOIN cardinput i ON r.prefinput = i.cardinputid "
2827 " SET r.prefinput = i.cardid",
2829 "UPDATE diseqc_config dc "
2830 " JOIN cardinput i ON dc.cardinputid = i.cardinputid "
2831 " SET dc.cardinputid = i.cardid",
2834 "SELECT MAX(cardid) INTO @maxcardid FROM capturecard",
2835 "SELECT MAX(cardinputid) INTO @maxcardinputid FROM cardinput",
2836 "UPDATE cardinput i "
2837 " SET i.cardinputid = i.cardid + @maxcardid + @maxcardinputid",
2838 "UPDATE cardinput i "
2839 " SET i.cardinputid = i.cardid"
2846 select.
prepare(
"SELECT cardid, hostname, videodevice "
2847 "FROM capturecard c "
2848 "ORDER BY c.cardid");
2855 while (select.
next())
2858 QString host = select.
value(1).toString();
2859 QString device = select.
value(2).toString();
2860 QString name = host +
"|" + device;
2876 if (dbver ==
"1332")
2880 "ALTER TABLE capturecard "
2881 " ADD COLUMN inputname VARCHAR(32) NOT NULL DEFAULT '', "
2882 " ADD COLUMN sourceid INT(10) UNSIGNED NOT NULL DEFAULT 0, "
2883 " ADD COLUMN externalcommand VARCHAR(128), "
2884 " ADD COLUMN changer_device VARCHAR(128), "
2885 " ADD COLUMN changer_model VARCHAR(128), "
2886 " ADD COLUMN tunechan VARCHAR(10), "
2887 " ADD COLUMN startchan VARCHAR(10), "
2888 " ADD COLUMN displayname VARCHAR(64) NOT NULL DEFAULT '', "
2889 " ADD COLUMN dishnet_eit TINYINT(1) NOT NULL DEFAULT 0, "
2890 " ADD COLUMN recpriority INT(11) NOT NULL DEFAULT 0, "
2891 " ADD COLUMN quicktune TINYINT(4) NOT NULL DEFAULT 0, "
2892 " ADD COLUMN schedorder INT(10) UNSIGNED NOT NULL DEFAULT 0, "
2893 " ADD COLUMN livetvorder INT(10) UNSIGNED NOT NULL DEFAULT 0",
2894 "UPDATE capturecard c "
2895 " JOIN cardinput i ON c.cardid = i.cardinputid "
2896 " SET c.inputname = i.inputname, "
2897 " c.sourceid = i.sourceid, "
2898 " c.externalcommand = i.externalcommand, "
2899 " c.changer_device = i.changer_device, "
2900 " c.changer_model = i.changer_model, "
2901 " c.tunechan = i.tunechan, "
2902 " c.startchan = i.startchan, "
2903 " c.displayname = i.displayname, "
2904 " c.dishnet_eit = i.dishnet_eit, "
2905 " c.recpriority = i.recpriority, "
2906 " c.quicktune = i.quicktune, "
2907 " c.schedorder = i.schedorder, "
2908 " c.livetvorder = i.livetvorder",
2909 "TRUNCATE cardinput"
2912 updates,
"1333", dbver))
2916 if (dbver ==
"1333")
2920 "ALTER TABLE capturecard "
2921 " MODIFY COLUMN inputname VARCHAR(32) NOT NULL DEFAULT 'None'",
2922 "UPDATE capturecard c "
2923 " SET inputname = 'None' WHERE inputname = '' "
2926 updates,
"1334", dbver))
2930 if (dbver ==
"1334")
2934 "ALTER TABLE capturecard "
2935 " MODIFY COLUMN schedorder INT(10) UNSIGNED "
2936 " NOT NULL DEFAULT 1, "
2937 " MODIFY COLUMN livetvorder INT(10) UNSIGNED "
2938 " NOT NULL DEFAULT 1"
2941 updates,
"1335", dbver))
2945 if (dbver ==
"1335")
2950 "UPDATE record SET description = "
2951 " replace(description, 'cardinputid', 'cardid') "
2952 " WHERE search = 1",
2953 "UPDATE record SET description = "
2954 " replace(description, 'cardinput', 'capturecard') "
2955 " WHERE search = 1",
2956 "UPDATE powerpriority SET selectclause = "
2957 " replace(selectclause, 'cardinputid', 'cardid')",
2958 "UPDATE powerpriority SET selectclause = "
2959 " replace(selectclause, 'cardinput', 'capturecard')"
2962 updates,
"1336", dbver))
2966 if (dbver ==
"1336")
2970 "ALTER TABLE capturecard "
2971 " ADD parentid INT UNSIGNED NOT NULL DEFAULT 0 AFTER cardid",
2972 "UPDATE capturecard c, "
2973 " (SELECT min(cardid) cardid, hostname, videodevice, "
2974 " inputname, cardtype "
2975 " FROM capturecard "
2976 " WHERE cardtype NOT IN "
2977 " ('FREEBOX', 'IMPORT', 'DEMO', 'EXTERNAL') "
2978 " GROUP BY hostname, videodevice, inputname) mins "
2979 "SET c.parentid = mins.cardid "
2980 "WHERE c.hostname = mins.hostname and "
2981 " c.videodevice = mins.videodevice and "
2982 " c.inputname = mins.inputname and "
2983 " c.cardid <> mins.cardid"
2986 updates,
"1337", dbver))
2990 if (dbver ==
"1337")
2994 "ALTER TABLE record MODIFY next_record DATETIME NULL",
2996 "UPDATE record SET next_record = NULL "
2997 " WHERE next_record = '0000-00-00 00:00:00'",
2998 "ALTER TABLE record MODIFY last_record DATETIME NULL",
2999 "UPDATE record SET last_record = NULL "
3000 " WHERE last_record = '0000-00-00 00:00:00'",
3001 "ALTER TABLE record MODIFY last_delete DATETIME NULL",
3002 "UPDATE record SET last_delete = NULL "
3003 " WHERE last_delete = '0000-00-00 00:00:00'"
3006 updates,
"1338", dbver))
3010 if (dbver ==
"1338")
3013 "CREATE TABLE users ("
3014 " userid int(5) unsigned NOT NULL AUTO_INCREMENT,"
3015 " username varchar(128) NOT NULL DEFAULT '',"
3016 " password_digest varchar(32) NOT NULL DEFAULT '',"
3017 " lastlogin datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
3018 " PRIMARY KEY (userid),"
3019 " KEY username (username)"
3020 " ) ENGINE=MyISAM DEFAULT CHARSET=utf8;",
3021 "CREATE TABLE user_permissions ("
3022 " userid int(5) unsigned NOT NULL,"
3023 " permission varchar(128) NOT NULL DEFAULT '',"
3024 " PRIMARY KEY (userid)"
3025 " ) ENGINE=MyISAM DEFAULT CHARSET=utf8;",
3026 "CREATE TABLE user_sessions ("
3027 " sessiontoken varchar(40) NOT NULL DEFAULT '',"
3028 " userid int(5) unsigned NOT NULL,"
3029 " client varchar(128) NOT NULL, "
3030 " created datetime NOT NULL,"
3031 " lastactive datetime NOT NULL,"
3032 " expires datetime NOT NULL,"
3033 " PRIMARY KEY (sessionToken),"
3034 " UNIQUE KEY userid_client (userid,client)"
3035 " ) ENGINE=MyISAM DEFAULT CHARSET=utf8;",
3036 "INSERT INTO users SET username='admin',"
3037 " password_digest='bcd911b2ecb15ffbd6d8e6e744d60cf6';"
3040 updates,
"1339", dbver))
3044 if (dbver ==
"1339")
3049 query.
prepare(
"INSERT INTO profilegroups SET name = 'VBox Recorder', "
3050 "cardtype = 'VBOX', is_default = 1;");
3061 query.
prepare(
"INSERT INTO recordingprofiles SET name = \"Default\", profilegroup = :GROUPID;");
3065 MythDB::DBError(
"Unable to insert 'Default' recordingprofile.", query);
3069 query.
prepare(
"INSERT INTO recordingprofiles SET name = \"Live TV\", profilegroup = :GROUPID;");
3073 MythDB::DBError(
"Unable to insert 'Live TV' recordingprofile.", query);
3077 query.
prepare(
"INSERT INTO recordingprofiles SET name = \"High Quality\", profilegroup = :GROUPID;");
3081 MythDB::DBError(
"Unable to insert 'High Quality' recordingprofile.", query);
3085 query.
prepare(
"INSERT INTO recordingprofiles SET name = \"Low Quality\", profilegroup = :GROUPID;");
3089 MythDB::DBError(
"Unable to insert 'Low Quality' recordingprofile.", query);
3097 if (dbver ==
"1340")
3101 "REPLACE INTO recordfilter (filterid, description, clause, newruledefault) "
3102 " VALUES (11, 'No episodes', 'program.category_type <> ''series''', 0)"
3105 updates,
"1341", dbver))
3109 if (dbver ==
"1341")
3112 "UPDATE profilegroups SET cardtype='FREEBOX' WHERE cardtype='Freebox'"
3115 updates,
"1342", dbver))
3119 if (dbver ==
"1342")
3121 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1343");
3127 "DELETE FROM inputgroup WHERE inputgroupname REGEXP '^[a-z_-]*\\\\|'",
3129 "ALTER TABLE inputgroup "
3130 " MODIFY COLUMN inputgroupname VARCHAR(128)"
3137 select.
prepare(
"SELECT cardid, parentid, cardtype, hostname, "
3139 "FROM capturecard c "
3140 "ORDER BY c.cardid");
3147 while (select.
next())
3150 uint parentid = select.
value(1).toUInt();
3151 QString
type = select.
value(2).toString();
3152 QString host = select.
value(3).toString();
3153 QString device = select.
value(4).toString();
3154 QString name = host +
"|" + device;
3155 if (
type ==
"FREEBOX" ||
type ==
"IMPORT" ||
3156 type ==
"DEMO" ||
type ==
"EXTERNAL")
3157 name += QString(
"|%1").arg(parentid ? parentid : cardid);
3173 if (dbver ==
"1343")
3176 "DROP TABLE IF EXISTS bdbookmark;",
3177 "CREATE TABLE bdbookmark ("
3178 " serialid varchar(40) NOT NULL DEFAULT '',"
3179 " `name` varchar(128) DEFAULT NULL,"
3180 " bdstate varchar(4096) NOT NULL DEFAULT '',"
3181 " `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,"
3182 " PRIMARY KEY (serialid)"
3183 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
3186 "UPDATE channel SET callsign=REPLACE(callsign,'\\0',''),"
3187 "name=REPLACE(name,'\\0','');",
3190 "DELETE FROM settings WHERE value='BackendWSPort';"
3194 updates,
"1344", dbver))
3198 if (dbver ==
"1344")
3201 "ALTER TABLE capturecard ADD COLUMN "
3202 " reclimit INT UNSIGNED DEFAULT 1 NOT NULL",
3203 "UPDATE capturecard cc, "
3204 " ( SELECT IF(parentid>0, parentid, cardid) cardid, "
3206 " FROM capturecard "
3207 " GROUP BY if(parentid>0, parentid, cardid) "
3209 "SET cc.reclimit = p.cnt "
3210 "WHERE cc.cardid = p.cardid OR cc.parentid = p.cardid"
3214 updates,
"1345", dbver))
3218 if (dbver ==
"1345")
3221 "ALTER TABLE capturecard ADD COLUMN "
3222 " schedgroup TINYINT(1) DEFAULT 0 NOT NULL"
3226 updates,
"1346", dbver))
3237 if (dbver ==
"1346")
3244 "insert into settings (value,data,hostname) "
3245 "values('MasterServerName','"
3251 "insert into settings (value,data,hostname) "
3252 "select 'MasterServerName', b.hostname, null "
3253 "from settings a, settings b "
3254 "where a.value = 'MasterServerIP' "
3255 "and b.value in ('BackendServerIP','BackendServerIP6')"
3256 "and a.data = b.data;";
3261 master.toLocal8Bit().constData(),
3264 "insert into settings (value,data,hostname) "
3265 "select 'BackendServerAddr', data,hostname from settings "
3266 "where value = 'BackendServerIP';",
3268 "update settings a, settings b "
3269 "set b.data = a.data "
3270 "where a.value = 'BackendServerIP6' "
3271 "and b.hostname = a.hostname "
3272 "and b.value = 'BackendServerAddr' "
3273 "and b.data = '127.0.0.1' "
3274 "and a.data != '::1' "
3275 "and a.data is not null "
3276 "and a.data != ''; ",
3279 "update settings a, settings b, settings c "
3280 "set c.data = a.data "
3281 "where a.value = 'MasterServerIP' "
3282 "and b.value = 'MasterServerName' "
3283 "and c.value = 'BackendServerAddr' "
3284 "and c.hostname = b.data;",
3286 "delete from settings "
3287 "where value in ('WatchTVGuide');"
3291 updates,
"1347", dbver))
3295 if (dbver ==
"1347")
3298 "ALTER TABLE record MODIFY COLUMN startdate DATE DEFAULT NULL",
3299 "ALTER TABLE record MODIFY COLUMN enddate DATE DEFAULT NULL",
3300 "ALTER TABLE record MODIFY COLUMN starttime TIME DEFAULT NULL",
3301 "ALTER TABLE record MODIFY COLUMN endtime TIME DEFAULT NULL"
3304 updates,
"1348", dbver))
3308 if (dbver ==
"1348")
3311 "update capturecard "
3312 " set videodevice=left(videodevice, "
3313 " locate('-', videodevice)-1) "
3314 " where cardtype='HDHOMERUN' "
3315 " and videodevice like '%-%'"
3318 updates,
"1349", dbver))
3322 if (dbver ==
"1349")
3328 updates,
"1350", dbver))
3332 if (dbver ==
"1350")
3335 "ALTER TABLE videosource ADD COLUMN bouquet_id INT DEFAULT 0;",
3336 "ALTER TABLE videosource ADD COLUMN region_id INT DEFAULT 0;"
3339 updates,
"1351", dbver))
3343 if (dbver ==
"1351")
3346 "ALTER TABLE videosource MODIFY bouquet_id INT UNSIGNED;",
3347 "ALTER TABLE videosource MODIFY region_id INT UNSIGNED;",
3348 "ALTER TABLE channel ADD COLUMN service_type INT UNSIGNED DEFAULT 0 AFTER serviceid;"
3351 updates,
"1352", dbver))
3355 if (dbver ==
"1352")
3358 "ALTER TABLE capturecard MODIFY schedgroup TINYINT(1) DEFAULT 1 NOT NULL"
3361 updates,
"1353", dbver))
3365 if (dbver ==
"1353")
3368 "ALTER TABLE channel ADD COLUMN deleted TIMESTAMP NULL"
3371 updates,
"1354", dbver))
3375 if (dbver ==
"1354")
3378 "ALTER TABLE videosource ADD COLUMN scanfrequency INT UNSIGNED DEFAULT 0;"
3381 updates,
"1355", dbver))
3385 if (dbver ==
"1355")
3388 "UPDATE capturecard "
3389 "SET displayname = CONCAT('Input ', cardid) "
3390 "WHERE displayname = ''"
3393 updates,
"1356", dbver))
3397 if (dbver ==
"1356")
3400 "REPLACE INTO recordfilter (filterid, description, clause, "
3402 " VALUES (12, 'Priority channel', 'channel.recpriority > 0', 0)"
3405 updates,
"1357", dbver))
3409 if (dbver ==
"1357")
3413 std::vector<MythVideoProfileItem> profiles;
3416 query.
prepare(
"SELECT profileid, value, data FROM displayprofiles "
3417 "ORDER BY profileid");
3424 uint currentprofile = 0;
3425 while (query.
next())
3427 if (query.
value(0).toUInt() != currentprofile)
3432 profiles.push_back(temp);
3435 currentprofile = query.
value(0).toUInt();
3437 temp.
Set(query.
value(1).toString(), query.
value(2).toString());
3443 profiles.push_back(temp);
3453 QString olddecoder =
profile.Get(
"pref_decoder");
3454 QString oldrender =
profile.Get(
"pref_videorenderer");
3455 QString olddeint0 =
profile.Get(
"pref_deint0");
3456 QString olddeint1 =
profile.Get(
"pref_deint1");
3458 if (oldrender ==
"xv-blit")
3460 newdecoder =
"ffmpeg";
3461 newrender =
"opengl-yv12";
3463 if (olddecoder ==
"openmax" || oldrender ==
"openmax")
3465 newdecoder =
"mmal-dec";
3466 newrender =
"opengl-yv12";
3468 if ((olddecoder ==
"mediacodec") || (olddecoder ==
"nvdec") ||
3469 (olddecoder ==
"vda") || (olddecoder ==
"vaapi2") ||
3470 (olddecoder ==
"vaapi" && oldrender ==
"openglvaapi") ||
3471 (olddecoder ==
"vdpau" && oldrender ==
"vdpau"))
3473 if (oldrender !=
"opengl-hw")
3474 newrender =
"opengl-hw";
3476 if (olddecoder ==
"vda")
3478 if (olddecoder ==
"vaapi2")
3479 newdecoder =
"vaapi";
3481 auto UpdateDeinterlacer = [](
const QString &Olddeint, QString &Newdeint,
const QString &
Decoder)
3483 if (Olddeint.isEmpty())
3487 else if (Olddeint ==
"none" ||
3497 QStringList newsettings;
3498 bool driver = (
Decoder !=
"ffmpeg") &&
3499 (Olddeint.contains(
"vaapi") || Olddeint.contains(
"vdpau") ||
3500 Olddeint.contains(
"nvdec"));
3503 if (Olddeint.contains(
"opengl") || driver)
3506 if (Olddeint.contains(
"greedy") || Olddeint.contains(
"yadif") ||
3507 Olddeint.contains(
"kernel") || Olddeint.contains(
"advanced") ||
3508 Olddeint.contains(
"compensated") || Olddeint.contains(
"adaptive"))
3512 else if (Olddeint.contains(
"bob") || Olddeint.contains(
"onefield") ||
3513 Olddeint.contains(
"linedouble"))
3521 Newdeint = newsettings.join(
":");
3524 QString decoder = newdecoder.isEmpty() ? olddecoder : newdecoder;
3525 UpdateDeinterlacer(olddeint0, newdeint0, decoder);
3526 UpdateDeinterlacer(olddeint1, newdeint1, decoder);
3528 auto UpdateData = [](
uint ProfileID,
const QString &Value,
const QString &Data)
3532 "UPDATE displayprofiles SET data = :DATA "
3533 "WHERE profileid = :PROFILEID AND value = :VALUE");
3534 update.
bindValue(
":PROFILEID", ProfileID);
3538 LOG(VB_GENERAL, LOG_ERR,
3539 QString(
"Error updating display profile id %1").arg(ProfileID));
3543 if (!newdecoder.isEmpty())
3544 UpdateData(
id,
"pref_decoder", newdecoder);
3545 if (!newrender.isEmpty())
3546 UpdateData(
id,
"pref_videorenderer", newrender);
3547 if (!newdeint0.isEmpty())
3548 UpdateData(
id,
"pref_deint0", newdeint0);
3549 if (!newdeint1.isEmpty())
3550 UpdateData(
id,
"pref_deint1", newdeint1);
3557 "DELETE FROM keybindings WHERE action='TOGGLESTUDIOLEVELS'"
3561 updates,
"1358", dbver))
3565 if (dbver ==
"1358")
3569 "ALTER TABLE videosource "
3570 " CHANGE COLUMN userid userid VARCHAR(128) NULL DEFAULT NULL",
3572 "UPDATE videosource "
3573 " SET userid = NULL "
3574 " WHERE userid = ''",
3576 "UPDATE videosource "
3577 " SET userid = NULL, password = NULL "
3578 " WHERE xmltvgrabber IN ('schedulesdirect1', 'datadirect')"
3581 updates,
"1359", dbver))
3585 if (dbver ==
"1359")
3591 "UPDATE settings SET data='0.0' WHERE value='XineramaMonitorAspectRatio'"
3594 updates,
"1360", dbver))
3598 if (dbver ==
"1360")
3603 std::vector<MythVideoProfileItem> profiles;
3606 query.
prepare(
"SELECT profileid, value, data FROM displayprofiles "
3607 "ORDER BY profileid");
3615 uint currentprofile = 0;
3616 while (query.
next())
3618 if (query.
value(0).toUInt() != currentprofile)
3623 profiles.push_back(temp);
3626 currentprofile = query.
value(0).toUInt();
3628 temp.
Set(query.
value(1).toString(), query.
value(2).toString());
3634 profiles.push_back(temp);
3640 QString oldrender =
profile.Get(
"pref_videorenderer");
3641 if (oldrender ==
"quartz-blit" || oldrender ==
"openglvaapi" ||
3642 oldrender ==
"vdpau")
3644 auto UpdateData = [](
uint ProfileID,
const QString &Value,
const QString &Data)
3648 "UPDATE displayprofiles SET data = :DATA "
3649 "WHERE profileid = :PROFILEID AND value = :VALUE");
3650 update.
bindValue(
":PROFILEID", ProfileID);
3654 LOG(VB_GENERAL, LOG_ERR,
3655 QString(
"Error updating display profile id %1").arg(ProfileID));
3659 UpdateData(
id,
"pref_decoder",
"ffmpeg");
3660 UpdateData(
id,
"pref_videorenderer",
"opengl-yv12");
3669 if (dbver ==
"1361")
3672 "ALTER TABLE program CHANGE COLUMN videoprop videoprop "
3673 " SET('WIDESCREEN', 'HDTV', 'MPEG2', 'AVC', 'HEVC') NOT NULL; ",
3674 "ALTER TABLE recordedprogram CHANGE COLUMN videoprop videoprop "
3675 " SET('WIDESCREEN', 'HDTV', 'MPEG2', 'AVC', 'HEVC', "
3676 " '720', '1080', '4K', '3DTV', 'PROGRESSIVE', "
3677 " 'DAMAGED') NOT NULL; ",
3680 updates,
"1362", dbver))
3684 if (dbver ==
"1362")
3688 QString(
"select index_name from information_schema.statistics "
3689 "where table_schema = '%1' "
3690 "and table_name = 'recordedartwork' "
3691 "and seq_in_index = 1 "
3692 "and column_name = 'inetref'")
3702 "CREATE INDEX recordedartwork_ix1 ON recordedartwork (inetref); "
3706 if (select.
size() > 0) {
3711 updates,
"1363", dbver))
3715 if (dbver ==
"1363")
3720 query.
prepare(
"INSERT INTO profilegroups SET name = 'Sat>IP Recorder', "
3721 "cardtype = 'SATIP', is_default = 1;");
3732 query.
prepare(
"INSERT INTO recordingprofiles SET name = \"Default\", profilegroup = :GROUPID;");
3736 MythDB::DBError(
"Unable to insert 'Default' recordingprofile.", query);
3740 query.
prepare(
"INSERT INTO recordingprofiles SET name = \"Live TV\", profilegroup = :GROUPID;");
3744 MythDB::DBError(
"Unable to insert 'Live TV' recordingprofile.", query);
3748 query.
prepare(
"INSERT INTO recordingprofiles SET name = \"High Quality\", profilegroup = :GROUPID;");
3752 MythDB::DBError(
"Unable to insert 'High Quality' recordingprofile.", query);
3756 query.
prepare(
"INSERT INTO recordingprofiles SET name = \"Low Quality\", profilegroup = :GROUPID;");
3760 MythDB::DBError(
"Unable to insert 'Low Quality' recordingprofile.", query);
3768 if (dbver ==
"1364")
3772 "UPDATE record SET dupmethod = 1 WHERE search = 5"
3775 updates,
"1365", dbver))
3779 if (dbver ==
"1365")
3782 "ALTER TABLE channelscan_channel ADD COLUMN service_type INT UNSIGNED NOT NULL DEFAULT 0;"
3785 updates,
"1366", dbver))
3789 if (dbver ==
"1366")
3792 "ALTER TABLE channelscan_dtv_multiplex ADD COLUMN signal_strength INT NOT NULL DEFAULT 0;"
3795 updates,
"1367", dbver))
3799 if (dbver ==
"1367")
3802 "ALTER TABLE videosource ADD COLUMN lcnoffset INT UNSIGNED DEFAULT 0;"
3805 updates,
"1368", dbver))
3808 if (dbver ==
"1368")
3812 "ALTER TABLE credits ADD COLUMN priority "
3813 " TINYINT UNSIGNED DEFAULT 0;",
3814 "ALTER TABLE credits ADD COLUMN roleid "
3815 " MEDIUMINT UNSIGNED DEFAULT 0;",
3816 "ALTER TABLE credits drop key chanid, "
3817 " add unique key `chanid` "
3818 " (chanid, starttime, person, role, roleid);"
3819 "ALTER TABLE recordedcredits ADD COLUMN priority "
3820 " TINYINT UNSIGNED DEFAULT 0;",
3821 "ALTER TABLE recordedcredits ADD COLUMN roleid "
3822 " MEDIUMINT UNSIGNED DEFAULT 0;",
3823 "ALTER TABLE recordedcredits drop key chanid, "
3824 " add unique key `chanid` "
3825 " (chanid, starttime, person, role, roleid);"
3826 "CREATE TABLE roles (roleid MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,"
3827 " `name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin"
3828 " NOT NULL DEFAULT '',"
3829 " PRIMARY KEY (roleid),"
3830 " UNIQUE KEY `name` (`name`)"
3831 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
3834 updates,
"1369", dbver))
3837 if (dbver ==
"1369")
3840 "ALTER TABLE programrating MODIFY COLUMN `system` "
3842 "ALTER TABLE programrating MODIFY COLUMN rating "
3844 "ALTER TABLE recordedrating MODIFY COLUMN `system` "
3846 "ALTER TABLE recordedrating MODIFY COLUMN rating "
3850 updates,
"1370", dbver))
3854 if (dbver ==
"1370")
3858 "UPDATE settings SET data=REPLACE(data, 'ttvdb.py', 'ttvdb4.py') "
3859 "WHERE value='TelevisionGrabber'"
3862 updates,
"1371", dbver))
3866 if (dbver ==
"1371")
3873 updates,
"1372", dbver))
3877 if (dbver ==
"1372")
3880 "ALTER TABLE recorded ADD COLUMN lastplay "
3881 " TINYINT UNSIGNED DEFAULT 0 AFTER bookmark;",
3884 updates,
"1373", dbver))
3888 if (dbver ==
"1373")
3892 "UPDATE record SET inetref=REPLACE(inetref, 'ttvdb.py', 'ttvdb4.py');",
3893 "UPDATE recorded SET inetref=REPLACE(inetref, 'ttvdb.py', 'ttvdb4.py');",
3894 "UPDATE oldrecorded SET inetref=REPLACE(inetref, 'ttvdb.py', 'ttvdb4.py');",
3895 "UPDATE videometadata SET inetref=REPLACE(inetref, 'ttvdb.py', 'ttvdb4.py');",
3896 "UPDATE program SET inetref=REPLACE(inetref, 'ttvdb.py', 'ttvdb4.py');",
3897 "UPDATE recordedprogram SET inetref=REPLACE(inetref, 'ttvdb.py', 'ttvdb4.py');",
3898 "UPDATE recordedartwork SET inetref=REPLACE(inetref, 'ttvdb.py', 'ttvdb4.py');"
3901 updates,
"1374", dbver))
3905 if (dbver ==
"1374")
3910 updates,
"1375", dbver))
3914 if (dbver ==
"1375")
3930 updates,
"1376", dbver))
3934 if (dbver ==
"1376")
3937 "DROP TABLE IF EXISTS `logging`;",
3938 "UPDATE settings SET data='0' WHERE value='LogEnabled'; ",
3941 updates,
"1377", dbver))
3945 if (dbver ==
"1377")
3948 "DELETE FROM settings WHERE value='SubtitleCodec'; ",
3951 updates,
"1378", dbver))
3979 query.
prepare(
"SHOW TABLES;");
3984 QString msg = QString(
3985 "Told to create a NEW database schema, but the database\n"
3986 "already has %1 tables.\n"
3987 "If you are sure this is a good MythTV database, verify\n"
3988 "that the settings table has the DBSchemaVer variable.\n")
3989 .arg(query.
size() - 1);
3990 LOG(VB_GENERAL, LOG_ERR, msg);
3994 LOG(VB_GENERAL, LOG_NOTICE,
3995 "Inserting MythTV initial database information.");
3998 "CREATE TABLE capturecard ("
3999 " cardid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4000 " videodevice varchar(128) DEFAULT NULL,"
4001 " audiodevice varchar(128) DEFAULT NULL,"
4002 " vbidevice varchar(128) DEFAULT NULL,"
4003 " cardtype varchar(32) DEFAULT 'V4L',"
4004 " defaultinput varchar(32) DEFAULT 'Television',"
4005 " audioratelimit int(11) DEFAULT NULL,"
4006 " hostname varchar(64) DEFAULT NULL,"
4007 " dvb_swfilter int(11) DEFAULT '0',"
4008 " dvb_sat_type int(11) NOT NULL DEFAULT '0',"
4009 " dvb_wait_for_seqstart int(11) NOT NULL DEFAULT '1',"
4010 " skipbtaudio tinyint(1) DEFAULT '0',"
4011 " dvb_on_demand tinyint(4) NOT NULL DEFAULT '0',"
4012 " dvb_diseqc_type smallint(6) DEFAULT NULL,"
4013 " firewire_speed int(10) unsigned NOT NULL DEFAULT '0',"
4014 " firewire_model varchar(32) DEFAULT NULL,"
4015 " firewire_connection int(10) unsigned NOT NULL DEFAULT '0',"
4016 " signal_timeout int(11) NOT NULL DEFAULT '1000',"
4017 " channel_timeout int(11) NOT NULL DEFAULT '3000',"
4018 " dvb_tuning_delay int(10) unsigned NOT NULL DEFAULT '0',"
4019 " contrast int(11) NOT NULL DEFAULT '0',"
4020 " brightness int(11) NOT NULL DEFAULT '0',"
4021 " colour int(11) NOT NULL DEFAULT '0',"
4022 " hue int(11) NOT NULL DEFAULT '0',"
4023 " diseqcid int(10) unsigned DEFAULT NULL,"
4024 " dvb_eitscan tinyint(1) NOT NULL DEFAULT '1',"
4025 " PRIMARY KEY (cardid)"
4026 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4027 "CREATE TABLE cardinput ("
4028 " cardinputid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4029 " cardid int(10) unsigned NOT NULL DEFAULT '0',"
4030 " sourceid int(10) unsigned NOT NULL DEFAULT '0',"
4031 " inputname varchar(32) NOT NULL DEFAULT '',"
4032 " externalcommand varchar(128) DEFAULT NULL,"
4033 " changer_device varchar(128) DEFAULT NULL,"
4034 " changer_model varchar(128) DEFAULT NULL,"
4035 " tunechan varchar(10) DEFAULT NULL,"
4036 " startchan varchar(10) DEFAULT NULL,"
4037 " displayname varchar(64) NOT NULL DEFAULT '',"
4038 " dishnet_eit tinyint(1) NOT NULL DEFAULT '0',"
4039 " recpriority int(11) NOT NULL DEFAULT '0',"
4040 " quicktune tinyint(4) NOT NULL DEFAULT '0',"
4041 " schedorder int(10) unsigned NOT NULL DEFAULT '0',"
4042 " livetvorder int(10) unsigned NOT NULL DEFAULT '0',"
4043 " PRIMARY KEY (cardinputid)"
4044 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4045 "CREATE TABLE channel ("
4046 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4047 " channum varchar(10) NOT NULL DEFAULT '',"
4048 " freqid varchar(10) DEFAULT NULL,"
4049 " sourceid int(10) unsigned DEFAULT NULL,"
4050 " callsign varchar(20) NOT NULL DEFAULT '',"
4051 " `name` varchar(64) NOT NULL DEFAULT '',"
4052 " icon varchar(255) NOT NULL DEFAULT '',"
4053 " finetune int(11) DEFAULT NULL,"
4054 " videofilters varchar(255) NOT NULL DEFAULT '',"
4055 " xmltvid varchar(255) NOT NULL DEFAULT '',"
4056 " recpriority int(10) NOT NULL DEFAULT '0',"
4057 " contrast int(11) DEFAULT '32768',"
4058 " brightness int(11) DEFAULT '32768',"
4059 " colour int(11) DEFAULT '32768',"
4060 " hue int(11) DEFAULT '32768',"
4061 " tvformat varchar(10) NOT NULL DEFAULT 'Default',"
4062 " visible tinyint(1) NOT NULL DEFAULT '1',"
4063 " outputfilters varchar(255) NOT NULL DEFAULT '',"
4064 " useonairguide tinyint(1) DEFAULT '0',"
4065 " mplexid smallint(6) DEFAULT NULL,"
4066 " serviceid mediumint(8) unsigned DEFAULT NULL,"
4067 " tmoffset int(11) NOT NULL DEFAULT '0',"
4068 " atsc_major_chan int(10) unsigned NOT NULL DEFAULT '0',"
4069 " atsc_minor_chan int(10) unsigned NOT NULL DEFAULT '0',"
4070 " last_record datetime NOT NULL,"
4071 " default_authority varchar(32) NOT NULL DEFAULT '',"
4072 " commmethod int(11) NOT NULL DEFAULT '-1',"
4073 " iptvid smallint(6) unsigned DEFAULT NULL,"
4074 " PRIMARY KEY (chanid),"
4075 " KEY channel_src (channum,sourceid),"
4076 " KEY sourceid (sourceid,xmltvid,chanid),"
4077 " KEY visible (visible)"
4078 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4079 "CREATE TABLE channelgroup ("
4080 " id int(10) unsigned NOT NULL AUTO_INCREMENT,"
4081 " chanid int(11) unsigned NOT NULL DEFAULT '0',"
4082 " grpid int(11) NOT NULL DEFAULT '1',"
4084 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4085 "CREATE TABLE channelgroupnames ("
4086 " grpid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4087 " `name` varchar(64) NOT NULL DEFAULT '0',"
4088 " PRIMARY KEY (grpid)"
4089 ") ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;",
4090 "CREATE TABLE channelscan ("
4091 " scanid int(3) unsigned NOT NULL AUTO_INCREMENT,"
4092 " cardid int(3) unsigned NOT NULL,"
4093 " sourceid int(3) unsigned NOT NULL,"
4094 " processed tinyint(1) unsigned NOT NULL,"
4095 " scandate datetime NOT NULL,"
4096 " PRIMARY KEY (scanid)"
4097 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4098 "CREATE TABLE channelscan_channel ("
4099 " transportid int(6) unsigned NOT NULL,"
4100 " scanid int(3) unsigned NOT NULL,"
4101 " mplex_id smallint(6) NOT NULL,"
4102 " source_id int(3) unsigned NOT NULL,"
4103 " channel_id int(3) unsigned NOT NULL DEFAULT '0',"
4104 " callsign varchar(20) NOT NULL DEFAULT '',"
4105 " service_name varchar(64) NOT NULL DEFAULT '',"
4106 " chan_num varchar(10) NOT NULL DEFAULT '',"
4107 " service_id mediumint(8) unsigned NOT NULL DEFAULT '0',"
4108 " atsc_major_channel int(4) unsigned NOT NULL DEFAULT '0',"
4109 " atsc_minor_channel int(4) unsigned NOT NULL DEFAULT '0',"
4110 " use_on_air_guide tinyint(1) NOT NULL DEFAULT '0',"
4111 " hidden tinyint(1) NOT NULL DEFAULT '0',"
4112 " hidden_in_guide tinyint(1) NOT NULL DEFAULT '0',"
4113 " freqid varchar(10) NOT NULL DEFAULT '',"
4114 " icon varchar(255) NOT NULL DEFAULT '',"
4115 " tvformat varchar(10) NOT NULL DEFAULT 'Default',"
4116 " xmltvid varchar(64) NOT NULL DEFAULT '',"
4117 " pat_tsid int(5) unsigned NOT NULL DEFAULT '0',"
4118 " vct_tsid int(5) unsigned NOT NULL DEFAULT '0',"
4119 " vct_chan_tsid int(5) unsigned NOT NULL DEFAULT '0',"
4120 " sdt_tsid int(5) unsigned NOT NULL DEFAULT '0',"
4121 " orig_netid int(5) unsigned NOT NULL DEFAULT '0',"
4122 " netid int(5) unsigned NOT NULL DEFAULT '0',"
4123 " si_standard varchar(10) NOT NULL,"
4124 " in_channels_conf tinyint(1) unsigned NOT NULL DEFAULT '0',"
4125 " in_pat tinyint(1) unsigned NOT NULL DEFAULT '0',"
4126 " in_pmt tinyint(1) unsigned NOT NULL DEFAULT '0',"
4127 " in_vct tinyint(1) unsigned NOT NULL DEFAULT '0',"
4128 " in_nit tinyint(1) unsigned NOT NULL DEFAULT '0',"
4129 " in_sdt tinyint(1) unsigned NOT NULL DEFAULT '0',"
4130 " is_encrypted tinyint(1) unsigned NOT NULL DEFAULT '0',"
4131 " is_data_service tinyint(1) unsigned NOT NULL DEFAULT '0',"
4132 " is_audio_service tinyint(1) unsigned NOT NULL DEFAULT '0',"
4133 " is_opencable tinyint(1) unsigned NOT NULL DEFAULT '0',"
4134 " could_be_opencable tinyint(1) unsigned NOT NULL DEFAULT '0',"
4135 " decryption_status smallint(2) unsigned NOT NULL DEFAULT '0',"
4136 " default_authority varchar(32) NOT NULL DEFAULT ''"
4137 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4138 "CREATE TABLE channelscan_dtv_multiplex ("
4139 " transportid int(6) unsigned NOT NULL AUTO_INCREMENT,"
4140 " scanid int(3) unsigned NOT NULL,"
4141 " mplexid smallint(6) unsigned NOT NULL,"
4142 " frequency bigint(12) unsigned NOT NULL,"
4143 " inversion char(1) NOT NULL DEFAULT 'a',"
4144 " symbolrate bigint(12) unsigned NOT NULL DEFAULT '0',"
4145 " fec varchar(10) NOT NULL DEFAULT 'auto',"
4146 " polarity char(1) NOT NULL DEFAULT '',"
4147 " hp_code_rate varchar(10) NOT NULL DEFAULT 'auto',"
4148 " mod_sys varchar(10) DEFAULT NULL,"
4149 " rolloff varchar(4) DEFAULT NULL,"
4150 " lp_code_rate varchar(10) NOT NULL DEFAULT 'auto',"
4151 " modulation varchar(10) NOT NULL DEFAULT 'auto',"
4152 " transmission_mode char(1) NOT NULL DEFAULT 'a',"
4153 " guard_interval varchar(10) NOT NULL DEFAULT 'auto',"
4154 " hierarchy varchar(10) NOT NULL DEFAULT 'auto',"
4155 " bandwidth char(1) NOT NULL DEFAULT 'a',"
4156 " sistandard varchar(10) NOT NULL,"
4157 " tuner_type smallint(2) unsigned NOT NULL,"
4158 " default_authority varchar(32) NOT NULL DEFAULT '',"
4159 " PRIMARY KEY (transportid)"
4160 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4161 "CREATE TABLE codecparams ("
4162 " `profile` int(10) unsigned NOT NULL DEFAULT '0',"
4163 " `name` varchar(128) NOT NULL DEFAULT '',"
4164 " `value` varchar(128) DEFAULT NULL,"
4165 " PRIMARY KEY (`profile`,`name`)"
4166 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4167 "CREATE TABLE credits ("
4168 " person mediumint(8) unsigned NOT NULL DEFAULT '0',"
4169 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4170 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4171 " role set('actor','director','producer','executive_producer','writer','guest_star','host','adapter','presenter','commentator','guest') NOT NULL DEFAULT '',"
4172 " UNIQUE KEY chanid (chanid,starttime,person,role),"
4173 " KEY person (person,role)"
4174 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4175 "CREATE TABLE customexample ("
4176 " rulename varchar(64) NOT NULL,"
4177 " fromclause varchar(10000) NOT NULL DEFAULT '',"
4178 " whereclause varchar(10000) NOT NULL DEFAULT '',"
4179 " search tinyint(4) NOT NULL DEFAULT '0',"
4180 " PRIMARY KEY (rulename)"
4181 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4182 "CREATE TABLE diseqc_config ("
4183 " cardinputid int(10) unsigned NOT NULL,"
4184 " diseqcid int(10) unsigned NOT NULL,"
4185 " `value` varchar(16) NOT NULL DEFAULT '',"
4186 " KEY id (cardinputid)"
4187 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4188 "CREATE TABLE diseqc_tree ("
4189 " diseqcid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4190 " parentid int(10) unsigned DEFAULT NULL,"
4191 " ordinal tinyint(3) unsigned NOT NULL,"
4192 " `type` varchar(16) NOT NULL DEFAULT '',"
4193 " subtype varchar(16) NOT NULL DEFAULT '',"
4194 " description varchar(32) NOT NULL DEFAULT '',"
4195 " switch_ports tinyint(3) unsigned NOT NULL DEFAULT '0',"
4196 " rotor_hi_speed float NOT NULL DEFAULT '0',"
4197 " rotor_lo_speed float NOT NULL DEFAULT '0',"
4198 " rotor_positions varchar(255) NOT NULL DEFAULT '',"
4199 " lnb_lof_switch int(10) NOT NULL DEFAULT '0',"
4200 " lnb_lof_hi int(10) NOT NULL DEFAULT '0',"
4201 " lnb_lof_lo int(10) NOT NULL DEFAULT '0',"
4202 " cmd_repeat int(11) NOT NULL DEFAULT '1',"
4203 " lnb_pol_inv tinyint(4) NOT NULL DEFAULT '0',"
4204 " address tinyint(3) unsigned NOT NULL DEFAULT '0',"
4205 " PRIMARY KEY (diseqcid),"
4206 " KEY parentid (parentid)"
4207 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4208 "CREATE TABLE displayprofilegroups ("
4209 " `name` varchar(128) NOT NULL,"
4210 " hostname varchar(64) NOT NULL,"
4211 " profilegroupid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4212 " PRIMARY KEY (`name`,hostname),"
4213 " UNIQUE KEY profilegroupid (profilegroupid)"
4214 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4215 "CREATE TABLE displayprofiles ("
4216 " profilegroupid int(10) unsigned NOT NULL,"
4217 " profileid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4218 " `value` varchar(128) NOT NULL,"
4219 " `data` varchar(255) NOT NULL DEFAULT '',"
4220 " KEY profilegroupid (profilegroupid),"
4221 " KEY profileid (profileid,`value`),"
4222 " KEY profileid_2 (profileid)"
4223 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4224 "CREATE TABLE dtv_multiplex ("
4225 " mplexid smallint(6) NOT NULL AUTO_INCREMENT,"
4226 " sourceid smallint(6) DEFAULT NULL,"
4227 " transportid int(11) DEFAULT NULL,"
4228 " networkid int(11) DEFAULT NULL,"
4229 " frequency int(11) DEFAULT NULL,"
4230 " inversion char(1) DEFAULT 'a',"
4231 " symbolrate int(11) DEFAULT NULL,"
4232 " fec varchar(10) DEFAULT 'auto',"
4233 " polarity char(1) DEFAULT NULL,"
4234 " modulation varchar(10) DEFAULT 'auto',"
4235 " bandwidth char(1) DEFAULT 'a',"
4236 " lp_code_rate varchar(10) DEFAULT 'auto',"
4237 " transmission_mode char(1) DEFAULT 'a',"
4238 " guard_interval varchar(10) DEFAULT 'auto',"
4239 " visible smallint(1) NOT NULL DEFAULT '0',"
4240 " constellation varchar(10) DEFAULT 'auto',"
4241 " hierarchy varchar(10) DEFAULT 'auto',"
4242 " hp_code_rate varchar(10) DEFAULT 'auto',"
4243 " mod_sys varchar(10) DEFAULT NULL,"
4244 " rolloff varchar(4) DEFAULT NULL,"
4245 " sistandard varchar(10) DEFAULT 'dvb',"
4246 " serviceversion smallint(6) DEFAULT '33',"
4247 " updatetimestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,"
4248 " default_authority varchar(32) NOT NULL DEFAULT '',"
4249 " PRIMARY KEY (mplexid)"
4250 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4251 "CREATE TABLE dtv_privatetypes ("
4252 " sitype varchar(4) NOT NULL DEFAULT '',"
4253 " networkid int(11) NOT NULL DEFAULT '0',"
4254 " private_type varchar(20) NOT NULL DEFAULT '',"
4255 " private_value varchar(100) NOT NULL DEFAULT ''"
4256 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4257 "CREATE TABLE dvdbookmark ("
4258 " serialid varchar(16) NOT NULL DEFAULT '',"
4259 " `name` varchar(32) DEFAULT NULL,"
4260 " title smallint(6) NOT NULL DEFAULT '0',"
4261 " audionum tinyint(4) NOT NULL DEFAULT '-1',"
4262 " subtitlenum tinyint(4) NOT NULL DEFAULT '-1',"
4263 " framenum bigint(20) NOT NULL DEFAULT '0',"
4264 " `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,"
4265 " PRIMARY KEY (serialid)"
4266 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4267 "CREATE TABLE dvdinput ("
4268 " intid int(10) unsigned NOT NULL,"
4269 " hsize int(10) unsigned DEFAULT NULL,"
4270 " vsize int(10) unsigned DEFAULT NULL,"
4271 " ar_num int(10) unsigned DEFAULT NULL,"
4272 " ar_denom int(10) unsigned DEFAULT NULL,"
4273 " fr_code int(10) unsigned DEFAULT NULL,"
4274 " letterbox tinyint(1) DEFAULT NULL,"
4275 " v_format varchar(16) DEFAULT NULL,"
4276 " PRIMARY KEY (intid)"
4277 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4278 "CREATE TABLE dvdtranscode ("
4279 " intid int(11) NOT NULL AUTO_INCREMENT,"
4280 " input int(10) unsigned DEFAULT NULL,"
4281 " `name` varchar(128) NOT NULL,"
4282 " sync_mode int(10) unsigned DEFAULT NULL,"
4283 " use_yv12 tinyint(1) DEFAULT NULL,"
4284 " cliptop int(11) DEFAULT NULL,"
4285 " clipbottom int(11) DEFAULT NULL,"
4286 " clipleft int(11) DEFAULT NULL,"
4287 " clipright int(11) DEFAULT NULL,"
4288 " f_resize_h int(11) DEFAULT NULL,"
4289 " f_resize_w int(11) DEFAULT NULL,"
4290 " hq_resize_h int(11) DEFAULT NULL,"
4291 " hq_resize_w int(11) DEFAULT NULL,"
4292 " grow_h int(11) DEFAULT NULL,"
4293 " grow_w int(11) DEFAULT NULL,"
4294 " clip2top int(11) DEFAULT NULL,"
4295 " clip2bottom int(11) DEFAULT NULL,"
4296 " clip2left int(11) DEFAULT NULL,"
4297 " clip2right int(11) DEFAULT NULL,"
4298 " codec varchar(128) NOT NULL,"
4299 " codec_param varchar(128) DEFAULT NULL,"
4300 " bitrate int(11) DEFAULT NULL,"
4301 " a_sample_r int(11) DEFAULT NULL,"
4302 " a_bitrate int(11) DEFAULT NULL,"
4303 " two_pass tinyint(1) DEFAULT NULL,"
4304 " tc_param varchar(128) DEFAULT NULL,"
4305 " PRIMARY KEY (intid)"
4306 ") ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;",
4307 "CREATE TABLE eit_cache ("
4308 " chanid int(10) NOT NULL,"
4309 " eventid int(10) unsigned NOT NULL DEFAULT '0',"
4310 " tableid tinyint(3) unsigned NOT NULL,"
4311 " version tinyint(3) unsigned NOT NULL,"
4312 " endtime int(10) unsigned NOT NULL,"
4313 " `status` tinyint(4) NOT NULL DEFAULT '0',"
4314 " PRIMARY KEY (chanid,eventid,`status`)"
4315 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4316 "CREATE TABLE filemarkup ("
4317 " filename text NOT NULL,"
4318 " mark mediumint(8) unsigned NOT NULL DEFAULT '0',"
4319 " `offset` bigint(20) unsigned DEFAULT NULL,"
4320 " `type` tinyint(4) NOT NULL DEFAULT '0',"
4321 " KEY filename (filename(255))"
4322 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4323 "CREATE TABLE housekeeping ("
4324 " tag varchar(64) NOT NULL DEFAULT '',"
4325 " lastrun datetime DEFAULT NULL,"
4326 " PRIMARY KEY (tag)"
4327 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4328 "CREATE TABLE inputgroup ("
4329 " cardinputid int(10) unsigned NOT NULL,"
4330 " inputgroupid int(10) unsigned NOT NULL,"
4331 " inputgroupname varchar(32) NOT NULL"
4332 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4333 "CREATE TABLE internetcontent ("
4334 " `name` varchar(255) NOT NULL,"
4335 " thumbnail varchar(255) DEFAULT NULL,"
4336 " `type` smallint(3) NOT NULL,"
4337 " author varchar(128) NOT NULL,"
4338 " description text NOT NULL,"
4339 " commandline text NOT NULL,"
4340 " version double NOT NULL,"
4341 " updated datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4342 " search tinyint(1) NOT NULL,"
4343 " tree tinyint(1) NOT NULL,"
4344 " podcast tinyint(1) NOT NULL,"
4345 " download tinyint(1) NOT NULL,"
4346 " `host` varchar(128) DEFAULT NULL"
4347 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4348 "CREATE TABLE internetcontentarticles ("
4349 " feedtitle varchar(255) NOT NULL,"
4350 " path text NOT NULL,"
4351 " paththumb text NOT NULL,"
4352 " title varchar(255) NOT NULL,"
4353 " subtitle varchar(255) NOT NULL,"
4354 " season smallint(5) NOT NULL DEFAULT '0',"
4355 " episode smallint(5) NOT NULL DEFAULT '0',"
4356 " description text NOT NULL,"
4357 " url text NOT NULL,"
4358 " `type` smallint(3) NOT NULL,"
4359 " thumbnail text NOT NULL,"
4360 " mediaURL text NOT NULL,"
4361 " author varchar(255) NOT NULL,"
4362 " `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4363 " `time` int(11) NOT NULL,"
4364 " rating varchar(255) NOT NULL,"
4365 " filesize bigint(20) NOT NULL,"
4366 " player varchar(255) NOT NULL,"
4367 " playerargs text NOT NULL,"
4368 " download varchar(255) NOT NULL,"
4369 " downloadargs text NOT NULL,"
4370 " width smallint(6) NOT NULL,"
4371 " height smallint(6) NOT NULL,"
4372 " `language` varchar(128) NOT NULL,"
4373 " podcast tinyint(1) NOT NULL,"
4374 " downloadable tinyint(1) NOT NULL,"
4375 " customhtml tinyint(1) NOT NULL,"
4376 " countries varchar(255) NOT NULL"
4377 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4378 "CREATE TABLE inuseprograms ("
4379 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4380 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4381 " recusage varchar(128) NOT NULL DEFAULT '',"
4382 " lastupdatetime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4383 " hostname varchar(64) NOT NULL DEFAULT '',"
4384 " rechost varchar(64) NOT NULL,"
4385 " recdir varchar(255) NOT NULL DEFAULT '',"
4386 " KEY chanid (chanid,starttime),"
4387 " KEY recusage (recusage,lastupdatetime)"
4388 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4389 "CREATE TABLE iptv_channel ("
4390 " iptvid smallint(6) unsigned NOT NULL AUTO_INCREMENT,"
4391 " chanid int(10) unsigned NOT NULL,"
4392 " url text NOT NULL,"
4393 " `type` set('data','rfc2733-1','rfc2733-2','rfc5109-1','rfc5109-2','smpte2022-1','smpte2022-2') DEFAULT NULL,"
4394 " bitrate int(10) unsigned NOT NULL,"
4395 " PRIMARY KEY (iptvid)"
4396 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4397 "CREATE TABLE jobqueue ("
4398 " id int(11) NOT NULL AUTO_INCREMENT,"
4399 " chanid int(10) NOT NULL DEFAULT '0',"
4400 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4401 " inserttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4402 " `type` int(11) NOT NULL DEFAULT '0',"
4403 " cmds int(11) NOT NULL DEFAULT '0',"
4404 " flags int(11) NOT NULL DEFAULT '0',"
4405 " `status` int(11) NOT NULL DEFAULT '0',"
4406 " statustime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,"
4407 " hostname varchar(64) NOT NULL DEFAULT '',"
4408 " args blob NOT NULL,"
4409 " `comment` varchar(128) NOT NULL DEFAULT '',"
4410 " schedruntime datetime NOT NULL DEFAULT '2007-01-01 00:00:00',"
4411 " PRIMARY KEY (id),"
4412 " UNIQUE KEY chanid (chanid,starttime,`type`,inserttime)"
4413 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4414 "CREATE TABLE jumppoints ("
4415 " destination varchar(128) NOT NULL DEFAULT '',"
4416 " description varchar(255) DEFAULT NULL,"
4417 " keylist varchar(128) DEFAULT NULL,"
4418 " hostname varchar(64) NOT NULL DEFAULT '',"
4419 " PRIMARY KEY (destination,hostname)"
4420 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4421 "CREATE TABLE keybindings ("
4422 " `context` varchar(32) NOT NULL DEFAULT '',"
4423 " `action` varchar(32) NOT NULL DEFAULT '',"
4424 " description varchar(255) DEFAULT NULL,"
4425 " keylist varchar(128) DEFAULT NULL,"
4426 " hostname varchar(64) NOT NULL DEFAULT '',"
4427 " PRIMARY KEY (`context`,`action`,hostname)"
4428 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4429 "CREATE TABLE keyword ("
4430 " phrase varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',"
4431 " searchtype int(10) unsigned NOT NULL DEFAULT '3',"
4432 " UNIQUE KEY phrase (phrase,searchtype)"
4433 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4434 "CREATE TABLE livestream ("
4435 " id int(10) unsigned NOT NULL AUTO_INCREMENT,"
4436 " width int(10) unsigned NOT NULL,"
4437 " height int(10) unsigned NOT NULL,"
4438 " bitrate int(10) unsigned NOT NULL,"
4439 " audiobitrate int(10) unsigned NOT NULL,"
4440 " samplerate int(10) unsigned NOT NULL,"
4441 " audioonlybitrate int(10) unsigned NOT NULL,"
4442 " segmentsize int(10) unsigned NOT NULL DEFAULT '10',"
4443 " maxsegments int(10) unsigned NOT NULL DEFAULT '0',"
4444 " startsegment int(10) unsigned NOT NULL DEFAULT '0',"
4445 " currentsegment int(10) unsigned NOT NULL DEFAULT '0',"
4446 " segmentcount int(10) unsigned NOT NULL DEFAULT '0',"
4447 " percentcomplete int(10) unsigned NOT NULL DEFAULT '0',"
4448 " created datetime NOT NULL,"
4449 " lastmodified datetime NOT NULL,"
4450 " relativeurl varchar(512) NOT NULL,"
4451 " fullurl varchar(1024) NOT NULL,"
4452 " `status` int(10) unsigned NOT NULL DEFAULT '0',"
4453 " statusmessage varchar(256) NOT NULL,"
4454 " sourcefile varchar(512) NOT NULL,"
4455 " sourcehost varchar(64) NOT NULL,"
4456 " sourcewidth int(10) unsigned NOT NULL DEFAULT '0',"
4457 " sourceheight int(10) unsigned NOT NULL DEFAULT '0',"
4458 " outdir varchar(256) NOT NULL,"
4459 " outbase varchar(128) NOT NULL,"
4461 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4462 "CREATE TABLE logging ("
4463 " id bigint(20) unsigned NOT NULL AUTO_INCREMENT,"
4464 " `host` varchar(64) NOT NULL DEFAULT '',"
4465 " application varchar(64) NOT NULL DEFAULT '',"
4466 " pid int(11) NOT NULL DEFAULT '0',"
4467 " tid int(11) NOT NULL DEFAULT '0',"
4468 " thread varchar(64) NOT NULL DEFAULT '',"
4469 " filename varchar(255) NOT NULL DEFAULT '',"
4470 " line int(11) NOT NULL DEFAULT '0',"
4471 " `function` varchar(255) NOT NULL DEFAULT '',"
4472 " msgtime datetime NOT NULL,"
4473 " `level` int(11) NOT NULL DEFAULT '0',"
4474 " message varchar(2048) NOT NULL,"
4475 " PRIMARY KEY (id),"
4476 " KEY `host` (`host`,application,pid,msgtime),"
4477 " KEY msgtime (msgtime),"
4478 " KEY `level` (`level`)"
4479 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4480 "CREATE TABLE mythlog ("
4481 " logid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4482 " module varchar(32) NOT NULL DEFAULT '',"
4483 " priority int(11) NOT NULL DEFAULT '0',"
4484 " acknowledged tinyint(1) DEFAULT '0',"
4485 " logdate datetime DEFAULT NULL,"
4486 " `host` varchar(128) DEFAULT NULL,"
4487 " message varchar(255) NOT NULL DEFAULT '',"
4488 " details varchar(16000) NOT NULL DEFAULT '',"
4489 " PRIMARY KEY (logid),"
4490 " KEY module (module)"
4491 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4492 "CREATE TABLE oldfind ("
4493 " recordid int(11) NOT NULL DEFAULT '0',"
4494 " findid int(11) NOT NULL DEFAULT '0',"
4495 " PRIMARY KEY (recordid,findid)"
4496 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4497 "CREATE TABLE oldprogram ("
4498 " oldtitle varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',"
4499 " airdate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4500 " PRIMARY KEY (oldtitle)"
4501 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4502 "CREATE TABLE oldrecorded ("
4503 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4504 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4505 " endtime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4506 " title varchar(128) NOT NULL DEFAULT '',"
4507 " subtitle varchar(128) NOT NULL DEFAULT '',"
4508 " description varchar(16000) NOT NULL DEFAULT '',"
4509 " season smallint(5) NOT NULL,"
4510 " episode smallint(5) NOT NULL,"
4511 " category varchar(64) NOT NULL DEFAULT '',"
4512 " seriesid varchar(40) NOT NULL DEFAULT '',"
4513 " programid varchar(40) NOT NULL DEFAULT '',"
4514 " inetref varchar(40) NOT NULL,"
4515 " findid int(11) NOT NULL DEFAULT '0',"
4516 " recordid int(11) NOT NULL DEFAULT '0',"
4517 " station varchar(20) NOT NULL DEFAULT '',"
4518 " rectype int(10) unsigned NOT NULL DEFAULT '0',"
4519 " `duplicate` tinyint(1) NOT NULL DEFAULT '0',"
4520 " recstatus int(11) NOT NULL DEFAULT '0',"
4521 " reactivate smallint(6) NOT NULL DEFAULT '0',"
4522 " generic tinyint(1) NOT NULL,"
4523 " future tinyint(1) NOT NULL DEFAULT '0',"
4524 " PRIMARY KEY (station,starttime,title),"
4525 " KEY endtime (endtime),"
4526 " KEY title (title),"
4527 " KEY seriesid (seriesid),"
4528 " KEY programid (programid),"
4529 " KEY recordid (recordid),"
4530 " KEY recstatus (recstatus,programid,seriesid),"
4531 " KEY recstatus_2 (recstatus,title,subtitle),"
4532 " KEY future (future),"
4533 " KEY chanid (chanid,starttime),"
4534 " KEY subtitle (subtitle),"
4535 " KEY description (description(255))"
4536 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4537 "CREATE TABLE people ("
4538 " person mediumint(8) unsigned NOT NULL AUTO_INCREMENT,"
4539 " `name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',"
4540 " PRIMARY KEY (person),"
4541 " UNIQUE KEY `name` (`name`(41))"
4542 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4543 "CREATE TABLE pidcache ("
4544 " chanid smallint(6) NOT NULL DEFAULT '0',"
4545 " pid int(11) NOT NULL DEFAULT '-1',"
4546 " tableid int(11) NOT NULL DEFAULT '-1',"
4547 " KEY chanid (chanid)"
4548 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4549 "CREATE TABLE playgroup ("
4550 " `name` varchar(32) NOT NULL DEFAULT '',"
4551 " titlematch varchar(255) NOT NULL DEFAULT '',"
4552 " skipahead int(11) NOT NULL DEFAULT '0',"
4553 " skipback int(11) NOT NULL DEFAULT '0',"
4554 " timestretch int(11) NOT NULL DEFAULT '0',"
4555 " jump int(11) NOT NULL DEFAULT '0',"
4556 " PRIMARY KEY (`name`)"
4557 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4558 "CREATE TABLE powerpriority ("
4559 " priorityname varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,"
4560 " recpriority int(10) NOT NULL DEFAULT '0',"
4561 " selectclause varchar(16000) NOT NULL DEFAULT '',"
4562 " PRIMARY KEY (priorityname)"
4563 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4564 "CREATE TABLE profilegroups ("
4565 " id int(10) unsigned NOT NULL AUTO_INCREMENT,"
4566 " `name` varchar(128) DEFAULT NULL,"
4567 " cardtype varchar(32) NOT NULL DEFAULT 'V4L',"
4568 " is_default int(1) DEFAULT '0',"
4569 " hostname varchar(64) DEFAULT NULL,"
4570 " PRIMARY KEY (id),"
4571 " UNIQUE KEY `name` (`name`,hostname),"
4572 " KEY cardtype (cardtype)"
4573 ") ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;",
4574 "CREATE TABLE program ("
4575 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4576 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4577 " endtime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4578 " title varchar(128) NOT NULL DEFAULT '',"
4579 " subtitle varchar(128) NOT NULL DEFAULT '',"
4580 " description varchar(16000) NOT NULL DEFAULT '',"
4581 " category varchar(64) NOT NULL DEFAULT '',"
4582 " category_type varchar(64) NOT NULL DEFAULT '',"
4583 " airdate year(4) NOT NULL DEFAULT '0000',"
4584 " stars float NOT NULL DEFAULT '0',"
4585 " previouslyshown tinyint(4) NOT NULL DEFAULT '0',"
4586 " title_pronounce varchar(128) NOT NULL DEFAULT '',"
4587 " stereo tinyint(1) NOT NULL DEFAULT '0',"
4588 " subtitled tinyint(1) NOT NULL DEFAULT '0',"
4589 " hdtv tinyint(1) NOT NULL DEFAULT '0',"
4590 " closecaptioned tinyint(1) NOT NULL DEFAULT '0',"
4591 " partnumber int(11) NOT NULL DEFAULT '0',"
4592 " parttotal int(11) NOT NULL DEFAULT '0',"
4593 " seriesid varchar(64) NOT NULL DEFAULT '',"
4594 " originalairdate date DEFAULT NULL,"
4595 " showtype varchar(30) NOT NULL DEFAULT '',"
4596 " colorcode varchar(20) NOT NULL DEFAULT '',"
4597 " syndicatedepisodenumber varchar(20) NOT NULL DEFAULT '',"
4598 " programid varchar(64) NOT NULL DEFAULT '',"
4599 " manualid int(10) unsigned NOT NULL DEFAULT '0',"
4600 " generic tinyint(1) DEFAULT '0',"
4601 " listingsource int(11) NOT NULL DEFAULT '0',"
4602 " `first` tinyint(1) NOT NULL DEFAULT '0',"
4603 " `last` tinyint(1) NOT NULL DEFAULT '0',"
4604 " audioprop set('STEREO','MONO','SURROUND','DOLBY','HARDHEAR','VISUALIMPAIR') NOT NULL,"
4605 " subtitletypes set('HARDHEAR','NORMAL','ONSCREEN','SIGNED') NOT NULL,"
4606 " videoprop set('HDTV','WIDESCREEN','AVC') NOT NULL,"
4607 " PRIMARY KEY (chanid,starttime,manualid),"
4608 " KEY endtime (endtime),"
4609 " KEY title (title),"
4610 " KEY title_pronounce (title_pronounce),"
4611 " KEY seriesid (seriesid),"
4612 " KEY id_start_end (chanid,starttime,endtime),"
4613 " KEY program_manualid (manualid),"
4614 " KEY previouslyshown (previouslyshown),"
4615 " KEY programid (programid,starttime),"
4616 " KEY starttime (starttime),"
4617 " KEY subtitle (subtitle),"
4618 " KEY description (description(255))"
4619 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4620 "CREATE TABLE programgenres ("
4621 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4622 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4623 " relevance char(1) NOT NULL DEFAULT '',"
4624 " genre varchar(30) DEFAULT NULL,"
4625 " PRIMARY KEY (chanid,starttime,relevance),"
4626 " KEY genre (genre)"
4627 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4628 "CREATE TABLE programrating ("
4629 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4630 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4631 " `system` varchar(8) DEFAULT NULL,"
4632 " rating varchar(16) DEFAULT NULL,"
4633 " UNIQUE KEY chanid (chanid,starttime,`system`,rating),"
4634 " KEY starttime (starttime,`system`)"
4635 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4636 "CREATE TABLE recgrouppassword ("
4637 " recgroup varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',"
4638 " `password` varchar(10) NOT NULL DEFAULT '',"
4639 " PRIMARY KEY (recgroup)"
4640 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4641 "CREATE TABLE record ("
4642 " recordid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4643 " `type` int(10) unsigned NOT NULL DEFAULT '0',"
4644 " chanid int(10) unsigned DEFAULT NULL,"
4645 " starttime time NOT NULL DEFAULT '00:00:00',"
4646 " startdate date NOT NULL DEFAULT '0000-00-00',"
4647 " endtime time NOT NULL DEFAULT '00:00:00',"
4648 " enddate date NOT NULL DEFAULT '0000-00-00',"
4649 " title varchar(128) NOT NULL DEFAULT '',"
4650 " subtitle varchar(128) NOT NULL DEFAULT '',"
4651 " description varchar(16000) NOT NULL DEFAULT '',"
4652 " season smallint(5) NOT NULL,"
4653 " episode smallint(5) NOT NULL,"
4654 " category varchar(64) NOT NULL DEFAULT '',"
4655 " `profile` varchar(128) NOT NULL DEFAULT 'Default',"
4656 " recpriority int(10) NOT NULL DEFAULT '0',"
4657 " autoexpire int(11) NOT NULL DEFAULT '0',"
4658 " maxepisodes int(11) NOT NULL DEFAULT '0',"
4659 " maxnewest int(11) NOT NULL DEFAULT '0',"
4660 " startoffset int(11) NOT NULL DEFAULT '0',"
4661 " endoffset int(11) NOT NULL DEFAULT '0',"
4662 " recgroup varchar(32) NOT NULL DEFAULT 'Default',"
4663 " dupmethod int(11) NOT NULL DEFAULT '6',"
4664 " dupin int(11) NOT NULL DEFAULT '15',"
4665 " station varchar(20) NOT NULL DEFAULT '',"
4666 " seriesid varchar(40) NOT NULL DEFAULT '',"
4667 " programid varchar(40) NOT NULL DEFAULT '',"
4668 " inetref varchar(40) NOT NULL,"
4669 " search int(10) unsigned NOT NULL DEFAULT '0',"
4670 " autotranscode tinyint(1) NOT NULL DEFAULT '0',"
4671 " autocommflag tinyint(1) NOT NULL DEFAULT '0',"
4672 " autouserjob1 tinyint(1) NOT NULL DEFAULT '0',"
4673 " autouserjob2 tinyint(1) NOT NULL DEFAULT '0',"
4674 " autouserjob3 tinyint(1) NOT NULL DEFAULT '0',"
4675 " autouserjob4 tinyint(1) NOT NULL DEFAULT '0',"
4676 " autometadata tinyint(1) NOT NULL DEFAULT '0',"
4677 " findday tinyint(4) NOT NULL DEFAULT '0',"
4678 " findtime time NOT NULL DEFAULT '00:00:00',"
4679 " findid int(11) NOT NULL DEFAULT '0',"
4680 " inactive tinyint(1) NOT NULL DEFAULT '0',"
4681 " parentid int(11) NOT NULL DEFAULT '0',"
4682 " transcoder int(11) NOT NULL DEFAULT '0',"
4683 " playgroup varchar(32) NOT NULL DEFAULT 'Default',"
4684 " prefinput int(10) NOT NULL DEFAULT '0',"
4685 " next_record datetime NOT NULL,"
4686 " last_record datetime NOT NULL,"
4687 " last_delete datetime NOT NULL,"
4688 " storagegroup varchar(32) NOT NULL DEFAULT 'Default',"
4689 " avg_delay int(11) NOT NULL DEFAULT '100',"
4690 " filter int(10) unsigned NOT NULL DEFAULT '0',"
4691 " PRIMARY KEY (recordid),"
4692 " KEY chanid (chanid,starttime),"
4693 " KEY title (title),"
4694 " KEY seriesid (seriesid),"
4695 " KEY programid (programid),"
4696 " KEY maxepisodes (maxepisodes),"
4697 " KEY search (search),"
4698 " KEY `type` (`type`)"
4699 ") ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;",
4700 "CREATE TABLE recorded ("
4701 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4702 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4703 " endtime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4704 " title varchar(128) NOT NULL DEFAULT '',"
4705 " subtitle varchar(128) NOT NULL DEFAULT '',"
4706 " description varchar(16000) NOT NULL DEFAULT '',"
4707 " season smallint(5) NOT NULL,"
4708 " episode smallint(5) NOT NULL,"
4709 " category varchar(64) NOT NULL DEFAULT '',"
4710 " hostname varchar(64) NOT NULL DEFAULT '',"
4711 " bookmark tinyint(1) NOT NULL DEFAULT '0',"
4712 " editing int(10) unsigned NOT NULL DEFAULT '0',"
4713 " cutlist tinyint(1) NOT NULL DEFAULT '0',"
4714 " autoexpire int(11) NOT NULL DEFAULT '0',"
4715 " commflagged int(10) unsigned NOT NULL DEFAULT '0',"
4716 " recgroup varchar(32) NOT NULL DEFAULT 'Default',"
4717 " recordid int(11) DEFAULT NULL,"
4718 " seriesid varchar(40) NOT NULL DEFAULT '',"
4719 " programid varchar(40) NOT NULL DEFAULT '',"
4720 " inetref varchar(40) NOT NULL,"
4721 " lastmodified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,"
4722 " filesize bigint(20) NOT NULL DEFAULT '0',"
4723 " stars float NOT NULL DEFAULT '0',"
4724 " previouslyshown tinyint(1) DEFAULT '0',"
4725 " originalairdate date DEFAULT NULL,"
4726 " `preserve` tinyint(1) NOT NULL DEFAULT '0',"
4727 " findid int(11) NOT NULL DEFAULT '0',"
4728 " deletepending tinyint(1) NOT NULL DEFAULT '0',"
4729 " transcoder int(11) NOT NULL DEFAULT '0',"
4730 " timestretch float NOT NULL DEFAULT '1',"
4731 " recpriority int(11) NOT NULL DEFAULT '0',"
4732 " basename varchar(255) NOT NULL,"
4733 " progstart datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4734 " progend datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4735 " playgroup varchar(32) NOT NULL DEFAULT 'Default',"
4736 " `profile` varchar(32) NOT NULL DEFAULT '',"
4737 " `duplicate` tinyint(1) NOT NULL DEFAULT '0',"
4738 " transcoded tinyint(1) NOT NULL DEFAULT '0',"
4739 " watched tinyint(4) NOT NULL DEFAULT '0',"
4740 " storagegroup varchar(32) NOT NULL DEFAULT 'Default',"
4741 " bookmarkupdate timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',"
4742 " PRIMARY KEY (chanid,starttime),"
4743 " KEY endtime (endtime),"
4744 " KEY seriesid (seriesid),"
4745 " KEY programid (programid),"
4746 " KEY title (title),"
4747 " KEY recordid (recordid),"
4748 " KEY deletepending (deletepending,lastmodified),"
4749 " KEY recgroup (recgroup,endtime)"
4750 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4751 "CREATE TABLE recordedartwork ("
4752 " inetref varchar(255) NOT NULL,"
4753 " season smallint(5) NOT NULL,"
4754 " `host` text NOT NULL,"
4755 " coverart text NOT NULL,"
4756 " fanart text NOT NULL,"
4757 " banner text NOT NULL"
4758 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4759 "CREATE TABLE recordedcredits ("
4760 " person mediumint(8) unsigned NOT NULL DEFAULT '0',"
4761 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4762 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4763 " role set('actor','director','producer','executive_producer','writer','guest_star','host','adapter','presenter','commentator','guest') NOT NULL DEFAULT '',"
4764 " UNIQUE KEY chanid (chanid,starttime,person,role),"
4765 " KEY person (person,role)"
4766 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4767 "CREATE TABLE recordedfile ("
4768 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4769 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4770 " basename varchar(128) NOT NULL DEFAULT '',"
4771 " filesize bigint(20) NOT NULL DEFAULT '0',"
4772 " width smallint(5) unsigned NOT NULL DEFAULT '0',"
4773 " height smallint(5) unsigned NOT NULL DEFAULT '0',"
4774 " fps float(6,3) NOT NULL DEFAULT '0.000',"
4775 " aspect float(8,6) NOT NULL DEFAULT '0.000000',"
4776 " audio_sample_rate smallint(5) unsigned NOT NULL DEFAULT '0',"
4777 " audio_bits_per_sample smallint(5) unsigned NOT NULL DEFAULT '0',"
4778 " audio_channels tinyint(3) unsigned NOT NULL DEFAULT '0',"
4779 " audio_type varchar(255) NOT NULL DEFAULT '',"
4780 " video_type varchar(255) NOT NULL DEFAULT '',"
4781 " `comment` varchar(255) NOT NULL DEFAULT '',"
4782 " hostname varchar(64) NOT NULL,"
4783 " storagegroup varchar(32) NOT NULL,"
4784 " id int(11) NOT NULL AUTO_INCREMENT,"
4785 " PRIMARY KEY (id),"
4786 " UNIQUE KEY chanid (chanid,starttime,basename),"
4787 " KEY basename (basename)"
4788 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4789 "CREATE TABLE recordedmarkup ("
4790 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4791 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4792 " mark mediumint(8) unsigned NOT NULL DEFAULT '0',"
4793 " `type` tinyint(4) NOT NULL DEFAULT '0',"
4794 " `data` int(11) unsigned DEFAULT NULL,"
4795 " PRIMARY KEY (chanid,starttime,`type`,mark)"
4796 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4797 "CREATE TABLE recordedprogram ("
4798 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4799 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4800 " endtime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4801 " title varchar(128) NOT NULL DEFAULT '',"
4802 " subtitle varchar(128) NOT NULL DEFAULT '',"
4803 " description varchar(16000) NOT NULL DEFAULT '',"
4804 " category varchar(64) NOT NULL DEFAULT '',"
4805 " category_type varchar(64) NOT NULL DEFAULT '',"
4806 " airdate year(4) NOT NULL DEFAULT '0000',"
4807 " stars float unsigned NOT NULL DEFAULT '0',"
4808 " previouslyshown tinyint(4) NOT NULL DEFAULT '0',"
4809 " title_pronounce varchar(128) NOT NULL DEFAULT '',"
4810 " stereo tinyint(1) NOT NULL DEFAULT '0',"
4811 " subtitled tinyint(1) NOT NULL DEFAULT '0',"
4812 " hdtv tinyint(1) NOT NULL DEFAULT '0',"
4813 " closecaptioned tinyint(1) NOT NULL DEFAULT '0',"
4814 " partnumber int(11) NOT NULL DEFAULT '0',"
4815 " parttotal int(11) NOT NULL DEFAULT '0',"
4816 " seriesid varchar(40) NOT NULL DEFAULT '',"
4817 " originalairdate date DEFAULT NULL,"
4818 " showtype varchar(30) NOT NULL DEFAULT '',"
4819 " colorcode varchar(20) NOT NULL DEFAULT '',"
4820 " syndicatedepisodenumber varchar(20) NOT NULL DEFAULT '',"
4821 " programid varchar(40) NOT NULL DEFAULT '',"
4822 " manualid int(10) unsigned NOT NULL DEFAULT '0',"
4823 " generic tinyint(1) DEFAULT '0',"
4824 " listingsource int(11) NOT NULL DEFAULT '0',"
4825 " `first` tinyint(1) NOT NULL DEFAULT '0',"
4826 " `last` tinyint(1) NOT NULL DEFAULT '0',"
4827 " audioprop set('STEREO','MONO','SURROUND','DOLBY','HARDHEAR','VISUALIMPAIR') NOT NULL,"
4828 " subtitletypes set('HARDHEAR','NORMAL','ONSCREEN','SIGNED') NOT NULL,"
4829 " videoprop set('HDTV','WIDESCREEN','AVC','720','1080','DAMAGED') NOT NULL,"
4830 " PRIMARY KEY (chanid,starttime,manualid),"
4831 " KEY endtime (endtime),"
4832 " KEY title (title),"
4833 " KEY title_pronounce (title_pronounce),"
4834 " KEY seriesid (seriesid),"
4835 " KEY programid (programid),"
4836 " KEY id_start_end (chanid,starttime,endtime)"
4837 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4838 "CREATE TABLE recordedrating ("
4839 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4840 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4841 " `system` varchar(8) DEFAULT NULL,"
4842 " rating varchar(16) DEFAULT NULL,"
4843 " UNIQUE KEY chanid (chanid,starttime,`system`,rating),"
4844 " KEY starttime (starttime,`system`)"
4845 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4846 "CREATE TABLE recordedseek ("
4847 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4848 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4849 " mark mediumint(8) unsigned NOT NULL DEFAULT '0',"
4850 " `offset` bigint(20) unsigned NOT NULL,"
4851 " `type` tinyint(4) NOT NULL DEFAULT '0',"
4852 " PRIMARY KEY (chanid,starttime,`type`,mark)"
4853 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4854 "CREATE TABLE recordfilter ("
4855 " filterid int(10) unsigned NOT NULL,"
4856 " description varchar(64) DEFAULT NULL,"
4857 " clause varchar(256) DEFAULT NULL,"
4858 " newruledefault tinyint(1) DEFAULT '0',"
4859 " PRIMARY KEY (filterid)"
4860 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4861 "CREATE TABLE recordingprofiles ("
4862 " id int(10) unsigned NOT NULL AUTO_INCREMENT,"
4863 " `name` varchar(128) DEFAULT NULL,"
4864 " videocodec varchar(128) DEFAULT NULL,"
4865 " audiocodec varchar(128) DEFAULT NULL,"
4866 " profilegroup int(10) unsigned NOT NULL DEFAULT '0',"
4867 " PRIMARY KEY (id),"
4868 " KEY profilegroup (profilegroup)"
4869 ") ENGINE=MyISAM AUTO_INCREMENT=70 DEFAULT CHARSET=utf8;",
4870 "CREATE TABLE recordmatch ("
4871 " recordid int(10) unsigned NOT NULL,"
4872 " chanid int(10) unsigned NOT NULL,"
4873 " starttime datetime NOT NULL,"
4874 " manualid int(10) unsigned NOT NULL,"
4875 " oldrecduplicate tinyint(1) DEFAULT NULL,"
4876 " recduplicate tinyint(1) DEFAULT NULL,"
4877 " findduplicate tinyint(1) DEFAULT NULL,"
4878 " oldrecstatus int(11) DEFAULT NULL,"
4879 " findid int(11) NOT NULL DEFAULT '0',"
4880 " UNIQUE KEY recordid (recordid,chanid,starttime),"
4881 " KEY chanid (chanid,starttime,manualid),"
4882 " KEY recordid_2 (recordid,findid)"
4883 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4884 "CREATE TABLE scannerfile ("
4885 " fileid bigint(20) unsigned NOT NULL AUTO_INCREMENT,"
4886 " filesize bigint(20) unsigned NOT NULL DEFAULT '0',"
4887 " filehash varchar(64) NOT NULL DEFAULT '',"
4888 " added timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,"
4889 " PRIMARY KEY (fileid),"
4890 " UNIQUE KEY filehash (filehash)"
4891 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4892 "CREATE TABLE scannerpath ("
4893 " fileid bigint(20) unsigned NOT NULL,"
4894 " hostname varchar(64) NOT NULL DEFAULT 'localhost',"
4895 " storagegroup varchar(32) NOT NULL DEFAULT 'Default',"
4896 " filename varchar(255) NOT NULL DEFAULT '',"
4897 " PRIMARY KEY (fileid)"
4898 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4899 "CREATE TABLE settings ("
4900 " `value` varchar(128) NOT NULL DEFAULT '',"
4901 " `data` varchar(16000) NOT NULL DEFAULT '',"
4902 " hostname varchar(64) DEFAULT NULL,"
4903 " KEY `value` (`value`,hostname)"
4904 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4905 "CREATE TABLE storagegroup ("
4906 " id int(11) NOT NULL AUTO_INCREMENT,"
4907 " groupname varchar(32) NOT NULL,"
4908 " hostname varchar(64) NOT NULL DEFAULT '',"
4909 " dirname varchar(235) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',"
4910 " PRIMARY KEY (id),"
4911 " UNIQUE KEY grouphostdir (groupname,hostname,dirname),"
4912 " KEY hostname (hostname)"
4913 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4914 "CREATE TABLE tvchain ("
4915 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4916 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4917 " chainid varchar(128) NOT NULL DEFAULT '',"
4918 " chainpos int(10) NOT NULL DEFAULT '0',"
4919 " discontinuity tinyint(1) NOT NULL DEFAULT '0',"
4920 " watching int(10) NOT NULL DEFAULT '0',"
4921 " hostprefix varchar(128) NOT NULL DEFAULT '',"
4922 " cardtype varchar(32) NOT NULL DEFAULT 'V4L',"
4923 " input varchar(32) NOT NULL DEFAULT '',"
4924 " channame varchar(32) NOT NULL DEFAULT '',"
4925 " endtime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4926 " PRIMARY KEY (chanid,starttime)"
4927 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4928 "CREATE TABLE tvosdmenu ("
4929 " osdcategory varchar(32) NOT NULL,"
4930 " livetv tinyint(4) NOT NULL DEFAULT '0',"
4931 " recorded tinyint(4) NOT NULL DEFAULT '0',"
4932 " video tinyint(4) NOT NULL DEFAULT '0',"
4933 " dvd tinyint(4) NOT NULL DEFAULT '0',"
4934 " description varchar(32) NOT NULL,"
4935 " PRIMARY KEY (osdcategory)"
4936 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4937 "CREATE TABLE upnpmedia ("
4938 " intid int(10) unsigned NOT NULL DEFAULT '0',"
4939 " class varchar(64) NOT NULL DEFAULT '',"
4940 " itemtype varchar(128) NOT NULL DEFAULT '',"
4941 " parentid int(10) unsigned NOT NULL DEFAULT '0',"
4942 " itemproperties varchar(255) NOT NULL DEFAULT '',"
4943 " filepath varchar(512) NOT NULL DEFAULT '',"
4944 " title varchar(255) NOT NULL DEFAULT '',"
4945 " filename varchar(512) NOT NULL DEFAULT '',"
4946 " coverart varchar(512) NOT NULL DEFAULT '',"
4947 " PRIMARY KEY (intid),"
4948 " KEY class (class),"
4949 " KEY filepath (filepath(333)),"
4950 " KEY parentid (parentid)"
4951 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4952 "CREATE TABLE videocast ("
4953 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4954 " cast varchar(128) NOT NULL,"
4955 " PRIMARY KEY (intid)"
4956 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4957 "CREATE TABLE videocategory ("
4958 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4959 " category varchar(128) NOT NULL,"
4960 " PRIMARY KEY (intid)"
4961 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4962 "CREATE TABLE videocollection ("
4963 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4964 " title varchar(256) NOT NULL,"
4965 " contenttype set('MOVIE','TELEVISION','ADULT','MUSICVIDEO','HOMEVIDEO') NOT NULL DEFAULT '',"
4967 " network varchar(128) DEFAULT NULL,"
4968 " collectionref varchar(128) NOT NULL,"
4969 " certification varchar(128) DEFAULT NULL,"
4970 " genre varchar(128) DEFAULT '',"
4971 " releasedate date DEFAULT NULL,"
4972 " `language` varchar(10) DEFAULT NULL,"
4973 " `status` varchar(64) DEFAULT NULL,"
4974 " rating float DEFAULT '0',"
4975 " ratingcount int(10) DEFAULT '0',"
4976 " runtime smallint(5) unsigned DEFAULT '0',"
4980 " PRIMARY KEY (intid),"
4981 " KEY title (title)"
4982 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4983 "CREATE TABLE videocountry ("
4984 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4985 " country varchar(128) NOT NULL,"
4986 " PRIMARY KEY (intid)"
4987 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4988 "CREATE TABLE videogenre ("
4989 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4990 " genre varchar(128) NOT NULL,"
4991 " PRIMARY KEY (intid)"
4992 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4993 "CREATE TABLE videometadata ("
4994 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4995 " title varchar(128) NOT NULL,"
4996 " subtitle text NOT NULL,"
4997 " tagline varchar(255) DEFAULT NULL,"
4998 " director varchar(128) NOT NULL,"
4999 " studio varchar(128) DEFAULT NULL,"
5001 " rating varchar(128) NOT NULL,"
5002 " inetref varchar(255) NOT NULL,"
5003 " collectionref int(10) NOT NULL DEFAULT '-1',"
5004 " homepage text NOT NULL,"
5005 " `year` int(10) unsigned NOT NULL,"
5006 " releasedate date NOT NULL,"
5007 " userrating float NOT NULL,"
5008 " length int(10) unsigned NOT NULL,"
5009 " playcount int(10) NOT NULL DEFAULT '0',"
5010 " season smallint(5) unsigned NOT NULL DEFAULT '0',"
5011 " episode smallint(5) unsigned NOT NULL DEFAULT '0',"
5012 " showlevel int(10) unsigned NOT NULL,"
5013 " filename text NOT NULL,"
5014 " `hash` varchar(128) NOT NULL,"
5015 " coverfile text NOT NULL,"
5016 " childid int(11) NOT NULL DEFAULT '-1',"
5017 " browse tinyint(1) NOT NULL DEFAULT '1',"
5018 " watched tinyint(1) NOT NULL DEFAULT '0',"
5019 " processed tinyint(1) NOT NULL DEFAULT '0',"
5020 " playcommand varchar(255) DEFAULT NULL,"
5021 " category int(10) unsigned NOT NULL DEFAULT '0',"
5023 " `host` text NOT NULL,"
5027 " insertdate timestamp NULL DEFAULT CURRENT_TIMESTAMP,"
5028 " contenttype set('MOVIE','TELEVISION','ADULT','MUSICVIDEO','HOMEVIDEO') NOT NULL DEFAULT '',"
5029 " PRIMARY KEY (intid),"
5030 " KEY director (director),"
5031 " KEY title (title)"
5032 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
5033 "CREATE TABLE videometadatacast ("
5034 " idvideo int(10) unsigned NOT NULL,"
5035 " idcast int(10) unsigned NOT NULL,"
5036 " UNIQUE KEY idvideo (idvideo,idcast)"
5037 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
5038 "CREATE TABLE videometadatacountry ("
5039 " idvideo int(10) unsigned NOT NULL,"
5040 " idcountry int(10) unsigned NOT NULL,"
5041 " UNIQUE KEY idvideo_2 (idvideo,idcountry),"
5042 " KEY idvideo (idvideo),"
5043 " KEY idcountry (idcountry)"
5044 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
5045 "CREATE TABLE videometadatagenre ("
5046 " idvideo int(10) unsigned NOT NULL,"
5047 " idgenre int(10) unsigned NOT NULL,"
5048 " UNIQUE KEY idvideo_2 (idvideo,idgenre),"
5049 " KEY idvideo (idvideo),"
5050 " KEY idgenre (idgenre)"
5051 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
5052 "CREATE TABLE videopart ("
5053 " fileid bigint(20) unsigned NOT NULL,"
5054 " videoid int(10) unsigned NOT NULL,"
5055 " `order` smallint(5) unsigned NOT NULL DEFAULT '1',"
5056 " PRIMARY KEY (videoid,`order`)"
5057 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
5058 "CREATE TABLE videopathinfo ("
5059 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
5061 " contenttype set('MOVIE','TELEVISION','ADULT','MUSICVIDEO','HOMEVIDEO') NOT NULL DEFAULT '',"
5062 " collectionref int(10) DEFAULT '0',"
5063 " recurse tinyint(1) DEFAULT '0',"
5064 " PRIMARY KEY (intid)"
5065 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
5066 "CREATE TABLE videosource ("
5067 " sourceid int(10) unsigned NOT NULL AUTO_INCREMENT,"
5068 " `name` varchar(128) NOT NULL DEFAULT '',"
5069 " xmltvgrabber varchar(128) DEFAULT NULL,"
5070 " userid varchar(128) NOT NULL DEFAULT '',"
5071 " freqtable varchar(16) NOT NULL DEFAULT 'default',"
5072 " lineupid varchar(64) DEFAULT NULL,"
5073 " `password` varchar(64) DEFAULT NULL,"
5074 " useeit smallint(6) NOT NULL DEFAULT '0',"
5075 " configpath varchar(4096) DEFAULT NULL,"
5076 " dvb_nit_id int(6) DEFAULT '-1',"
5077 " PRIMARY KEY (sourceid),"
5078 " UNIQUE KEY `name` (`name`)"
5079 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
5080 "CREATE TABLE videotypes ("
5081 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
5082 " extension varchar(128) NOT NULL,"
5083 " playcommand varchar(255) NOT NULL,"
5084 " f_ignore tinyint(1) DEFAULT NULL,"
5085 " use_default tinyint(1) DEFAULT NULL,"
5086 " PRIMARY KEY (intid)"
5087 ") ENGINE=MyISAM AUTO_INCREMENT=33 DEFAULT CHARSET=utf8;",
5089 "INSERT INTO channelgroupnames VALUES (1,'Favorites');",
5090 R
"(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);)",
"INSERT INTO dtv_privatetypes VALUES ('dvb',9018,'channel_numbers','131');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',9018,'guide_fixup','2');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',256,'guide_fixup','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',257,'guide_fixup','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',256,'tv_types','1,150,134,133');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',257,'tv_types','1,150,134,133');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4100,'sdt_mapping','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4101,'sdt_mapping','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4102,'sdt_mapping','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4103,'sdt_mapping','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4104,'sdt_mapping','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4105,'sdt_mapping','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4106,'sdt_mapping','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4107,'sdt_mapping','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4097,'sdt_mapping','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4098,'sdt_mapping','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4100,'tv_types','1,145,154');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4101,'tv_types','1,145,154');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4102,'tv_types','1,145,154');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4103,'tv_types','1,145,154');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4104,'tv_types','1,145,154');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4105,'tv_types','1,145,154');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4106,'tv_types','1,145,154');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4107,'tv_types','1,145,154');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4097,'tv_types','1,145,154');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4098,'tv_types','1,145,154');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4100,'guide_fixup','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4101,'guide_fixup','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4102,'guide_fixup','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4103,'guide_fixup','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4104,'guide_fixup','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4105,'guide_fixup','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4106,'guide_fixup','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4107,'guide_fixup','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4096,'guide_fixup','5');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4097,'guide_fixup','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4098,'guide_fixup','1');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',94,'tv_types','1,128');",
"INSERT INTO dtv_privatetypes VALUES ('atsc',1793,'guide_fixup','3');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',40999,'guide_fixup','4');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',70,'force_guide_present','yes');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',70,'guide_ranges','80,80,96,96');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4112,'channel_numbers','131');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4115,'channel_numbers','131');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4116,'channel_numbers','131');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',12802,'channel_numbers','131');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',12803,'channel_numbers','131');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',12829,'channel_numbers','131');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',40999,'parse_subtitle_list','1070,1308,1041,1306,1307,1030,1016,1131,1068,1069');",
"INSERT INTO dtv_privatetypes VALUES ('dvb',4096,'guide_fixup','5');",
"INSERT INTO dvdinput VALUES (1,720,480,16,9,1,1,'ntsc');",
"INSERT INTO dvdinput VALUES (2,720,480,16,9,1,0,'ntsc');",
"INSERT INTO dvdinput VALUES (3,720,480,4,3,1,1,'ntsc');",
"INSERT INTO dvdinput VALUES (4,720,480,4,3,1,0,'ntsc');",
"INSERT INTO dvdinput VALUES (5,720,576,16,9,3,1,'pal');",
"INSERT INTO dvdinput VALUES (6,720,576,16,9,3,0,'pal');",
"INSERT INTO dvdinput VALUES (7,720,576,4,3,3,1,'pal');",
"INSERT INTO dvdinput VALUES (8,720,576,4,3,3,0,'pal');",
"INSERT INTO dvdtranscode VALUES (1,1,'Good',2,1,16,16,0,0,2,0,0,0,0,0,32,32,8,8,'divx5',NULL,1618,NULL,NULL,0,NULL);",
"INSERT INTO dvdtranscode VALUES (2,2,'Excellent',2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'divx5',NULL,0,NULL,NULL,1,NULL);",
"INSERT INTO dvdtranscode VALUES (3,2,'Good',2,1,0,0,8,8,0,0,0,0,0,0,0,0,0,0,'divx5',NULL,1618,NULL,NULL,0,NULL);",
"INSERT INTO dvdtranscode VALUES (4,2,'Medium',2,1,0,0,8,8,5,5,0,0,0,0,0,0,0,0,'divx5',NULL,1200,NULL,NULL,0,NULL);",
"INSERT INTO dvdtranscode VALUES (5,3,'Good',2,1,0,0,0,0,0,0,0,0,2,0,80,80,8,8,'divx5',NULL,0,NULL,NULL,0,NULL);",
"INSERT INTO dvdtranscode VALUES (6,4,'Excellent',2,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,'divx5',NULL,0,NULL,NULL,1,NULL);",
"INSERT INTO dvdtranscode VALUES (7,4,'Good',2,1,0,0,8,8,0,2,0,0,0,0,0,0,0,0,'divx5',NULL,1618,NULL,NULL,0,NULL);",
"INSERT INTO dvdtranscode VALUES (8,5,'Good',1,1,16,16,0,0,5,0,0,0,0,0,40,40,8,8,'divx5',NULL,1618,NULL,NULL,0,NULL);",
"INSERT INTO dvdtranscode VALUES (9,6,'Good',1,1,0,0,16,16,5,0,0,0,0,0,0,0,0,0,'divx5',NULL,1618,NULL,NULL,0,NULL);",
"INSERT INTO dvdtranscode VALUES (10,7,'Good',1,1,0,0,0,0,1,0,0,0,0,0,76,76,8,8,'divx5',NULL,1618,NULL,NULL,0,NULL);",
"INSERT INTO dvdtranscode VALUES (11,8,'Good',1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,'divx5',NULL,1618,NULL,NULL,0,NULL);",
"INSERT INTO playgroup VALUES ('Default','',30,5,100,0);",
"INSERT INTO profilegroups VALUES (1,'Software Encoders (v4l based)','V4L',1,NULL);",
"INSERT INTO profilegroups VALUES (2,'IVTV MPEG-2 Encoders','MPEG',1,NULL);",
"INSERT INTO profilegroups VALUES (3,'Hardware MJPEG Encoders (Matrox G200-TV, Miro DC10, etc)','MJPEG',1,NULL);",
"INSERT INTO profilegroups VALUES (4,'Hardware HDTV','HDTV',1,NULL);",
"INSERT INTO profilegroups VALUES (5,'Hardware DVB Encoders','DVB',1,NULL);",
"INSERT INTO profilegroups VALUES (6,'Transcoders','TRANSCODE',1,NULL);",
"INSERT INTO profilegroups VALUES (7,'FireWire Input','FIREWIRE',1,NULL);",
"INSERT INTO profilegroups VALUES (8,'USB Mpeg-4 Encoder (Plextor ConvertX, etc)','GO7007',1,NULL);",
"INSERT INTO profilegroups VALUES (14,'Import Recorder','IMPORT',1,NULL);",
"INSERT INTO profilegroups VALUES (10,'Freebox Input','Freebox',1,NULL);",
"INSERT INTO profilegroups VALUES (11,'HDHomeRun Recorders','HDHOMERUN',1,NULL);",
"INSERT INTO profilegroups VALUES (12,'CRC IP Recorders','CRC_IP',1,NULL);",
"INSERT INTO profilegroups VALUES (13,'HD-PVR Recorders','HDPVR',1,NULL);",
"INSERT INTO profilegroups VALUES (15,'ASI Recorder (DVEO)','ASI',1,NULL);",
"INSERT INTO profilegroups VALUES (16,'OCUR Recorder (CableLabs)','OCUR',1,NULL);",
"INSERT INTO profilegroups VALUES (17,'Ceton Recorder','CETON',1,NULL);",
"INSERT INTO record VALUES (1,11,0,'21:57:44','2012-08-11','21:57:44','2012-08-11','Default (Template)','','',0,0,'Default','Default',0,0,0,0,0,0,'Default',6,15,'','','','',0,0,1,0,0,0,0,1,-1,'00:00:00',735091,0,0,0,'Default',0,'0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','Default',100,0);",
"INSERT INTO recordfilter VALUES (0,'New episode','program.previouslyshown = 0',0);",
"INSERT INTO recordfilter VALUES (1,'Identifiable episode','program.generic = 0',0);",
"INSERT INTO recordfilter VALUES (2,'First showing','program.first > 0',0);",
R"(INSERT INTO recordfilter VALUES (3,'Prime time','HOUR(CONVERT_TZ(program.starttime, \'Etc/UTC\', \'SYSTEM\')) >= 19 AND HOUR(CONVERT_TZ(program.starttime, \'Etc/UTC\', \'SYSTEM\')) < 22',0);)",
"INSERT INTO recordfilter VALUES (4,'Commercial free','channel.commmethod = -2',0);",
"INSERT INTO recordfilter VALUES (5,'High definition','program.hdtv > 0',0);",
R"(INSERT INTO recordfilter VALUES (6,'This episode','(RECTABLE.programid <> \'\' AND program.programid = RECTABLE.programid) OR (RECTABLE.programid = \'\' AND program.subtitle = RECTABLE.subtitle AND program.description = RECTABLE.description)',0);)",
"INSERT INTO recordfilter VALUES (7,'This series','(RECTABLE.seriesid <> \\'\\' AND program.seriesid = RECTABLE.seriesid)',0);",
"INSERT INTO recordingprofiles VALUES (1,'Default',NULL,NULL,1);",
"INSERT INTO recordingprofiles VALUES (2,'Live TV',NULL,NULL,1);",
"INSERT INTO recordingprofiles VALUES (3,'High Quality',NULL,NULL,1);",
"INSERT INTO recordingprofiles VALUES (4,'Low Quality',NULL,NULL,1);",
"INSERT INTO recordingprofiles VALUES (5,'Default',NULL,NULL,2);",
"INSERT INTO recordingprofiles VALUES (6,'Live TV',NULL,NULL,2);",
"INSERT INTO recordingprofiles VALUES (7,'High Quality',NULL,NULL,2);",
"INSERT INTO recordingprofiles VALUES (8,'Low Quality',NULL,NULL,2);",
"INSERT INTO recordingprofiles VALUES (9,'Default',NULL,NULL,3);",
"INSERT INTO recordingprofiles VALUES (10,'Live TV',NULL,NULL,3);",
"INSERT INTO recordingprofiles VALUES (11,'High Quality',NULL,NULL,3);",
"INSERT INTO recordingprofiles VALUES (12,'Low Quality',NULL,NULL,3);",
"INSERT INTO recordingprofiles VALUES (13,'Default',NULL,NULL,4);",
"INSERT INTO recordingprofiles VALUES (14,'Live TV',NULL,NULL,4);",
"INSERT INTO recordingprofiles VALUES (15,'High Quality',NULL,NULL,4);",
"INSERT INTO recordingprofiles VALUES (16,'Low Quality',NULL,NULL,4);",
"INSERT INTO recordingprofiles VALUES (17,'Default',NULL,NULL,5);",
"INSERT INTO recordingprofiles VALUES (18,'Live TV',NULL,NULL,5);",
"INSERT INTO recordingprofiles VALUES (19,'High Quality',NULL,NULL,5);",
"INSERT INTO recordingprofiles VALUES (20,'Low Quality',NULL,NULL,5);",
"INSERT INTO recordingprofiles VALUES (21,'RTjpeg/MPEG4',NULL,NULL,6);",
"INSERT INTO recordingprofiles VALUES (22,'MPEG2',NULL,NULL,6);",
"INSERT INTO recordingprofiles VALUES (23,'Default',NULL,NULL,8);",
"INSERT INTO recordingprofiles VALUES (24,'Live TV',NULL,NULL,8);",
"INSERT INTO recordingprofiles VALUES (25,'High Quality',NULL,NULL,8);",
"INSERT INTO recordingprofiles VALUES (26,'Low Quality',NULL,NULL,8);",
"INSERT INTO recordingprofiles VALUES (27,'High Quality',NULL,NULL,6);",
"INSERT INTO recordingprofiles VALUES (28,'Medium Quality',NULL,NULL,6);",
"INSERT INTO recordingprofiles VALUES (29,'Low Quality',NULL,NULL,6);",
"INSERT INTO recordingprofiles VALUES (30,'Default',NULL,NULL,10);",
"INSERT INTO recordingprofiles VALUES (31,'Live TV',NULL,NULL,10);",
"INSERT INTO recordingprofiles VALUES (32,'High Quality',NULL,NULL,10);",
"INSERT INTO recordingprofiles VALUES (33,'Low Quality',NULL,NULL,10);",
"INSERT INTO recordingprofiles VALUES (34,'Default',NULL,NULL,11);",
"INSERT INTO recordingprofiles VALUES (35,'Live TV',NULL,NULL,11);",
"INSERT INTO recordingprofiles VALUES (36,'High Quality',NULL,NULL,11);",
"INSERT INTO recordingprofiles VALUES (37,'Low Quality',NULL,NULL,11);",
"INSERT INTO recordingprofiles VALUES (38,'Default',NULL,NULL,12);",
"INSERT INTO recordingprofiles VALUES (39,'Live TV',NULL,NULL,12);",
"INSERT INTO recordingprofiles VALUES (40,'High Quality',NULL,NULL,12);",
"INSERT INTO recordingprofiles VALUES (41,'Low Quality',NULL,NULL,12);",
"INSERT INTO recordingprofiles VALUES (42,'Default',NULL,NULL,7);",
"INSERT INTO recordingprofiles VALUES (43,'Live TV',NULL,NULL,7);",
"INSERT INTO recordingprofiles VALUES (44,'High Quality',NULL,NULL,7);",
"INSERT INTO recordingprofiles VALUES (45,'Low Quality',NULL,NULL,7);",
"INSERT INTO recordingprofiles VALUES (46,'Default',NULL,NULL,9);",
"INSERT INTO recordingprofiles VALUES (47,'Live TV',NULL,NULL,9);",
"INSERT INTO recordingprofiles VALUES (48,'High Quality',NULL,NULL,9);",
"INSERT INTO recordingprofiles VALUES (49,'Low Quality',NULL,NULL,9);",
"INSERT INTO recordingprofiles VALUES (50,'Default',NULL,NULL,13);",
"INSERT INTO recordingprofiles VALUES (51,'Live TV',NULL,NULL,13);",
"INSERT INTO recordingprofiles VALUES (52,'High Quality',NULL,NULL,13);",
"INSERT INTO recordingprofiles VALUES (53,'Low Quality',NULL,NULL,13);",
"INSERT INTO recordingprofiles VALUES (54,'Default',NULL,NULL,14);",
"INSERT INTO recordingprofiles VALUES (55,'Live TV',NULL,NULL,14);",
"INSERT INTO recordingprofiles VALUES (56,'High Quality',NULL,NULL,14);",
"INSERT INTO recordingprofiles VALUES (57,'Low Quality',NULL,NULL,14);",
"INSERT INTO recordingprofiles VALUES (58,'Default',NULL,NULL,15);",
"INSERT INTO recordingprofiles VALUES (59,'Live TV',NULL,NULL,15);",
"INSERT INTO recordingprofiles VALUES (60,'High Quality',NULL,NULL,15);",
"INSERT INTO recordingprofiles VALUES (61,'Low Quality',NULL,NULL,15);",
"INSERT INTO recordingprofiles VALUES (62,'Default',NULL,NULL,16);",
"INSERT INTO recordingprofiles VALUES (63,'Live TV',NULL,NULL,16);",
"INSERT INTO recordingprofiles VALUES (64,'High Quality',NULL,NULL,16);",
"INSERT INTO recordingprofiles VALUES (65,'Low Quality',NULL,NULL,16);",
"INSERT INTO recordingprofiles VALUES (66,'Default',NULL,NULL,17);",
"INSERT INTO recordingprofiles VALUES (67,'Live TV',NULL,NULL,17);",
"INSERT INTO recordingprofiles VALUES (68,'High Quality',NULL,NULL,17);",
"INSERT INTO recordingprofiles VALUES (69,'Low Quality',NULL,NULL,17);",
"INSERT INTO settings VALUES ('mythfilldatabaseLastRunStart','',NULL);",
"INSERT INTO settings VALUES ('mythfilldatabaseLastRunEnd','',NULL);",
"INSERT INTO settings VALUES ('mythfilldatabaseLastRunStatus','',NULL);",
"INSERT INTO settings VALUES ('DataDirectMessage','',NULL);",
"INSERT INTO settings VALUES ('HaveRepeats','0',NULL);",
"INSERT INTO settings VALUES ('DBSchemaVer','1307',NULL);",
"INSERT INTO settings VALUES ('DefaultTranscoder','0',NULL);",
"INSERT INTO videotypes VALUES (1,'txt','',1,0);",
"INSERT INTO videotypes VALUES (2,'log','',1,0);",
"INSERT INTO videotypes VALUES (3,'mpg','Internal',0,0);",
"INSERT INTO videotypes VALUES (4,'avi','',0,1);",
"INSERT INTO videotypes VALUES (5,'vob','Internal',0,0);",
"INSERT INTO videotypes VALUES (6,'mpeg','Internal',0,0);",
"INSERT INTO videotypes VALUES (8,'iso','Internal',0,0);",
"INSERT INTO videotypes VALUES (9,'img','Internal',0,0);",
"INSERT INTO videotypes VALUES (10,'mkv','Internal',0,0);",
"INSERT INTO videotypes VALUES (11,'mp4','Internal',0,0);",
"INSERT INTO videotypes VALUES (12,'m2ts','Internal',0,0);",
"INSERT INTO videotypes VALUES (13,'evo','Internal',0,0);",
"INSERT INTO videotypes VALUES (14,'divx','Internal',0,0);",
"INSERT INTO videotypes VALUES (15,'mov','Internal',0,0);",
"INSERT INTO videotypes VALUES (16,'qt','Internal',0,0);",
"INSERT INTO videotypes VALUES (17,'wmv','Internal',0,0);",
"INSERT INTO videotypes VALUES (18,'3gp','Internal',0,0);",
"INSERT INTO videotypes VALUES (19,'asf','Internal',0,0);",
"INSERT INTO videotypes VALUES (20,'ogg','Internal',0,0);",
"INSERT INTO videotypes VALUES (21,'ogm','Internal',0,0);",
"INSERT INTO videotypes VALUES (22,'flv','Internal',0,0);",
"INSERT INTO videotypes VALUES (23,'ogv','Internal',0,0);",
"INSERT INTO videotypes VALUES (25,'nut','Internal',0,0);",
"INSERT INTO videotypes VALUES (26,'mxf','Internal',0,0);",
"INSERT INTO videotypes VALUES (27,'m4v','Internal',0,0);",
"INSERT INTO videotypes VALUES (28,'rm','Internal',0,0);",
"INSERT INTO videotypes VALUES (29,'ts','Internal',0,0);",
"INSERT INTO videotypes VALUES (30,'swf','Internal',0,0);",
"INSERT INTO videotypes VALUES (31,'f4v','Internal',0,0);",
"INSERT INTO videotypes VALUES (32,'nuv','Internal',0,0);"
5094 if (!performActualUpdate("MythTV", "DBSchemaVer",
5095 updates, "1307", dbver))
5098 GetMythDB()->SetHaveSchema(true);
5103 DBUpdates getRecordingExtenderDbInfo (int version)
5109 R"(DROP TABLE IF EXISTS sportscleanup;)",
5110 R"(DROP TABLE IF EXISTS sportslisting;)",
5111 R"(DROP TABLE IF EXISTS sportsapi;)",
5116 R
"(ALTER TABLE record ADD COLUMN autoextend
5117 TINYINT UNSIGNED DEFAULT 0;)",
5122 R
"(CREATE TABLE sportsapi (
5123 id INT UNSIGNED PRIMARY KEY,
5124 provider TINYINT UNSIGNED DEFAULT 0,
5125 name VARCHAR(128) NOT NULL,
5126 key1 VARCHAR(64) NOT NULL,
5127 key2 VARCHAR(64) NOT NULL,
5128 UNIQUE(provider,key1(25),key2(50))
5129 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;)",
5130 R"(INSERT INTO sportsapi
5132 ( 1,1,"Major League Baseball","baseball","mlb"),
5133 ( 2,1,"NCAA Men's Baseball","baseball","college-baseball"),
5134 ( 3,1,"NCAA Women's Softball","baseball","college-softball"),
5135 ( 4,1,"Olympic Men's Baseball","baseball","olympics-baseball"),
5136 ( 5,1,"World Baseball Classic","baseball","world-baseball-classic"),
5137 ( 6,1,"Little League Baseball","baseball","llb"),
5138 ( 7,1,"Caribbean Series","baseball","caribbean-series"),
5139 ( 8,1,"Dominican Winter League","baseball","dominican-winter-league"),
5140 ( 9,1,"Venezuelan Winter League","baseball","venezuelan-winter-league"),
5141 ( 10,1,"Mexican League","baseball","mexican-winter-league"),
5142 ( 11,1,"Puerto Rican Winter League","baseball","puerto-rican-winter-league");)",
5144 R"(INSERT INTO sportsapi
5146 ( 20,1,"National Football League","football","nfl"),
5147 ( 21,1,"NCAA - Football","football","college-football"),
5148 ( 22,1,"XFL","football","xfl"),
5149 ( 23,1,"Canadian Football League","football","cfl");)",
5151 R"(INSERT INTO sportsapi
5153 ( 40,1,"National Basketball Association","basketball","nba"),
5154 ( 41,1,"Women's National Basketball Association","basketball","wnba"),
5155 ( 42,1,"NCAA Men's Basketball","basketball","mens-college-basketball"),
5156 ( 43,1,"NCAA Women's Basketball","basketball","womens-college-basketball"),
5157 ( 44,1,"Olympics Men's Basketball","basketball","mens-olympic-basketball"),
5158 ( 45,1,"Olympics Women's Basketball","basketball","womens-olympic-basketball"),
5159 ( 46,1,"National Basketball Association Summer League Las Vegas","basketball","nba-summer-las-vegas"),
5160 ( 47,1,"National Basketball Association Summer League Utah","basketball","nba-summer-utah"),
5161 ( 48,1,"National Basketball Association Summer League Orlando","basketball","nba-summer-orlando"),
5162 ( 49,1,"National Basketball Association Summer League Sacramento","basketball","nba-summer-sacramento"),
5163 ( 50,1,"NBA G League","basketball","nba-development"),
5164 ( 51,1,"International Basketball Federation","basketball","fiba");)",
5166 R"(INSERT INTO sportsapi
5168 ( 60,1,"National Hockey League","hockey","nfl"),
5169 ( 61,1,"NCAA Men's Ice Hockey","hockey","mens-college-hockey"),
5170 ( 62,1,"NCAA Women's Hockey","hockey","womens-college-hockey"),
5171 ( 63,1,"World Cup of Hockey","hockey","hockey-world-cup"),
5172 ( 64,1,"Men's Olympic Ice Hockey","hockey","mens-olympic-hockey"),
5173 ( 65,1,"Women's Olympic Ice Hockey","hockey","womens-olympic-hockey"),
5174 ( 66,1,"NCAA Women's Field Hockey","field-hockey","womens-college-field-hockey");)",
5176 R"(INSERT INTO sportsapi
5178 ( 80,1,"NCAA Men's Volleyball","volleyball","mens-college-volleyball"),
5179 ( 81,1,"NCAA Women's Volleyball","volleyball","womens-college-volleyball");)",
5181 R"(INSERT INTO sportsapi
5183 ( 100,1,"NCAA Men's Lacrosse","lacrosse","mens-college-lacrosse"),
5184 ( 101,1,"NCAA Women's Lacrosse","lacrosse","womens-college-lacrosse");)",
5186 R"(INSERT INTO sportsapi
5188 ( 120,1,"NCAA Men's Water Polo","water-polo","mens-college-water-polo"),
5189 ( 121,1,"NCAA Women's Water Polo","water-polo","womens-college-water-polo");)",
5191 R"(INSERT INTO sportsapi
5193 ( 200,1,"NCAA Men's Soccer","soccer","usa.ncaa.m.1"),
5194 ( 201,1,"NCAA Women's Soccer","soccer","usa.ncaa.w.1"),
5195 ( 202,1,"Major League Soccer","soccer","usa.1"),
5196 ( 203,1,"English Premier League","soccer","eng.1"),
5197 ( 204,1,"English League Championship","soccer","eng.2"),
5198 ( 205,1,"Italian Serie A","soccer","ita.1"),
5199 ( 206,1,"French Ligue 1","soccer","fra.1"),
5200 ( 207,1,"French Ligue 2","soccer","fra.2"),
5201 ( 208,1,"Spanish LaLiga","soccer","esp.1"),
5202 ( 209,1,"German Bundesliga","soccer","ger.1"),
5203 ( 210,1,"German 2. Bundesliga","soccer","ger.2"),
5204 ( 211,1,"Mexican Liga BBVA MX","soccer","mex.1"),
5205 ( 212,1,"Copa Do Brasil","soccer","bra.copa_do_brazil"),
5206 ( 213,1,"CONCACAF Leagues Cup","soccer","concacaf.leagues.cup"),
5207 ( 214,1,"CONCACAF League","soccer","concacaf.league"),
5208 ( 215,1,"CONCACAF Champions League","soccer","concacaf.champions"),
5209 ( 216,1,"CONCACAF Nations League","soccer","concacaf.nations.league"),
5210 ( 217,1,"CONCACAF Gold Cup","soccer","concacaf.gold"),
5211 ( 218,1,"FIFA World Cup","soccer","fifa.world"),
5212 ( 219,1,"FIFA World Cup Qualifying - UEFA","soccer","fifa.worldq.uefa"),
5213 ( 220,1,"FIFA World Cup Qualifying - CONCACAF","soccer","fifa.worldq.concacaf"),
5214 ( 221,1,"FIFA World Cup Qualifying - CONMEBOL","soccer","fifa.worldq.conmebol"),
5215 ( 222,1,"FIFA World Cup Qualifying - AFC","soccer","fifa.worldq.afc"),
5216 ( 223,1,"FIFA World Cup Qualifying - CAF","soccer","fifa.worldq.caf"),
5217 ( 224,1,"FIFA World Cup Qualifying - OFC","soccer","fifa.worldq.ofc"),
5218 ( 225,1,"UEFA Champions League","soccer","uefa.champions"),
5219 ( 226,1,"UEFA Europa League","soccer","uefa.europa"),
5220 ( 227,1,"UEFA Europa Conference League","soccer","uefa.europa.conf"),
5221 ( 228,1,"English Carabao Cup","soccer","eng.league_cup"),
5222 ( 229,1,"USL Championship","soccer","usa.usl.1"),
5223 ( 230,1,"United States NWSL","soccer","usa.nwsl"),
5224 ( 231,1,"FA Women's Super League","soccer","eng.w.1"),
5225 ( 232,1,"English FA Cup","soccer","eng.fa"),
5226 ( 233,1,"Spanish Copa del Rey","soccer","esp.copa_del_rey"),
5227 ( 234,1,"German DFB Pokal","soccer","ger.dfb_pokal"),
5228 ( 235,1,"Italian Coppa Italia","soccer","ita.coppa_italia"),
5229 ( 236,1,"French Coupe de France","soccer","fra.coupe_de_france"),
5230 ( 237,1,"AFC Champions League","soccer","afc.champions"),
5231 ( 238,1,"Dutch KNVB Beker","soccer","ned.cup"),
5232 ( 239,1,"Dutch Eredivisie","soccer","ned.1"),
5233 ( 240,1,"Portuguese Liga","soccer","por.1"),
5234 ( 241,1,"Russian Premier League","soccer","rus.1"),
5235 ( 242,1,"Mexican Liga de Expansión MX","soccer","mex.2"),
5236 ( 243,1,"Mexican Copa MX","soccer","mex.copa_mx"),
5237 ( 244,1,"Campeones Cup","soccer","campeones.cup"),
5238 ( 245,1,"United States Open Cup","soccer","usa.open"),
5239 ( 246,1,"USL League One","soccer","usa.usl.l1"),
5240 ( 247,1,"Scottish Premiership","soccer","sco.1"),
5241 ( 248,1,"Chinese Super League","soccer","chn.1"),
5242 ( 249,1,"Australian A-League","soccer","aus.1"),
5243 ( 250,1,"International Friendly","soccer","fifa.friendly"),
5244 ( 251,1,"Women's International Friendly","soccer","fifa.friendly.w"),
5245 ( 252,1,"UEFA European Under-21 Championship Qualifying","soccer","uefa.euro_u21_qual"),
5246 ( 253,1,"FIFA Women's World Cup","soccer","fifa.wwc"),
5247 ( 254,1,"FIFA Club World Cup","soccer","fifa.cwc"),
5248 ( 255,1,"CONCACAF Gold Cup Qualifying","soccer","concacaf.gold_qual"),
5249 ( 256,1,"CONCACAF Nations League Qualifying","soccer","concacaf.nations.league_qual"),
5250 ( 257,1,"CONCACAF Cup","soccer","concacaf.confederations_playoff"),
5251 ( 258,1,"UEFA Nations League","soccer","uefa.nations"),
5252 ( 259,1,"UEFA European Championship","soccer","uefa.euro"),
5253 ( 260,1,"UEFA European Championship Qualifying","soccer","uefa.euroq"),
5254 ( 261,1,"Copa America","soccer","conmebol.america"),
5255 ( 262,1,"AFC Asian Cup","soccer","afc.asian.cup"),
5256 ( 263,1,"AFC Asian Cup Qualifiers","soccer","afc.cupq"),
5257 ( 264,1,"Africa Cup of Nations qualifying","soccer","caf.nations_qual"),
5258 ( 265,1,"Africa Cup of Nations","soccer","caf.nations"),
5259 ( 266,1,"Africa Nations Championship","soccer","caf.championship"),
5260 ( 267,1,"WAFU Cup of Nations","soccer","wafu.nations"),
5261 ( 268,1,"SheBelieves Cup","soccer","fifa.shebelieves"),
5262 ( 269,1,"FIFA Confederations Cup","soccer","fifa.confederations"),
5263 ( 270,1,"Non-FIFA Friendly","soccer","nonfifa"),
5264 ( 271,1,"Spanish LaLiga 2","soccer","esp.2"),
5265 ( 272,1,"Spanish Supercopa","soccer","esp.super_cup"),
5266 ( 273,1,"Portuguese Liga Promotion/Relegation Playoffs","soccer","por.1.promotion.relegation"),
5267 ( 274,1,"Belgian First Division A - Promotion/Relegation Playoffs","soccer","bel.promotion.relegation"),
5268 ( 275,1,"Belgian First Division A","soccer","bel.1"),
5269 ( 276,1,"Austrian Bundesliga","soccer","aut.1"),
5270 ( 277,1,"Turkish Super Lig","soccer","tur.1"),
5271 ( 278,1,"Austrian Bundesliga Promotion/Relegation Playoffs","soccer","aut.promotion.relegation"),
5272 ( 279,1,"Greek Super League","soccer","gre.1"),
5273 ( 280,1,"Greek Super League Promotion/Relegation Playoffs","soccer","gre.1.promotion.relegation"),
5274 ( 281,1,"Swiss Super League","soccer","sui.1"),
5275 ( 282,1,"Swiss Super League Promotion/Relegation Playoffs","soccer","sui.1.promotion.relegation"),
5276 ( 283,1,"UEFA Women's Champions League","soccer","uefa.wchampions"),
5277 ( 284,1,"International Champions Cup","soccer","global.champs_cup"),
5278 ( 285,1,"Women's International Champions Cup","soccer","global.wchamps_cup"),
5279 ( 286,1,"Club Friendly","soccer","club.friendly"),
5280 ( 287,1,"UEFA Champions League Qualifying","soccer","uefa.champions_qual"),
5281 ( 288,1,"UEFA Europa Conference League Qualifying","soccer","uefa.europa.conf_qual"),
5282 ( 289,1,"UEFA Europa League Qualifying","soccer","uefa.europa_qual"),
5283 ( 290,1,"UEFA Super Cup","soccer","uefa.super_cup"),
5284 ( 291,1,"English FA Community Shield","soccer","eng.charity"),
5285 ( 292,1,"Supercoppa Italiana","soccer","ita.super_cup"),
5286 ( 293,1,"French Trophee des Champions","soccer","fra.super_cup"),
5287 ( 294,1,"Dutch Johan Cruyff Shield","soccer","ned.supercup"),
5288 ( 295,1,"Trofeo Joan Gamper","soccer","esp.joan_gamper"),
5289 ( 296,1,"German DFL-Supercup","soccer","ger.super_cup"),
5290 ( 297,1,"Audi Cup","soccer","ger.audi_cup"),
5291 ( 298,1,"Premier League Asia Trophy","soccer","eng.asia_trophy"),
5292 ( 299,1,"Emirates Cup","soccer","friendly.emirates_cup"),
5293 ( 300,1,"Japanese J League World Challenge","soccer","jpn.world_challenge"),
5294 ( 301,1,"SuperCopa Euroamericana","soccer","euroamericana.supercopa"),
5295 ( 302,1,"Men's Olympic Tournament","soccer","fifa.olympics"),
5296 ( 303,1,"Women's Olympic Tournament","soccer","fifa.w.olympics"),
5297 ( 304,1,"CONMEBOL Pre-Olympic Tournament","soccer","fifa.conmebol.olympicsq"),
5298 ( 305,1,"CONCACAF Men's Olympic Qualifying","soccer","fifa.concacaf.olympicsq"),
5299 ( 306,1,"CONCACAF Women's Olympic Qualifying Tournament","soccer","fifa.w.concacaf.olympicsq"),
5300 ( 307,1,"CONCACAF Women's Championship","soccer","concacaf.womens.championship"),
5301 ( 308,1,"FIFA Under-20 World Cup","soccer","fifa.world.u20"),
5302 ( 309,1,"FIFA Under-17 World Cup","soccer","fifa.world.u17"),
5303 ( 310,1,"Toulon Tournament","soccer","global.toulon"),
5304 ( 311,1,"UEFA European Under-21 Championship","soccer","uefa.euro_u21"),
5305 ( 312,1,"UEFA European Under-19 Championship","soccer","uefa.euro.u19"),
5306 ( 313,1,"Under-21 International Friendly","soccer","fifa.friendly_u21"),
5307 ( 314,1,"UEFA Women's European Championship","soccer","uefa.weuro"),
5308 ( 315,1,"German Bundesliga Promotion/Relegation Playoff","soccer","ger.playoff.relegation"),
5309 ( 316,1,"German 2. Bundesliga Promotion/Relegation Playoffs","soccer","ger.2.promotion.relegation"),
5310 ( 317,1,"English Women's FA Cup","soccer","eng.w.fa"),
5311 ( 318,1,"English Women's FA Community Shield","soccer","eng.w.charity"),
5312 ( 319,1,"English EFL Trophy","soccer","eng.trophy"),
5313 ( 320,1,"English National League","soccer","eng.5"),
5314 ( 321,1,"English League One","soccer","eng.3"),
5315 ( 322,1,"English League Two","soccer","eng.4"),
5316 ( 323,1,"Scottish Cup","soccer","sco.tennents"),
5317 ( 324,1,"Scottish League Cup","soccer","sco.cis"),
5318 ( 325,1,"Scottish Premiership Promotion/Relegation Playoffs","soccer","sco.1.promotion.relegation"),
5319 ( 326,1,"Scottish League One","soccer","sco.3"),
5320 ( 327,1,"Scottish Championship","soccer","sco.2"),
5321 ( 328,1,"Scottish Championship Promotion/Relegation Playoffs","soccer","sco.2.promotion.relegation"),
5322 ( 329,1,"Scottish League One Promotion/Relegation Playoffs","soccer","sco.3.promotion.relegation"),
5323 ( 330,1,"Scottish League Two Promotion/Relegation Playoffs","soccer","sco.4.promotion.relegation"),
5324 ( 331,1,"Scottish League Two","soccer","sco.4"),
5325 ( 332,1,"Scottish League Challenge Cup","soccer","sco.challenge"),
5326 ( 333,1,"Dutch Eredivisie Promotion/Relegation Playoffs","soccer","ned.playoff.relegation"),
5327 ( 334,1,"Dutch Eredivisie Cup","soccer","ned.w.eredivisie_cup"),
5328 ( 335,1,"Dutch Keuken Kampioen Divisie","soccer","ned.2"),
5329 ( 336,1,"Dutch Tweede Divisie","soccer","ned.3"),
5330 ( 337,1,"Dutch KNVB Beker Vrouwen","soccer","ned.w.knvb_cup"),
5331 ( 338,1,"Dutch Vrouwen Eredivisie","soccer","ned.w.1"),
5332 ( 339,1,"Italian Serie B","soccer","ita.2"),
5333 ( 340,1,"French Ligue 1 Promotion/Relegation Playoffs","soccer","fra.1.promotion.relegation"),
5334 ( 341,1,"French Ligue 2 Promotion/Relegation Playoffs","soccer","fra.2.promotion.relegation"),
5335 ( 342,1,"Swedish Allsvenskan","soccer","swe.1"),
5336 ( 343,1,"Swedish Allsvenskanliga Promotion/Relegation Playoffs","soccer","swe.1.promotion.relegation"),
5337 ( 344,1,"Danish Superliga","soccer","den.1"),
5338 ( 345,1,"Danish SAS-Ligaen Promotion/Relegation Playoffs","soccer","den.promotion.relegation"),
5339 ( 346,1,"Romanian Liga 1 Promotion/Relegation Playoffs","soccer","rou.1.promotion.relegation"),
5340 ( 347,1,"Romanian Liga 1","soccer","rou.1"),
5341 ( 348,1,"Norwegian Eliteserien Promotion/Relegation Playoffs","soccer","nor.1.promotion.relegation"),
5342 ( 349,1,"Norwegian Eliteserien","soccer","nor.1"),
5343 ( 350,1,"Maltese Premier League","soccer","mlt.1"),
5344 ( 351,1,"Israeli Premier League","soccer","isr.1"),
5345 ( 352,1,"Irish Premier Division Promotion/Relegation Playoffs","soccer","ir1.1.promotion.relegation"),
5346 ( 353,1,"Irish Premier Division","soccer","irl.1"),
5347 ( 354,1,"Welsh Premier League","soccer","wal.1"),
5348 ( 355,1,"Northern Irish Premiership","soccer","nir.1"),
5349 ( 356,1,"CONMEBOL Copa Libertadores","soccer","conmebol.libertadores"),
5350 ( 357,1,"CONMEBOL Copa Sudamericana","soccer","conmebol.sudamericana"),
5351 ( 358,1,"CONMEBOL Recopa Sudamericana","soccer","conmebol.recopa"),
5352 ( 359,1,"Argentine Liga Profesional de Fútbol","soccer","arg.1"),
5353 ( 360,1,"Copa Argentina","soccer","arg.copa"),
5354 ( 361,1,"Argentine Copa de la Liga Profesional","soccer","arg.copa_lpf"),
5355 ( 362,1,"Argentine Copa de la Superliga","soccer","arg.copa_de_la_superliga"),
5356 ( 363,1,"Argentine Trofeo de Campeones de la Superliga","soccer","arg.trofeo_de_la_campeones"),
5357 ( 364,1,"Argentine Supercopa","soccer","arg.supercopa"),
5358 ( 365,1,"Argentine Nacional B","soccer","arg.2"),
5359 ( 366,1,"Argentine Primera B","soccer","arg.3"),
5360 ( 367,1,"Argentine Primera C","soccer","arg.4"),
5361 ( 368,1,"Argentine Primera D","soccer","arg.5"),
5362 ( 369,1,"Supercopa Do Brazil","soccer","bra.supercopa_do_brazil"),
5363 ( 370,1,"Brazilian Serie A","soccer","bra.1"),
5364 ( 371,1,"Brazilian Serie B","soccer","bra.2"),
5365 ( 372,1,"Brazilian Serie C","soccer","bra.3"),
5366 ( 373,1,"Copa Do Nordeste","soccer","bra.copa_do_nordeste"),
5367 ( 374,1,"Brazilian Campeonato Carioca","soccer","bra.camp.carioca"),
5368 ( 375,1,"Brazilian Campeonato Paulista","soccer","bra.camp.paulista"),
5369 ( 376,1,"Brazilian Campeonato Gaucho","soccer","bra.camp.gaucho"),
5370 ( 377,1,"Brazilian Campeonato Mineiro","soccer","bra.camp.mineiro"),
5371 ( 378,1,"Chilean Primera División","soccer","chi.1"),
5372 ( 379,1,"Copa Chile","soccer","chi.copa_chi"),
5373 ( 380,1,"International U20 Friendly","soccer","fifa.u20.friendly"),
5374 ( 381,1,"Segunda División de Chile","soccer","chi.2"),
5375 ( 382,1,"Chilean Supercopa","soccer","chi.super_cup"),
5376 ( 383,1,"Uruguayan Primera Division","soccer","uru.1"),
5377 ( 384,1,"Segunda División de Uruguay","soccer","uru.2"),
5378 ( 385,1,"Colombian SuperLiga","soccer","col.superliga"),
5379 ( 386,1,"Colombian Primera A","soccer","col.1"),
5380 ( 387,1,"Colombian Primera B","soccer","col.2"),
5381 ( 388,1,"Peruvian Supercopa","soccer","per.supercopa"),
5382 ( 389,1,"Copa Colombia","soccer","col.copa"),
5383 ( 390,1,"Peruvian Primera Profesional","soccer","per.1"),
5384 ( 391,1,"Paraguayan Primera Division","soccer","par.1"),
5385 ( 392,1,"Ecuadoran Primera A","soccer","ecu.1"),
5386 ( 393,1,"Ecuadoran Supercopa","soccer","ecu.supercopa"),
5387 ( 394,1,"Ecuador Serie B","soccer","ecu.2"),
5388 ( 395,1,"Venezuelan Primera Profesional","soccer","ven.1"),
5389 ( 396,1,"United States NWSL Challenge Cup","soccer","usa.nwsl.cup"),
5390 ( 397,1,"Segunda División de Venezuela","soccer","ven.2"),
5391 ( 398,1,"Bolivian Liga Profesional","soccer","bol.1"),
5392 ( 399,1,"Mexican Supercopa MX","soccer","mex.supercopa"),
5393 ( 400,1,"Mexican Campeon de Campeones","soccer","mex.campeon"),
5394 ( 401,1,"CONCACAF Champions Cup","soccer","concacaf.champions_cup"),
5395 ( 402,1,"CONCACAF U23 Tournament","soccer","concacaf.u23"),
5396 ( 403,1,"Honduran Primera Division","soccer","hon.1"),
5397 ( 404,1,"Costa Rican Primera Division","soccer","crc.1"),
5398 ( 405,1,"Jamaican Premier League","soccer","jam.1"),
5399 ( 406,1,"Guatemalan Liga Nacional","soccer","gua.1"),
5400 ( 407,1,"Australian W-League","soccer","aus.w.1"),
5401 ( 408,1,"Salvadoran Primera Division","soccer","slv.1"),
5402 ( 409,1,"AFF Cup","soccer","aff.championship"),
5403 ( 410,1,"AFC Cup","soccer","afc.cup"),
5404 ( 411,1,"SAFF Championship","soccer","afc.saff.championship"),
5405 ( 412,1,"Chinese Super League Promotion/Relegation Playoffs","soccer","chn.1.promotion.relegation"),
5406 ( 413,1,"Japanese J League","soccer","jpn.1"),
5407 ( 414,1,"Indonesian Liga 1","soccer","idn.1"),
5408 ( 415,1,"Indian Super League","soccer","ind.1"),
5409 ( 416,1,"Indian I-League","soccer","ind.2"),
5410 ( 417,1,"Malaysian Super League","soccer","mys.1"),
5411 ( 418,1,"Singaporean Premier League","soccer","sgp.1"),
5412 ( 419,1,"Thai League 1","soccer","tha.1"),
5413 ( 420,1,"Bangabandhu Cup","soccer","bangabandhu.cup"),
5414 ( 421,1,"COSAFA Cup","soccer","caf.cosafa"),
5415 ( 422,1,"CAF Champions League","soccer","caf.champions"),
5416 ( 423,1,"South African Premiership Promotion/Relegation Playoffs","soccer","rsa.1.promotion.relegation"),
5417 ( 424,1,"CAF Confederations Cup","soccer","caf.confed"),
5418 ( 425,1,"South African Premiership","soccer","rsa.1"),
5419 ( 426,1,"South African First Division","soccer","rsa.2"),
5420 ( 427,1,"South African Telkom Knockout","soccer","rsa.telkom_knockout"),
5421 ( 428,1,"South African Nedbank Cup","soccer","rsa.nedbank"),
5422 ( 429,1,"MTN 8 Cup","soccer","rsa.mtn8"),
5423 ( 430,1,"Nigerian Professional League","soccer","nga.1"),
5424 ( 431,1,"Ghanaian Premier League","soccer","gha.1"),
5425 ( 432,1,"Zambian Super League","soccer","zam.1"),
5426 ( 433,1,"Kenyan Premier League","soccer","ken.1"),
5427 ( 434,1,"Zimbabwean Premier Soccer League","soccer","zim.1"),
5428 ( 435,1,"Ugandan Premier League","soccer","uga.1"),
5429 ( 436,1,"Misc. U.S. Soccer Games","soccer","generic.ussf");)",
5431 R"(INSERT INTO sportsapi
5433 (1000,2,"Major League Baseball","baseball","mlb");)",
5435 R"(CREATE TABLE sportslisting (
5436 id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
5437 api INT UNSIGNED NOT NULL,
5438 title VARCHAR(128) NOT NULL
5439 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;)",
5441 R"(INSERT INTO sportslisting (api,title)
5443 ( 1, "\\A(?:MLB Baseball)\\z"),
5444 ( 1, "\\A(?:Béisbol MLB)\\z"),
5445 ( 1, "\\A(?:MLB All-Star Game)\\z"),
5446 ( 1, "\\A(?:World Series)\\z"),
5447 ( 2, "\\A(?:College Baseball)\\z"),
5448 ( 2, "\\A(?:College World Series)\\z"),
5449 ( 3, "\\A(?:College Softball)\\z"),
5450 ( 4, "\\A(?:Women's College World Series)\\z"),
5451 ( 10, "\\A(?:Béisbol Liga Mexicana)\\z"),
5453 ( 20, "\\A(?:N\\w+ Football)\\z"),
5454 ( 20, "\\A(?:Super Bowl( [CLXVI]+)?)\\z"),
5455 ( 20, "\\A(?:Fútbol Americano NFL)\\z"),
5456 ( 21, "\\A(?:College Football)\\z"),
5457 ( 21, "\\A(?:\\w+ Bowl)\\z"),
5458 ( 21, "\\A(?:Fútbol Americano de Universitario)\\z"),
5460 ( 40, "\\A(?:NBA Basketball)\\z"),
5461 ( 40, "\\A(?:NBA Finals)\\z"),
5462 ( 41, "\\A(?:WNBA Basketball)\\z"),
5463 ( 41, "\\A(?:WNBA Finals)\\z"),
5464 ( 42, "\\A(?:College Basketball)\\z"),
5465 ( 42, "\\A(?:NCAA Basketball Tournament)\\z"),
5466 ( 43, "\\A(?:Women's College Basketball)\\z"),
5467 ( 43, "\\A(?:NCAA Women's Basketball Tournament)\\z"),
5469 ( 60, "\\A(?:NHL Hockey)\\z"),
5470 ( 60, "\\A(?:NHL Winter Classic)\\z"),
5471 ( 60, "\\A(?:NHL \\w+ Conference Final)\\z"),
5472 ( 60, "\\A(?:Stanley Cup Finals)\\z"),
5473 ( 61, "\\A(?:College Hockey)\\z"),
5474 ( 61, "\\A(?:Frozen Four)\\z"),
5475 ( 62, "\\A(?:Women's College Hockey)\\z"),
5476 ( 66, "\\A(?:College Field Hockey)\\z"),
5478 ( 80, "\\A(?:College Volleyball)\\z"),
5479 ( 81, "\\A(?:Women's College Volleyball)\\z"),
5481 ( 100, "\\A(?:College Lacrosse)\\z"),
5482 ( 101, "\\A(?:Women's College Lacrosse)\\z"),
5484 ( 120, "\\A(?:College Water Polo)\\z"),
5485 ( 121, "\\A(?:Women's College Water Polo)\\z"),
5487 ( 200, "\\A(?:College Soccer)\\z"),
5488 ( 201, "\\A(?:Women's College Soccer)\\z"),
5489 ( 202, "\\A(?:MLS Soccer|Fútbol MLS)\\z"),
5490 ( 203, "\\A(?:(Premier League|EPL) Soccer)\\z"),
5491 ( 203, "\\A(?:English Premier League)\\z"),
5492 ( 203, "\\A(?:Fútbol Premier League)\\z"),
5493 ( 205, "\\A(?:Italian Serie A Soccer)\\z"),
5494 ( 339, "\\A(?:Italian Serie B Soccer)\\z"),
5495 ( 206, "\\A(?:French Ligue 1 Soccer|Fútbol Ligue 1|Fútbol Liga 1)\\z"),
5496 ( 207, "\\A(?:French Ligue 2 Soccer|Fútbol Ligue 2|Fútbol Liga 2)\\z"),
5497 ( 208, "\\A(?:Fútbol LaLiga)\\z"),
5498 ( 208, "\\A(?:Fútbol Español Primera Division)\\z"),
5499 ( 208, "\\A(?:Spanish Primera Division Soccer)\\z"),
5500 ( 209, "\\A(?:(German )?Bundesliga Soccer)\\z"),
5501 ( 209, "\\A(?:Fútbol Bundesliga)\\z"),
5502 ( 209, "\\A(?:Fútbol Copa de Alemania)\\z"),
5503 ( 210, "\\A(?:German 2. Bundesliga Soccer)\\z"),
5504 ( 211, "\\A(?:Fútbol Mexicano Primera División|Fútbol Mexicano Liga Premier|Fútbol Mexicano)\\z"),
5505 ( 211, "\\A(?:Mexico Primera Division Soccer)\\z"),
5506 ( 212, "\\A(?:Copa do Brazil Soccer)\\z"),
5507 ( 214, "\\A(?:CONCACAF League Soccer)\\z"),
5508 ( 215, "\\A(?:CONCACAF Champions League Soccer)\\z"),
5509 ( 216, "\\A(?:CONCACAF Nations League Soccer)\\z"),
5510 ( 217, "\\A(?:CONCACAF Gold Cup Soccer)\\z"),
5511 ( 218, "\\A(?:FIFA World Cup Soccer)\\z"),
5512 ( 219, "\\A(?:FIFA World Cup Qualifying( Soccer)?|FIFA Eliminatorias Copa Mundial)\\z"),
5513 ( 220, "\\A(?:FIFA World Cup Qualifying( Soccer)?|FIFA Eliminatorias Copa Mundial)\\z"),
5514 ( 221, "\\A(?:FIFA World Cup Qualifying( Soccer)?|FIFA Eliminatorias Copa Mundial)\\z"),
5515 ( 222, "\\A(?:FIFA World Cup Qualifying( Soccer)?|FIFA Eliminatorias Copa Mundial)\\z"),
5516 ( 223, "\\A(?:FIFA World Cup Qualifying( Soccer)?|FIFA Eliminatorias Copa Mundial)\\z"),
5517 ( 224, "\\A(?:FIFA World Cup Qualifying( Soccer)?|FIFA Eliminatorias Copa Mundial)\\z"),
5518 ( 225, "\\A(?:Fútbol UEFA Champions League)\\z"),
5519 ( 225, "\\A(?:UEFA Champions League Soccer)\\z"),
5520 ( 226, "\\A(?:Fútbol UEFA Europa League)\\z"),
5521 ( 229, "\\A(?:Fútbol USL Championship)\\z"),
5522 ( 229, "\\A(?:USL Championship Soccer)\\z"),
5523 ( 230, "\\A(?:NWSL Soccer)\\z"),
5524 ( 231, "\\A(?:FA Women's Super League)\\z"),
5525 ( 242, "\\A(?:Fútbol Mexicano Liga Expansión)\\z"),
5526 ( 258, "\\A(?:UEFA Nations League Soccer)\\z"),
5527 ( 258, "\\A(?:Fútbol UEFA Nations League)\\z"),
5528 ( 271, "\\A(?:Fútbol Español Segunda Division)\\z"),
5529 ( 277, "\\A(?:Fútbol Turco Superliga)\\z"),
5530 ( 277, "\\A(?:Turkish Super Lig Soccer)\\z"),
5531 ( 279, "\\A(?:Superleague Greek Soccer)\\z"),
5532 ( 356, "\\A(?:Fútbol CONMEBOL Libertadores)\\z"),
5533 ( 357, "\\A(?:Fútbol CONMEBOL Sudamericana)\\z"),
5534 ( 359, "\\A(?:Fútbol Argentino Primera División)\\z"),
5535 ( 360, "\\A(?:Fútbol Copa Argentina)\\z"),
5536 ( 365, "\\A(?:Fútbol Argentino Primera Nacional( B)?)\\z"),
5537 ( 366, "\\A(?:Fútbol Argentino Primera B)\\z"),
5538 ( 367, "\\A(?:Fútbol Argentino Primera C)\\z"),
5539 ( 368, "\\A(?:Fútbol Argentino Primera D)\\z"),
5540 ( 386, "\\A(?:Fútbol Columbiano Primera División)\\z"),
5541 ( 403, "\\A(?:Fútbol Hondureño Primera División)\\z"),
5542 ( 404, "\\A(?:Fútbol Costarricense Primera División)\\z"),
5544 (1000, "\\A(?:MLB Baseball)\\z"),
5545 (1000, "\\A(?:Béisbol MLB)\\z");
5548 R"(CREATE TABLE sportscleanup (
5549 id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
5550 provider TINYINT UNSIGNED DEFAULT 0,
5551 weight INT UNSIGNED NOT NULL,
5552 key1 VARCHAR(256) NOT NULL,
5553 name VARCHAR(256) NOT NULL,
5554 pattern VARCHAR(256) NOT NULL,
5555 nth TINYINT UNSIGNED NOT NULL,
5556 replacement VARCHAR(128) NOT NULL
5557 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;)",
5575 R
"A(INSERT INTO sportscleanup (provider,weight,key1,name,pattern,nth,replacement)
5577 (1,1000,"soccer", "(SE)", "\\(\\w+\\)", 0, ""),
5578 (1,1000,"soccer", "AFC", "\\AA\\.?F\\.?C\\.?|\\bA\\.?F\\.?C\\.?\\Z", 0, ""),
5579 (1,1000,"soccer", "AC etc.", "\\AA\\.?[AC]\\.?|\\bA\\.?[AC]\\.?\\Z", 0, ""),
5580 (1,1000,"soccer", "BK", "\\AB\\.?K\\.?|\\bB\\.?K\\.?\\Z", 0, ""),
5581 (1,1000,"soccer", "BSC", "\\AB\\.?S\\.?C\\.?|\\bB\\.?S\\.?C\\.?\\Z", 0, ""),
5582 (1,1000,"soccer", "CSyD", "\\AC\\.?S\\.?( y )?D\\.?|\\bC\\.?S\\.?( y )?D\\.?\\Z", 0, ""),
5583 (1,1000,"soccer", "CD etc.", "\\AC\\.?[ADFRS]\\.?|\\bC\\.?[ADFRS]\\.?\\Z", 0, ""),
5584 (1,1000,"soccer", "FC", "\\AF\\.?C\\.?|\\bF\\.?C\\.?\\Z", 0, ""),
5585 (1,1000,"soccer", "HSC", "\\AH\\.?S\\.?C\\.?|\\bH\\.?S\\.?C\\.?\\Z", 0, ""),
5586 (1,1000,"soccer", "RC etc.", "\\AR\\.?[BC]\\.?|\\bR\\.?[BC]\\.?\\Z", 0, ""),
5587 (1,1000,"soccer", "SC etc.", "\\AS\\.?[ACV]\\.?|\\bS\\.?[ACV]\\.?\\Z", 0, ""),
5588 (1,1000,"soccer", "TSG", "\\AT\\.?S\\.?G\\.?|\\bT\\.?S\\.?G\\.?\\Z", 0, ""),
5589 (1,1000,"soccer", "VFB etc.", "\\AV\\.?F\\.?[BL]\\.?|\\bV\\.?F\\.?[BL]\\.?\\Z", 0, ""),
5590 (1,2000,"all", "", "Inglaterra", 0, "England"),
5591 (1,2000,"all", "", "Munchen", 0, "Munich");
5599 R
"A(INSERT INTO sportscleanup (provider,weight,key1,name,pattern,nth,replacement)
5601 (1,1100,"basketball", "Cal State", "Cal State", 0, "CSU"),
5602 (1,1000,"basketball", "Grambling", "Grambling State", 0, "Grambling"),
5603 (1,1000,"basketball", "Hawaii", "Hawaii", 0, "Hawai'i"),
5604 (1,1000,"basketball", "LIU", "LIU", 0, "Long Island University"),
5605 (1,1100,"basketball", "Loyola", "Loyola-", 0, "Loyola "),
5606 (1,1000,"basketball", "Loyola (Md.)", "Loyola \(Md.\)", 0, "Loyola (MD)"),
5607 (1,1000,"basketball", "McNeese", "McNeese State", 0, "McNeese"),
5608 (1,1000,"basketball", "Miami (OH)", "Miami \(Ohio\)", 0, "Miami (OH)"),
5609 (1,1000,"basketball", "UAB", "Alabama-Birmingham", 0, "UAB"),
5610 (1,1000,"basketball", "UConn", "Connecticut", 0, "UConn"),
5611 (1,1000,"basketball", "UMass", "Massachusetts", 0, "UMass"),
5612 (1,1100,"basketball", "UNC", "UNC-", 0, "UNC "),
5613 (1,1000,"basketball", "UTEP", "Texas-El Paso", 0, "UTEP"),
5614 (1,1100,"basketball", "Texas", "Texas-", 0, "UT "),
5615 (1,1000,"basketball", "Chattanooga", "UT-Chattanooga", 0, "Chattanooga"),
5616 (1,1100,"basketball", "UT", "UT-", 0, "UT ");