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 [[maybe_unused]]
const bool informSystemd)
365 #ifdef IGNORE_SCHEMA_VER_MISMATCH
372 GetMythDB()->SetSuppressDBMessages(
true);
378 for (
uint i = 0; i < 2*60 && !locked; i++)
382 LOG(VB_GENERAL, LOG_INFO,
"Waiting for database schema upgrade lock");
385 LOG(VB_GENERAL, LOG_INFO,
"Got schema upgrade lock");
389 LOG(VB_GENERAL, LOG_INFO,
"Failed to get schema upgrade lock");
390 goto upgrade_error_exit;
396 if (schema_wizard->
Compare() == 0)
397 goto upgrade_ok_exit;
400 LOG(VB_GENERAL, LOG_WARNING,
"Not allowed to upgrade the database.");
409 goto upgrade_ok_exit;
412 goto upgrade_error_exit;
417 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Newest MythTV Schema Version : %1")
425 LOG(VB_GENERAL, LOG_ERR,
"Database schema upgrade failed.");
426 goto upgrade_error_exit;
429 LOG(VB_GENERAL, LOG_INFO,
"Database schema upgrade complete.");
439 GetMythDB()->SetSuppressDBMessages(
false);
448 GetMythDB()->SetSuppressDBMessages(
false);
472 auto ss2ba = [](
const auto & ss){
return QByteArray::fromStdString(ss); };
473 auto qs2ba = [](
const auto & item){
return item.constData(); };
474 auto add_start_end = [order](
const auto & field){
475 return QString(
"UPDATE %1 "
476 "SET starttime = CONVERT_TZ(starttime, 'SYSTEM', 'Etc/UTC'), "
477 " endtime = CONVERT_TZ(endtime, 'SYSTEM', 'Etc/UTC') "
479 .arg(QString::fromStdString(field)).arg(order).toLocal8Bit(); };
480 auto add_start = [order](
const auto & field){
481 return QString(
"UPDATE %1 "
482 "SET starttime = CONVERT_TZ(starttime, 'SYSTEM', 'Etc/UTC') "
484 .arg(QString::fromStdString(field)).arg(order).toLocal8Bit(); };
495 if (!query.
exec(QString(
"ALTER DATABASE %1 DEFAULT "
496 "CHARACTER SET utf8 COLLATE utf8_general_ci;")
510 if (dbver.isEmpty() || dbver.toInt() < 1027)
512 LOG(VB_GENERAL, LOG_ERR,
"Unrecognized database schema version. "
513 "Unable to upgrade database.");
516 if (dbver.toInt() < 1244)
518 LOG(VB_GENERAL, LOG_ERR,
"Your database version is too old to upgrade "
519 "with this version of MythTV. You will need "
520 "to use mythtv-setup from MythTV 0.22, 0.23, "
521 "or 0.24 to upgrade your database before "
522 "upgrading to this version of MythTV.");
529 "ALTER TABLE cardinput DROP COLUMN freetoaironly;",
530 "ALTER TABLE cardinput DROP COLUMN radioservices;"
533 updates,
"1245", dbver))
540 "DELETE FROM capturecard WHERE cardtype = 'DBOX2';",
541 "DELETE FROM profilegroups WHERE cardtype = 'DBOX2';",
542 "ALTER TABLE capturecard DROP COLUMN dbox2_port;",
543 "ALTER TABLE capturecard DROP COLUMN dbox2_httpport;",
544 "ALTER TABLE capturecard DROP COLUMN dbox2_host;"
547 updates,
"1246", dbver))
554 "ALTER TABLE recorded ADD COLUMN bookmarkupdate timestamp default 0 NOT NULL",
555 "UPDATE recorded SET bookmarkupdate = lastmodified+1 WHERE bookmark = 1",
556 "UPDATE recorded SET bookmarkupdate = lastmodified WHERE bookmark = 0"
559 updates,
"1247", dbver))
566 "INSERT INTO profilegroups SET name = \"Import Recorder\", cardtype = 'IMPORT', is_default = 1;",
567 "INSERT INTO recordingprofiles SET name = \"Default\", profilegroup = 14;",
568 "INSERT INTO recordingprofiles SET name = \"Live TV\", profilegroup = 14;",
569 "INSERT INTO recordingprofiles SET name = \"High Quality\", profilegroup = 14;",
570 "INSERT INTO recordingprofiles SET name = \"Low Quality\", profilegroup = 14;"
573 updates,
"1248", dbver))
580 "DELETE FROM keybindings WHERE action = 'CUSTOMEDIT' "
581 "AND context = 'TV Frontend' AND keylist = 'E';"
584 updates,
"1249", dbver))
590 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1250");
593 select.
prepare(
"SELECT hostname, data FROM settings "
594 " WHERE value = 'StickyKeys'");
603 while (select.
next())
606 QString sticky_keys = select.
value(1).toString();
608 if (
"1" == sticky_keys)
611 update.
prepare(
"UPDATE keybindings "
612 " SET keylist = :KEYS "
613 " WHERE context = 'TV Playback' AND "
614 " action = :ACTION AND "
615 " hostname = :HOSTNAME AND "
616 " keylist = :DEFAULT_KEYS");
618 QString keylist =
"";
619 QString
action =
"SEEKFFWD";
620 QString default_keys =
"Right";
625 update.
bindValue(
":DEFAULT_KEYS", default_keys);
632 default_keys =
"Left";
637 update.
bindValue(
":DEFAULT_KEYS", default_keys);
642 keylist =
">,.,Right";
644 default_keys =
">,.";
649 update.
bindValue(
":DEFAULT_KEYS", default_keys);
654 keylist =
",,<,Left";
656 default_keys =
",,<";
661 update.
bindValue(
":DEFAULT_KEYS", default_keys);
676 "UPDATE recorded SET bookmark = 1 WHERE bookmark != 0;"
679 updates,
"1251", dbver))
685 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1252");
688 query.
prepare(
"SHOW INDEX FROM recgrouppassword");
693 "recgrouppassword.", query);
699 QString index_name = query.
value(2).toString();
701 if (
"recgroup" == index_name)
704 update.
prepare(
"ALTER TABLE recgrouppassword "
705 " DROP INDEX recgroup");
710 "recgrouppassword. Ignoring.",
724 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1253");
727 select.
prepare(
"SELECT hostname, data FROM settings "
728 " WHERE value = 'StickyKeys'");
737 while (select.
next())
740 QString sticky_keys = select.
value(1).toString();
742 if (
"1" == sticky_keys)
745 update.
prepare(
"UPDATE keybindings "
746 " SET keylist = :KEYS "
747 " WHERE context = 'TV Playback' AND "
748 " action = :ACTION AND "
749 " hostname = :HOSTNAME AND "
750 " keylist = :DEFAULT_KEYS");
752 QString keylist =
">,.";
753 QString
action =
"FFWDSTICKY";
754 QString default_keys =
">,.,Right";
759 update.
bindValue(
":DEFAULT_KEYS", default_keys);
766 default_keys =
",,<,Left";
771 update.
bindValue(
":DEFAULT_KEYS", default_keys);
788 LOG(VB_GENERAL, LOG_CRIT,
789 "Upgrading to MythTV schema version 1254");
796 "ALTER TABLE videosource ADD dvb_nit_id INT(6) DEFAULT -1;"
799 updates,
"1254", dbver))
807 "ALTER TABLE cardinput DROP COLUMN shareable;"
810 updates,
"1255", dbver))
817 "INSERT INTO keybindings (SELECT 'Main Menu', 'EXIT', 'System Exit', "
818 "(CASE data WHEN '1' THEN 'Ctrl+Esc' WHEN '2' THEN 'Meta+Esc' "
819 "WHEN '3' THEN 'Alt+Esc' WHEN '4' THEN 'Esc' ELSE '' END), hostname "
820 "FROM settings WHERE value = 'AllowQuitShutdown' GROUP BY hostname) "
821 "ON DUPLICATE KEY UPDATE keylist = VALUES(keylist);"
824 updates,
"1256", dbver))
831 "ALTER TABLE record DROP COLUMN tsdefault;"
834 updates,
"1257", dbver))
841 "CREATE TABLE internetcontent "
842 "( name VARCHAR(255) NOT NULL,"
843 " thumbnail VARCHAR(255),"
844 " type SMALLINT(3) NOT NULL,"
845 " author VARCHAR(128) NOT NULL,"
846 " description TEXT NOT NULL,"
847 " commandline TEXT NOT NULL,"
848 " version DOUBLE NOT NULL,"
849 " updated DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',"
850 " search BOOL NOT NULL,"
851 " tree BOOL NOT NULL,"
852 " podcast BOOL NOT NULL,"
853 " download BOOL NOT NULL,"
854 " host VARCHAR(128)) ENGINE=MyISAM DEFAULT CHARSET=utf8;",
855 "CREATE TABLE internetcontentarticles "
856 "( feedtitle VARCHAR(255) NOT NULL,"
857 " path TEXT NOT NULL,"
858 " paththumb TEXT NOT NULL,"
859 " title VARCHAR(255) NOT NULL,"
860 " subtitle VARCHAR(255) NOT NULL,"
861 " season SMALLINT(5) NOT NULL DEFAULT '0',"
862 " episode SMALLINT(5) NOT NULL DEFAULT '0',"
863 " description TEXT NOT NULL,"
864 " url TEXT NOT NULL,"
865 " type SMALLINT(3) NOT NULL,"
866 " thumbnail TEXT NOT NULL,"
867 " mediaURL TEXT NOT NULL,"
868 " author VARCHAR(255) NOT NULL,"
869 " date DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',"
870 " time INT NOT NULL,"
871 " rating VARCHAR(255) NOT NULL,"
872 " filesize BIGINT NOT NULL,"
873 " player VARCHAR(255) NOT NULL,"
874 " playerargs TEXT NOT NULL,"
875 " download VARCHAR(255) NOT NULL,"
876 " downloadargs TEXT NOT NULL,"
877 " width SMALLINT NOT NULL,"
878 " height SMALLINT NOT NULL,"
879 " language VARCHAR(128) NOT NULL,"
880 " podcast BOOL NOT NULL,"
881 " downloadable BOOL NOT NULL,"
882 " customhtml BOOL NOT NULL,"
883 " countries VARCHAR(255) NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8;"
886 updates,
"1258", dbver))
892 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1259");
895 select.
prepare(
"SELECT hostname, data FROM settings "
896 " WHERE value = 'IndividualMuteControl'");
906 while (select.
next())
909 QString individual_mute = select.
value(1).toString();
911 if (
"1" == individual_mute)
913 update.
prepare(
"DELETE FROM keybindings "
914 " WHERE action = 'CYCLEAUDIOCHAN' AND "
915 " hostname = :HOSTNAME AND "
916 " context IN ('TV Frontend', "
928 update.
prepare(
"UPDATE keybindings "
929 " SET action = 'CYCLEAUDIOCHAN', "
930 " description = 'Cycle audio channels'"
931 " WHERE action = 'MUTE' AND "
932 " hostname = :HOSTNAME AND "
933 " context IN ('TV Frontend', "
945 update.
prepare(
"REPLACE INTO keybindings "
946 " VALUES (:CONTEXT, 'MUTE', 'Mute', "
949 update.
bindValue(
":CONTEXT",
"TV Playback");
957 update.
bindValue(
":CONTEXT",
"TV Frontend");
975 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1260");
978 query.
prepare(
"DELETE FROM keybindings WHERE "
979 "action IN ('PAGEUP','PAGEDOWN') AND "
980 "context = 'TV FRONTEND'");
987 query.
prepare(
"SELECT data FROM settings "
988 " WHERE value = 'EPGEnableJumpToChannel'");
1000 QString EPGEnableJumpToChannel = query.
value(0).toString();
1002 if (
"1" == EPGEnableJumpToChannel)
1004 bindings.
prepare(
"SELECT action, context, hostname, keylist "
1005 " FROM keybindings "
1006 " WHERE action IN ('DAYLEFT', "
1007 " 'DAYRIGHT', 'TOGGLEEPGORDER') AND "
1008 " context IN ('TV Frontend', "
1011 if (!bindings.
exec())
1017 while (bindings.
next())
1020 QString context = bindings.
value(1).toString();
1022 QStringList oldKeylist = bindings.
value(3).toString().split(
',');
1023 QStringList newKeyList;
1025 QStringList::iterator it;
1026 for (it = oldKeylist.begin(); it != oldKeylist.end();++it)
1029 int num = (*it).toInt(&ok);
1030 if (!ok && num >= 0 && num <= 9)
1031 newKeyList << (*it);
1033 QString keyList = newKeyList.join(
",");
1036 update.
prepare(
"UPDATE keybindings "
1037 " SET keylist = :KEYLIST "
1038 " WHERE action = :ACTION "
1039 " AND context = :CONTEXT "
1040 " AND hostname = :HOSTNAME");
1061 if (dbver ==
"1260")
1065 LOG(VB_GENERAL, LOG_CRIT,
1066 "Upgrading to MythTV schema version 1261");
1074 "UPDATE recorded SET programid=CONCAT(SUBSTRING(programid, 1, 2), '00', "
1075 " SUBSTRING(programid, 3)) WHERE length(programid) = 12;",
1076 "UPDATE oldrecorded SET programid=CONCAT(SUBSTRING(programid, 1, 2), '00', "
1077 " SUBSTRING(programid, 3)) WHERE length(programid) = 12;",
1078 "UPDATE program SET programid=CONCAT(SUBSTRING(programid, 1, 2), '00', "
1079 " SUBSTRING(programid, 3)) WHERE length(programid) = 12;"
1082 updates,
"1261", dbver))
1087 if (dbver ==
"1261")
1090 "UPDATE program SET description = '' WHERE description IS NULL;",
1091 "UPDATE record SET description = '' WHERE description IS NULL;",
1092 "UPDATE recorded SET description = '' WHERE description IS NULL;",
1093 "UPDATE recordedprogram SET description = '' WHERE description IS NULL;",
1094 "UPDATE oldrecorded SET description = '' WHERE description IS NULL;",
1095 "UPDATE mythlog SET details = '' WHERE details IS NULL;",
1096 "UPDATE settings SET data = '' WHERE data IS NULL;",
1097 "UPDATE powerpriority SET selectclause = '' WHERE selectclause IS NULL;",
1098 "UPDATE customexample SET fromclause = '' WHERE fromclause IS NULL;",
1099 "UPDATE customexample SET whereclause = '' WHERE whereclause IS NULL;",
1101 "ALTER TABLE program MODIFY COLUMN description VARCHAR(16000) "
1102 " NOT NULL default '';",
1103 "ALTER TABLE record MODIFY COLUMN description VARCHAR(16000) "
1104 " NOT NULL default '';",
1105 "ALTER TABLE recorded MODIFY COLUMN description VARCHAR(16000) "
1106 " NOT NULL default '';",
1107 "ALTER TABLE recordedprogram MODIFY COLUMN description VARCHAR(16000) "
1108 " NOT NULL default '';",
1109 "ALTER TABLE oldrecorded MODIFY COLUMN description VARCHAR(16000) "
1110 " NOT NULL default '';",
1111 "ALTER TABLE mythlog MODIFY COLUMN details VARCHAR(16000) "
1112 " NOT NULL default '';",
1113 "ALTER TABLE settings MODIFY COLUMN data VARCHAR(16000) "
1114 " NOT NULL default '';",
1115 "ALTER TABLE powerpriority MODIFY COLUMN selectclause VARCHAR(16000) "
1116 " NOT NULL default '';",
1117 "ALTER TABLE customexample MODIFY COLUMN fromclause VARCHAR(10000) "
1118 " NOT NULL default '';",
1119 "ALTER TABLE customexample MODIFY COLUMN whereclause VARCHAR(10000) "
1120 " NOT NULL default '';"
1123 updates,
"1262", dbver))
1127 if (dbver ==
"1262")
1130 "INSERT INTO recgrouppassword (recgroup, password) SELECT 'All Programs',data FROM settings WHERE value='AllRecGroupPassword' LIMIT 1;",
1131 "DELETE FROM settings WHERE value='AllRecGroupPassword';"
1134 updates,
"1263", dbver))
1138 if (dbver ==
"1263")
1141 "UPDATE settings SET hostname = NULL WHERE value='ISO639Language0' AND data != 'aar' AND hostname IS NOT NULL LIMIT 1;",
1142 "UPDATE settings SET hostname = NULL WHERE value='ISO639Language1' AND data != 'aar' AND hostname IS NOT NULL LIMIT 1;",
1143 "DELETE FROM settings WHERE value='ISO639Language0' AND hostname IS NOT NULL;",
1144 "DELETE FROM settings WHERE value='ISO639Language1' AND hostname IS NOT NULL;"
1147 updates,
"1264", dbver))
1151 if (dbver ==
"1264")
1155 "DELETE FROM displayprofiles WHERE profilegroupid IN "
1156 " (SELECT profilegroupid FROM displayprofilegroups "
1157 " WHERE name IN ('CPU++', 'CPU+', 'CPU--'))",
1158 "DELETE FROM displayprofilegroups WHERE name IN ('CPU++', 'CPU+', 'CPU--')",
1159 "DELETE FROM settings WHERE value = 'DefaultVideoPlaybackProfile' "
1160 " AND data IN ('CPU++', 'CPU+', 'CPU--')",
1161 "UPDATE displayprofiles SET data = 'ffmpeg' WHERE data = 'libmpeg2'",
1162 "UPDATE displayprofiles SET data = 'ffmpeg' WHERE data = 'xvmc'",
1163 "UPDATE displayprofiles SET data = 'xv-blit' WHERE data = 'xvmc-blit'",
1164 "UPDATE displayprofiles SET data = 'softblend' WHERE data = 'ia44blend'"
1167 updates,
"1265", dbver))
1171 if (dbver ==
"1265")
1174 "ALTER TABLE dtv_multiplex MODIFY COLUMN updatetimestamp "
1175 " TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;",
1176 "ALTER TABLE dvdbookmark MODIFY COLUMN `timestamp` "
1177 " TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;",
1178 "ALTER TABLE jobqueue MODIFY COLUMN statustime "
1179 " TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;",
1180 "ALTER TABLE recorded MODIFY COLUMN lastmodified "
1181 " TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;"
1184 updates,
"1266", dbver))
1188 if (dbver ==
"1266")
1194 "DELETE FROM settings WHERE value = 'mythvideo.DBSchemaVer'"
1197 updates,
"1267", dbver))
1201 if (dbver ==
"1267")
1204 "ALTER TABLE channel MODIFY xmltvid VARCHAR(255) NOT NULL DEFAULT '';"
1207 updates,
"1268", dbver))
1211 if (dbver ==
"1268")
1215 "DELETE FROM keybindings WHERE action='PREVSOURCE' AND keylist='Ctrl+Y';"
1218 updates,
"1269", dbver))
1222 if (dbver ==
"1269")
1225 "DELETE FROM profilegroups WHERE id >= 15;",
1226 "DELETE FROM recordingprofiles WHERE profilegroup >= 15;",
1228 "INSERT INTO profilegroups SET id = '15', name = 'ASI Recorder (DVEO)',"
1229 " cardtype = 'ASI', is_default = 1;",
1230 "INSERT INTO recordingprofiles SET name = \"Default\", profilegroup = 15;",
1231 "INSERT INTO recordingprofiles SET name = \"Live TV\", profilegroup = 15;",
1232 "INSERT INTO recordingprofiles SET name = \"High Quality\", profilegroup = 15;",
1233 "INSERT INTO recordingprofiles SET name = \"Low Quality\", profilegroup = 15;",
1234 "INSERT INTO profilegroups SET id = '16', name = 'OCUR Recorder (CableLabs)',"
1235 " cardtype = 'OCUR', is_default = 1;",
1236 "INSERT INTO recordingprofiles SET name = \"Default\", profilegroup = 16;",
1237 "INSERT INTO recordingprofiles SET name = \"Live TV\", profilegroup = 16;",
1238 "INSERT INTO recordingprofiles SET name = \"High Quality\", profilegroup = 16;",
1239 "INSERT INTO recordingprofiles SET name = \"Low Quality\", profilegroup = 16;"
1242 updates,
"1270", dbver))
1246 if (dbver ==
"1270")
1249 "ALTER TABLE oldrecorded ADD future TINYINT(1) NOT NULL DEFAULT 0;",
1250 "UPDATE oldrecorded SET future=0;"
1253 updates,
"1271", dbver))
1257 if (dbver ==
"1271")
1260 "ALTER TABLE recordmatch MODIFY recordid INT UNSIGNED NOT NULL;",
1261 "ALTER TABLE recordmatch MODIFY chanid INT UNSIGNED NOT NULL;",
1262 "ALTER TABLE recordmatch MODIFY starttime DATETIME NOT NULL;",
1263 "ALTER TABLE recordmatch MODIFY manualid INT UNSIGNED NOT NULL;",
1264 "ALTER TABLE recordmatch ADD INDEX (starttime, chanid);",
1265 "ALTER TABLE oldrecorded MODIFY generic TINYINT(1) NOT NULL;",
1266 "ALTER TABLE oldrecorded ADD INDEX (future);",
1267 "ALTER TABLE oldrecorded ADD INDEX (starttime, chanid);"
1270 updates,
"1272", dbver))
1274 if (dbver ==
"1272")
1277 "DROP INDEX starttime ON recordmatch;",
1278 "DROP INDEX starttime ON oldrecorded;",
1279 "ALTER TABLE recordmatch ADD INDEX (chanid, starttime, manualid);",
1280 "ALTER TABLE oldrecorded ADD INDEX (chanid, starttime);"
1283 updates,
"1273", dbver))
1287 if (dbver ==
"1273")
1290 "ALTER TABLE internetcontent MODIFY COLUMN updated "
1291 " DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00';",
1292 "ALTER TABLE internetcontentarticles MODIFY COLUMN `date` "
1293 " DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00';"
1297 updates,
"1274", dbver))
1301 if (dbver ==
"1274")
1305 "UPDATE cardinput SET tunechan=NULL"
1306 " WHERE inputname='DVBInput' OR inputname='MPEG2TS';"
1307 "UPDATE dtv_multiplex SET symbolrate = NULL"
1308 " WHERE modulation LIKE 't%' OR modulation LIKE '%t';",
1309 "UPDATE dtv_multiplex"
1310 " SET bandwidth=SUBSTR(modulation,2,1)"
1311 " WHERE SUBSTR(modulation,3,3)='qam' OR"
1312 " SUBSTR(modulation,3,4)='qpsk';",
1313 "UPDATE dtv_multiplex"
1314 " SET bandwidth=SUBSTR(modulation,5,1)"
1315 " WHERE SUBSTR(modulation,1,4)='auto' AND"
1316 " LENGTH(modulation)=6;",
1317 "UPDATE dtv_multiplex SET modulation='auto'"
1318 " WHERE modulation LIKE 'auto%';",
1319 "UPDATE dtv_multiplex SET modulation='qam_16'"
1320 " WHERE modulation LIKE '%qam16%';",
1321 "UPDATE dtv_multiplex SET modulation='qam_32'"
1322 " WHERE modulation LIKE '%qam32%';",
1323 "UPDATE dtv_multiplex SET modulation='qam_64'"
1324 " WHERE modulation LIKE '%qam64%';",
1325 "UPDATE dtv_multiplex SET modulation='qam_128'"
1326 " WHERE modulation LIKE '%qam128%';",
1327 "UPDATE dtv_multiplex SET modulation='qam_256'"
1328 " WHERE modulation LIKE '%qam256%';"
1331 updates,
"1275", dbver))
1335 if (dbver ==
"1275")
1338 "DROP TABLE IF EXISTS `logging`;",
1339 "CREATE TABLE `logging` ( "
1340 " `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, "
1341 " `host` varchar(64) NOT NULL, "
1342 " `application` varchar(64) NOT NULL, "
1343 " `pid` int(11) NOT NULL, "
1344 " `thread` varchar(64) NOT NULL, "
1345 " `msgtime` datetime NOT NULL, "
1346 " `level` int(11) NOT NULL, "
1347 " `message` varchar(2048) NOT NULL, "
1348 " PRIMARY KEY (`id`), "
1349 " KEY `host` (`host`,`application`,`pid`,`msgtime`), "
1350 " KEY `msgtime` (`msgtime`), "
1351 " KEY `level` (`level`) "
1352 ") ENGINE=MyISAM DEFAULT CHARSET=utf8; "
1355 updates,
"1276", dbver))
1359 if (dbver ==
"1276")
1362 "ALTER TABLE record ADD COLUMN filter INT UNSIGNED NOT NULL DEFAULT 0;",
1363 "CREATE TABLE IF NOT EXISTS recordfilter ("
1364 " filterid INT UNSIGNED NOT NULL PRIMARY KEY,"
1365 " description VARCHAR(64) DEFAULT NULL,"
1366 " clause VARCHAR(256) DEFAULT NULL,"
1367 " newruledefault TINYINT(1) DEFAULT 0) ENGINE=MyISAM DEFAULT CHARSET=utf8;",
1369 "INSERT INTO recordfilter (filterid, description, clause, newruledefault) "
1370 " VALUES (0, 'New episode', 'program.previouslyshown = 0', 0);",
1371 "INSERT INTO recordfilter (filterid, description, clause, newruledefault) "
1372 " VALUES (1, 'Identifiable episode', 'program.generic = 0', 0);",
1373 "INSERT INTO recordfilter (filterid, description, clause, newruledefault) "
1374 " VALUES (2, 'First showing', 'program.first > 0', 0);",
1375 "INSERT INTO recordfilter (filterid, description, clause, newruledefault) "
1376 " VALUES (3, 'Primetime', 'HOUR(program.starttime) >= 19 AND HOUR(program.starttime) < 23', 0);",
1377 "INSERT INTO recordfilter (filterid, description, clause, newruledefault) "
1378 " VALUES (4, 'Commercial free', 'channel.commmethod = -2', 0);",
1379 "INSERT INTO recordfilter (filterid, description, clause, newruledefault) "
1380 " VALUES (5, 'High definition', 'program.hdtv > 0', 0);"
1384 updates,
"1277", dbver))
1388 if (dbver ==
"1277")
1392 "ALTER TABLE record ADD autometadata TINYINT(1) NOT NULL DEFAULT "
1393 " 0 AFTER autouserjob4;",
1394 "ALTER TABLE record ADD inetref VARCHAR(40) NOT NULL AFTER programid;",
1395 "ALTER TABLE record ADD season SMALLINT(5) NOT NULL AFTER description;",
1396 "ALTER TABLE record ADD episode SMALLINT(5) NOT NULL AFTER season;",
1397 "ALTER TABLE recorded ADD inetref VARCHAR(40) NOT NULL AFTER programid;",
1398 "ALTER TABLE recorded ADD season SMALLINT(5) NOT NULL AFTER description;",
1399 "ALTER TABLE recorded ADD episode SMALLINT(5) NOT NULL AFTER season;",
1400 "ALTER TABLE oldrecorded ADD inetref VARCHAR(40) NOT NULL AFTER programid;",
1401 "ALTER TABLE oldrecorded ADD season SMALLINT(5) NOT NULL AFTER description;",
1402 "ALTER TABLE oldrecorded ADD episode SMALLINT(5) NOT NULL AFTER season;"
1405 updates,
"1278", dbver))
1409 if (dbver ==
"1278")
1412 "CREATE TABLE recordedartwork ( "
1413 " inetref VARCHAR(255) NOT NULL, "
1414 " season SMALLINT(5) NOT NULL, "
1415 " host TEXT NOT NULL, "
1416 " coverart TEXT NOT NULL, "
1417 " fanart TEXT NOT NULL, "
1418 " banner TEXT NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8;"
1421 updates,
"1279", dbver))
1425 if (dbver ==
"1279")
1427 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1280");
1431 select.
prepare(
"SELECT hostname, data FROM settings "
1432 " WHERE value = 'NoPromptOnExit'");
1440 while (select.
next())
1444 QString prompt_on_exit = select.
value(1).toString();
1446 update.
prepare(
"DELETE FROM keybindings "
1447 " WHERE action = 'EXITPROMPT' "
1448 " AND context = 'Main Menu' "
1449 " AND hostname = :HOSTNAME ;");
1455 if (
"0" == prompt_on_exit)
1459 update.
prepare(
"INSERT INTO keybindings (context, action, "
1460 " description, keylist, hostname) "
1461 "VALUES ('Main Menu', 'EXITPROMPT', '', "
1462 " '', :HOSTNAME );");
1471 update.
prepare(
"UPDATE keybindings "
1472 " SET action = 'EXITPROMPT' "
1473 " WHERE action = 'EXIT' "
1474 " AND context = 'Main Menu' "
1475 " AND hostname = :HOSTNAME ;");
1488 if (dbver ==
"1280")
1491 "ALTER TABLE program ADD INDEX (subtitle);",
1492 "ALTER TABLE program ADD INDEX (description(255));",
1493 "ALTER TABLE oldrecorded ADD INDEX (subtitle);",
1494 "ALTER TABLE oldrecorded ADD INDEX (description(255));"
1497 updates,
"1281", dbver))
1501 if (dbver ==
"1281")
1504 "ALTER TABLE cardinput ADD changer_device VARCHAR(128) "
1505 "AFTER externalcommand;",
1506 "ALTER TABLE cardinput ADD changer_model VARCHAR(128) "
1507 "AFTER changer_device;"
1510 updates,
"1282", dbver))
1514 if (dbver ==
"1282")
1518 " SET data = SUBSTR(data, INSTR(data, 'share/mythtv/metadata')+13)"
1520 " IN ('TelevisionGrabber', "
1522 " 'mythgame.MetadataGrabber');"
1526 updates,
"1283", dbver))
1530 if (dbver ==
"1283")
1533 "UPDATE record SET filter = filter | 1 WHERE record.dupin & 0x20",
1534 "UPDATE record SET filter = filter | 2 WHERE record.dupin & 0x40",
1535 "UPDATE record SET filter = filter | 5 WHERE record.dupin & 0x80",
1536 "UPDATE record SET dupin = dupin & ~0xe0",
1538 "INSERT INTO recordfilter (filterid, description, clause, newruledefault) "
1539 " 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);"
1543 updates,
"1284", dbver))
1547 if (dbver ==
"1284")
1550 "REPLACE INTO recordfilter (filterid, description, clause, newruledefault) "
1551 " 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);"
1555 updates,
"1285", dbver))
1559 if (dbver ==
"1285")
1562 "DELETE FROM profilegroups WHERE id >= 17;",
1563 "DELETE FROM recordingprofiles WHERE profilegroup >= 17;",
1565 "INSERT INTO profilegroups SET id = '17', name = 'Ceton Recorder',"
1566 " cardtype = 'CETON', is_default = 1;",
1567 "INSERT INTO recordingprofiles SET name = \"Default\", profilegroup = 17;",
1568 "INSERT INTO recordingprofiles SET name = \"Live TV\", profilegroup = 17;",
1569 "INSERT INTO recordingprofiles SET name = \"High Quality\", profilegroup = 17;",
1570 "INSERT INTO recordingprofiles SET name = \"Low Quality\", profilegroup = 17;"
1573 updates,
"1286", dbver))
1577 if (dbver ==
"1286")
1579 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1287");
1581 query.
prepare(
"SELECT cardid, videodevice "
1583 "WHERE cardtype='CETON'");
1586 LOG(VB_GENERAL, LOG_ERR,
1587 "Unable to query capturecard table for upgrade to 1287.");
1592 update.
prepare(
"UPDATE capturecard SET videodevice=:VIDDEV "
1593 "WHERE cardid=:CARDID");
1594 while (query.
next())
1597 QString videodevice = query.
value(1).toString();
1598 QStringList parts = videodevice.split(
"-");
1599 if (parts.size() != 2)
1601 LOG(VB_GENERAL, LOG_ERR,
1602 "Unable to parse videodevice in upgrade to 1287.");
1605 if (parts[1].contains(
"."))
1608 int input = std::max(parts[1].toInt() - 1, 0);
1609 videodevice = parts[0] + QString(
"-0.%1").arg(input);
1611 update.
bindValue(
":VIDDEV", videodevice);
1614 LOG(VB_GENERAL, LOG_ERR,
1615 "Failed to update videodevice in upgrade to 1287.");
1624 if (dbver ==
"1287")
1627 "CREATE TABLE IF NOT EXISTS livestream ( "
1628 " id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, "
1629 " width INT UNSIGNED NOT NULL, "
1630 " height INT UNSIGNED NOT NULL, "
1631 " bitrate INT UNSIGNED NOT NULL, "
1632 " audiobitrate INT UNSIGNED NOT NULL, "
1633 " samplerate INT UNSIGNED NOT NULL, "
1634 " audioonlybitrate INT UNSIGNED NOT NULL, "
1635 " segmentsize INT UNSIGNED NOT NULL DEFAULT 10, "
1636 " maxsegments INT UNSIGNED NOT NULL DEFAULT 0, "
1637 " startsegment INT UNSIGNED NOT NULL DEFAULT 0, "
1638 " currentsegment INT UNSIGNED NOT NULL DEFAULT 0, "
1639 " segmentcount INT UNSIGNED NOT NULL DEFAULT 0, "
1640 " percentcomplete INT UNSIGNED NOT NULL DEFAULT 0, "
1641 " created DATETIME NOT NULL, "
1642 " lastmodified DATETIME NOT NULL, "
1643 " relativeurl VARCHAR(512) NOT NULL, "
1644 " fullurl VARCHAR(1024) NOT NULL, "
1645 " status INT UNSIGNED NOT NULL DEFAULT 0, "
1646 " statusmessage VARCHAR(256) NOT NULL, "
1647 " sourcefile VARCHAR(512) NOT NULL, "
1648 " sourcehost VARCHAR(64) NOT NULL, "
1649 " sourcewidth INT UNSIGNED NOT NULL DEFAULT 0, "
1650 " sourceheight INT UNSIGNED NOT NULL DEFAULT 0, "
1651 " outdir VARCHAR(256) NOT NULL, "
1652 " outbase VARCHAR(128) NOT NULL "
1653 ") ENGINE=MyISAM DEFAULT CHARSET=utf8; "
1657 updates,
"1288", dbver))
1661 if (dbver ==
"1288")
1664 "ALTER TABLE recordedprogram CHANGE COLUMN videoprop videoprop "
1665 " SET('HDTV', 'WIDESCREEN', 'AVC', '720', '1080', 'DAMAGED') NOT NULL; "
1668 updates,
"1289", dbver))
1672 if (dbver ==
"1289")
1675 "DROP TABLE IF EXISTS netvisionrssitems;",
1676 "DROP TABLE IF EXISTS netvisionsearchgrabbers;",
1677 "DROP TABLE IF EXISTS netvisionsites;",
1678 "DROP TABLE IF EXISTS netvisiontreegrabbers;",
1679 "DROP TABLE IF EXISTS netvisiontreeitems;"
1683 updates,
"1290", dbver))
1687 if (dbver ==
"1290")
1690 "ALTER TABLE logging "
1691 " ALTER COLUMN host SET DEFAULT '', "
1692 " ALTER COLUMN application SET DEFAULT '', "
1693 " ALTER COLUMN pid SET DEFAULT '0', "
1694 " ALTER COLUMN thread SET DEFAULT '', "
1695 " ALTER COLUMN level SET DEFAULT '0';",
1696 "ALTER TABLE logging "
1697 " ADD COLUMN tid INT(11) NOT NULL DEFAULT '0' AFTER pid, "
1698 " ADD COLUMN filename VARCHAR(255) NOT NULL DEFAULT '' AFTER thread, "
1699 " ADD COLUMN line INT(11) NOT NULL DEFAULT '0' AFTER filename, "
1700 " ADD COLUMN `function` VARCHAR(255) NOT NULL DEFAULT '' AFTER line;"
1704 updates,
"1291", dbver))
1708 if (dbver ==
"1291")
1711 "UPDATE recorded r, recordedprogram rp SET r.duplicate=0 "
1712 " WHERE r.chanid=rp.chanid AND r.progstart=rp.starttime AND "
1713 " FIND_IN_SET('DAMAGED', rp.videoprop);"
1717 updates,
"1292", dbver))
1721 if (dbver ==
"1292")
1724 "ALTER TABLE cardinput "
1725 " ADD COLUMN schedorder INT(10) UNSIGNED NOT NULL DEFAULT '0', "
1726 " ADD COLUMN livetvorder INT(10) UNSIGNED NOT NULL DEFAULT '0';",
1727 "UPDATE cardinput SET schedorder = cardinputid;",
1728 "UPDATE cardinput SET livetvorder = cardid;"
1734 "UPDATE cardinput SET livetvorder = "
1735 " (SELECT MAX(cardid) FROM capturecard) - cardid + 1;";
1739 updates,
"1293", dbver))
1743 if (dbver ==
"1293")
1746 "TRUNCATE TABLE recordmatch",
1747 "ALTER TABLE recordmatch DROP INDEX recordid",
1748 "ALTER TABLE recordmatch ADD UNIQUE INDEX (recordid, chanid, starttime)",
1749 "UPDATE recordfilter SET description='Prime time' WHERE filterid=3",
1750 "UPDATE recordfilter SET description='This episode' WHERE filterid=6",
1752 "REPLACE INTO recordfilter (filterid, description, clause, newruledefault) "
1753 " VALUES (7, 'This series', '(RECTABLE.seriesid <> '''' AND program.seriesid = RECTABLE.seriesid)', 0);"
1757 updates,
"1294", dbver))
1761 if (dbver ==
"1294")
1764 "CREATE TABLE videocollection ("
1765 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
1766 " title varchar(256) NOT NULL,"
1767 " contenttype set('MOVIE', 'TELEVISION', 'ADULT', 'MUSICVIDEO', 'HOMEVIDEO') NOT NULL default '',"
1769 " network varchar(128) DEFAULT NULL,"
1770 " inetref varchar(128) NOT NULL,"
1771 " certification varchar(128) DEFAULT NULL,"
1772 " genre int(10) unsigned DEFAULT '0',"
1773 " releasedate date DEFAULT NULL,"
1774 " language varchar(10) DEFAULT NULL,"
1775 " status varchar(64) DEFAULT NULL,"
1776 " rating float DEFAULT 0,"
1777 " ratingcount int(10) DEFAULT 0,"
1778 " runtime smallint(5) unsigned DEFAULT '0',"
1782 " PRIMARY KEY (intid),"
1783 " KEY title (title)"
1784 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
1785 "CREATE TABLE videopathinfo ("
1786 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
1788 " contenttype set('MOVIE', 'TELEVISION', 'ADULT', 'MUSICVIDEO', 'HOMEVIDEO') NOT NULL default '',"
1789 " collectionref int(10) default '0',"
1790 " recurse tinyint(1) default '0',"
1791 " PRIMARY KEY (intid)"
1792 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
1793 "ALTER TABLE videometadata ADD collectionref int(10) NOT NULL DEFAULT '0' AFTER inetref;",
1794 "ALTER TABLE videometadata ADD playcount int(10) NOT NULL DEFAULT '0' AFTER length;",
1795 "ALTER TABLE videometadata ADD contenttype set('MOVIE', 'TELEVISION', 'ADULT', 'MUSICVIDEO', 'HOMEVIDEO') NOT NULL default ''",
1796 "UPDATE videometadata SET contenttype = 'MOVIE';",
1797 "UPDATE videometadata SET contenttype = 'TELEVISION' WHERE season > 0 OR episode > 0;"
1801 updates,
"1295", dbver))
1805 if (dbver ==
"1295")
1807 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1296");
1809 query.
prepare(
"SELECT data, hostname "
1811 "WHERE value='BackendServerIP'");
1814 LOG(VB_GENERAL, LOG_ERR,
1815 "Unable to repair IP addresses for IPv4/IPv6 split.");
1821 update.
prepare(
"UPDATE settings "
1822 "SET data=:IP4ADDY "
1823 "WHERE value='BackendServerIP' "
1824 "AND hostname=:HOSTNAME");
1825 insert.
prepare(
"INSERT INTO settings "
1826 "SET value='BackendServerIP6',"
1828 "hostname=:HOSTNAME");
1829 while (query.
next())
1831 QHostAddress oldaddr(query.
value(0).toString());
1837 if (oldaddr.protocol() == QAbstractSocket::IPv6Protocol)
1839 update.
bindValue(
":IP4ADDY",
"127.0.0.1");
1842 else if (oldaddr.protocol() == QAbstractSocket::IPv4Protocol)
1849 update.
bindValue(
":IP4ADDY",
"127.0.0.1");
1851 LOG(VB_GENERAL, LOG_CRIT,
1852 QString(
"Invalid address string '%1' found on %2. "
1853 "Reverting to localhost defaults.")
1857 if (!update.
exec() || !insert.
exec())
1859 LOG(VB_GENERAL, LOG_ERR, QString(
"Failed to separate IPv4 "
1860 "and IPv6 addresses for %1").arg(
hostname));
1870 if (dbver ==
"1296")
1873 "ALTER TABLE videocollection CHANGE inetref collectionref "
1874 "VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci "
1876 "ALTER TABLE videocollection CHANGE genre genre VARCHAR(128) NULL DEFAULT ''"
1880 updates,
"1297", dbver))
1884 if (dbver ==
"1297")
1887 "ALTER TABLE videometadata CHANGE collectionref collectionref INT(10) "
1888 "NOT NULL DEFAULT -1",
1889 "UPDATE videometadata SET collectionref = '-1'"
1893 updates,
"1298", dbver))
1897 if (dbver ==
"1298")
1899 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1299");
1912 queryStr =
"UPDATE settings SET data='-1' WHERE "
1913 "value='DeletedMaxAge' AND data='0'";
1917 queryStr =
"UPDATE settings SET data='0' WHERE "
1918 "value='DeletedMaxAge'";
1933 if (dbver ==
"1299")
1936 "ALTER TABLE recordmatch ADD COLUMN findid INT NOT NULL DEFAULT 0",
1937 "ALTER TABLE recordmatch ADD INDEX (recordid, findid)"
1941 updates,
"1300", dbver))
1945 if (dbver ==
"1300")
1948 "ALTER TABLE channel ADD COLUMN iptvid SMALLINT(6) UNSIGNED;",
1949 "CREATE TABLE iptv_channel ("
1950 " iptvid SMALLINT(6) UNSIGNED NOT NULL auto_increment,"
1951 " chanid INT(10) UNSIGNED NOT NULL,"
1952 " url TEXT NOT NULL,"
1953 " type set('data', "
1954 " 'rfc2733-1','rfc2733-2', "
1955 " 'rfc5109-1','rfc5109-2', "
1956 " 'smpte2022-1','smpte2022-2'),"
1957 " bitrate INT(10) UNSIGNED NOT NULL,"
1958 " PRIMARY KEY (iptvid)"
1959 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;"
1963 updates,
"1301", dbver))
1967 if (dbver ==
"1301")
1969 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1302");
2009 if (dbver ==
"1302")
2011 QDateTime loc = QDateTime::currentDateTime();
2012 QDateTime utc = loc.toUTC();
2013 loc = QDateTime(loc.date(), loc.time(), Qt::UTC);
2014 int utc_offset = loc.secsTo(utc) / 60;
2016 QList<QByteArray> updates_ba;
2019 const std::array<const std::string,2> pre_sql {
2020 "CREATE TEMPORARY TABLE recordupdate ("
2021 "recid INT, starttime DATETIME, endtime DATETIME)",
2022 "INSERT INTO recordupdate (recid, starttime, endtime) "
2024 " CONCAT(startdate, ' ', starttime), "
2025 " CONCAT(enddate, ' ', endtime) FROM record",
2027 std::transform(pre_sql.cbegin(), pre_sql.cend(),
2028 std::back_inserter(updates_ba), ss2ba);
2031 if (0 != utc_offset)
2033 const std::array<const std::string,4> with_endtime {
2034 "program",
"recorded",
"oldrecorded",
"recordupdate",
2036 const std::array<const std::string,4> without_endtime {
2037 "programgenres",
"programrating",
"credits",
2040 order = (utc_offset > 0) ?
"-starttime" :
"starttime";
2041 std::transform(with_endtime.cbegin(), with_endtime.cend(),
2042 std::back_inserter(updates_ba), add_start_end);
2043 std::transform(without_endtime.cbegin(), without_endtime.cend(),
2044 std::back_inserter(updates_ba), add_start);
2046 updates_ba.push_back(
2047 QString(
"UPDATE oldprogram "
2049 " CONVERT_TZ(airdate, 'SYSTEM', 'Etc/UTC') "
2051 .arg((utc_offset > 0) ?
"-airdate" :
2052 "airdate").toLocal8Bit());
2054 updates_ba.push_back(
2055 QString(
"UPDATE recorded "
2057 " CONVERT_TZ(progstart, 'SYSTEM', 'Etc/UTC'), "
2059 " CONVERT_TZ(progend, 'SYSTEM', 'Etc/UTC') ")
2064 const std::array<const std::string,2> post_sql {
2065 "UPDATE record, recordupdate "
2066 "SET record.startdate = DATE(recordupdate.starttime), "
2067 " record.starttime = TIME(recordupdate.starttime), "
2068 " record.enddate = DATE(recordupdate.endtime), "
2069 " record.endtime = TIME(recordupdate.endtime), "
2070 " record.last_record = "
2071 " CONVERT_TZ(last_record, 'SYSTEM', 'Etc/UTC'), "
2072 " record.last_delete = "
2073 " CONVERT_TZ(last_delete, 'SYSTEM', 'Etc/UTC') "
2074 "WHERE recordid = recid",
2075 "DROP TABLE recordupdate",
2078 std::transform(post_sql.cbegin(), post_sql.cend(),
2079 std::back_inserter(updates_ba), ss2ba);
2083 std::transform(updates_ba.cbegin(), updates_ba.cend(),
2084 std::back_inserter(updates), qs2ba);
2088 updates,
"1303", dbver))
2092 if (dbver ==
"1303")
2094 QDateTime loc = QDateTime::currentDateTime();
2095 QDateTime utc = loc.toUTC();
2096 loc = QDateTime(loc.date(), loc.time(), Qt::UTC);
2097 int utc_offset = loc.secsTo(utc) / 60;
2099 QList<QByteArray> updates_ba;
2102 if (0 != utc_offset)
2104 const std::array<const std::string,1> with_endtime = {
2107 const std::array<const std::string,4> without_endtime = {
2108 "recordedseek",
"recordedmarkup",
"recordedrating",
2111 order = (utc_offset > 0) ?
"-starttime" :
"starttime";
2112 std::transform(with_endtime.cbegin(), with_endtime.cend(),
2113 std::back_inserter(updates_ba), add_start_end);
2114 std::transform(without_endtime.cbegin(), without_endtime.cend(),
2115 std::back_inserter(updates_ba), add_start);
2120 std::transform(updates_ba.cbegin(), updates_ba.cend(),
2121 std::back_inserter(updates), qs2ba);
2125 updates,
"1304", dbver))
2129 if (dbver ==
"1304")
2131 QList<QByteArray> updates_ba;
2133 updates_ba.push_back(
2134 "UPDATE recordfilter SET clause="
2135 "'HOUR(CONVERT_TZ(program.starttime, ''Etc/UTC'', ''SYSTEM'')) >= 19 AND "
2136 "HOUR(CONVERT_TZ(program.starttime, ''Etc/UTC'', ''SYSTEM'')) < 22' "
2137 "WHERE filterid=3");
2139 updates_ba.push_back(QString(
2140 "UPDATE record SET findday = "
2141 " DAYOFWEEK(CONVERT_TZ(ADDTIME('2012-06-02 00:00:00', findtime), "
2142 " 'SYSTEM', 'Etc/UTC') + INTERVAL findday DAY) "
2143 "WHERE findday > 0").toLocal8Bit());
2145 updates_ba.push_back(QString(
2146 "UPDATE record SET findtime = "
2147 " TIME(CONVERT_TZ(ADDTIME('2012-06-02 00:00:00', findtime), "
2148 " 'SYSTEM', 'Etc/UTC')) ")
2153 std::transform(updates_ba.cbegin(), updates_ba.cend(),
2154 std::back_inserter(updates), qs2ba);
2157 updates,
"1305", dbver))
2161 if (dbver ==
"1305")
2166 QList<QByteArray> updates_ba;
2168 updates_ba.push_back(QString(
2169 "UPDATE record SET findday = "
2170 " DAYOFWEEK(CONVERT_TZ(ADDTIME('2012-06-02 00:00:00', findtime), "
2171 " 'Etc/UTC', 'SYSTEM') + INTERVAL findday DAY) "
2172 "WHERE findday > 0").toLocal8Bit());
2174 updates_ba.push_back(QString(
2175 "UPDATE record SET findtime = "
2176 " TIME(CONVERT_TZ(ADDTIME('2012-06-02 00:00:00', findtime), "
2177 " 'Etc/UTC', 'SYSTEM')) ").toLocal8Bit());
2181 std::transform(updates_ba.cbegin(), updates_ba.cend(),
2182 std::back_inserter(updates), qs2ba);
2185 updates,
"1306", dbver))
2189 if (dbver ==
"1306")
2195 "CREATE TABLE scannerfile ("
2196 " `fileid` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,"
2197 " `filesize` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,"
2198 " `filehash` VARCHAR(64) NOT NULL DEFAULT '',"
2199 " `added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,"
2200 " PRIMARY KEY (`fileid`),"
2201 " UNIQUE KEY filehash (`filehash`)"
2202 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
2203 "CREATE TABLE scannerpath ("
2204 " `fileid` BIGINT(20) UNSIGNED NOT NULL,"
2205 " `hostname` VARCHAR(64) NOT NULL DEFAULT 'localhost',"
2206 " `storagegroup` VARCHAR(32) NOT NULL DEFAULT 'Default',"
2207 " `filename` VARCHAR(255) NOT NULL DEFAULT '',"
2208 " PRIMARY KEY (`fileid`)"
2209 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
2210 "CREATE TABLE videopart ("
2211 " `fileid` BIGINT(20) UNSIGNED NOT NULL,"
2212 " `videoid` INT(10) UNSIGNED NOT NULL,"
2213 " `order` SMALLINT UNSIGNED NOT NULL DEFAULT 1,"
2214 " PRIMARY KEY `part` (`videoid`, `order`)"
2215 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;"
2222 updates,
"1307", dbver))
2226 if (dbver ==
"1307")
2229 "ALTER TABLE channel MODIFY COLUMN icon varchar(255) NOT NULL DEFAULT '';",
2230 "UPDATE channel SET icon='' WHERE icon='none';"
2233 updates,
"1308", dbver))
2237 if (dbver ==
"1308")
2242 "REPLACE INTO recordfilter (filterid, description, clause, newruledefault) "
2243 " VALUES (8, 'This time', 'ABS(TIMESTAMPDIFF(MINUTE, CONVERT_TZ("
2244 " ADDTIME(RECTABLE.startdate, RECTABLE.starttime), ''Etc/UTC'', ''SYSTEM''), "
2245 " CONVERT_TZ(program.starttime, ''Etc/UTC'', ''SYSTEM''))) MOD 1440 <= 10', 0)",
2247 "REPLACE INTO recordfilter (filterid, description, clause, newruledefault) "
2248 " VALUES (9, 'This day and time', 'ABS(TIMESTAMPDIFF(MINUTE, CONVERT_TZ("
2249 " ADDTIME(RECTABLE.startdate, RECTABLE.starttime), ''Etc/UTC'', ''SYSTEM''), "
2250 " CONVERT_TZ(program.starttime, ''Etc/UTC'', ''SYSTEM''))) MOD 10080 <= 10', 0)",
2252 "UPDATE record SET type = 3, filter = filter|256 "
2253 " WHERE type = 2 AND search = 0",
2255 "UPDATE record SET type = 3, filter = filter|512 "
2256 " WHERE type = 5 AND search = 0",
2258 "UPDATE record SET type = 2, search = 1, chanid = 0, station = '', "
2259 " subtitle = '', description = CONCAT('program.title = ''', "
2260 " REPLACE(title, '''', ''''''), ''''), "
2261 " title = CONCAT(title, ' (Power Search)') WHERE type = 9 AND search = 0",
2263 "UPDATE record SET type = 5, search = 1, chanid = 0, station = '', "
2264 " subtitle = '', description = CONCAT('program.title = ''', "
2265 " REPLACE(title, '''', ''''''), ''''), "
2266 " title = CONCAT(title, ' (Power Search)') WHERE type = 10 AND search = 0",
2268 "UPDATE record SET type = 2 WHERE type = 9",
2270 "UPDATE record SET type = 5 WHERE type = 10"
2273 updates,
"1309", dbver))
2277 if (dbver ==
"1309")
2281 "REPLACE INTO recordfilter (filterid, description, clause, newruledefault) "
2282 " VALUES (10, 'This channel', 'channel.callsign = RECTABLE.station', 0)",
2284 "UPDATE record SET type = 4, filter = filter|1024 WHERE type = 3"
2287 updates,
"1310", dbver))
2291 if (dbver ==
"1310")
2295 "RENAME TABLE `housekeeping` TO `oldhousekeeping`;",
2297 "CREATE TABLE `housekeeping` ("
2298 " `tag` VARCHAR(64) NOT NULL,"
2299 " `hostname` VARCHAR(64),"
2300 " `lastrun` DATETIME,"
2301 " UNIQUE KEY `task` (`tag`, `hostname`)"
2302 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
2304 "INSERT INTO `housekeeping` (`tag`, `hostname`, `lastrun`)"
2305 " SELECT SUBSTRING_INDEX(`tag`, '-', 1) AS `tag`,"
2306 " IF(LOCATE('-', `tag`) > 0,"
2307 " SUBSTRING(`tag` FROM LENGTH(SUBSTRING_INDEX(`tag`, '-', 1)) +2),"
2308 " NULL) AS `hostname`,"
2310 " FROM `oldhousekeeping`;",
2312 "DROP TABLE `oldhousekeeping`;"
2316 updates,
"1311", dbver))
2320 if (dbver ==
"1311")
2325 "INSERT INTO `settings` (`value`, `hostname`, `data`)"
2326 " SELECT 'HardwareProfileEnabled',"
2328 " IF((SELECT COUNT(1)"
2330 " WHERE `value` = 'HardwareProfileLastUpdated' > 0),"
2333 "INSERT INTO `housekeeping` (`tag`, `hostname`, `lastrun`)"
2334 " SELECT 'HardwareProfiler',"
2338 " WHERE `value` = 'HardwareProfileLastUpdated';",
2340 "DELETE FROM `settings` WHERE `value` = 'HardwareProfileLastUpdated';"
2343 updates,
"1312", dbver))
2347 if (dbver ==
"1312")
2351 "DELETE FROM `dvdbookmark` WHERE `framenum` = 0;",
2352 "ALTER TABLE dvdbookmark ADD COLUMN dvdstate varchar(1024) NOT NULL DEFAULT '';"
2355 updates,
"1313", dbver))
2359 if (dbver ==
"1313")
2365 "UPDATE capturecard SET channel_timeout = 3000 WHERE "
2366 "cardtype = \"DVB\" AND channel_timeout < 3000;",
2367 "UPDATE capturecard SET channel_timeout = 30000 WHERE "
2368 "cardtype = \"FREEBOX\" AND channel_timeout < 30000;",
2369 "UPDATE capturecard SET channel_timeout = 9000 WHERE "
2370 "cardtype = \"FIREWIRE\" AND channel_timeout < 9000;",
2371 "UPDATE capturecard SET channel_timeout = 3000 WHERE "
2372 "cardtype = \"HDHOMERUN\" AND channel_timeout < 3000;",
2373 "UPDATE capturecard SET channel_timeout = 15000 WHERE "
2374 "cardtype = \"HDPVR\" AND channel_timeout < 15000;",
2375 "UPDATE capturecard SET channel_timeout = 12000 WHERE "
2376 "cardtype = \"MPEG\" AND channel_timeout < 12000;"
2379 updates,
"1314", dbver))
2383 if (dbver ==
"1314")
2388 "UPDATE settings SET data=REPLACE(data, 'tmdb.py', 'tmdb3.py') "
2389 "WHERE value='MovieGrabber'"
2392 updates,
"1315", dbver))
2396 if (dbver ==
"1315")
2399 "ALTER TABLE program ADD INDEX title_subtitle_start (title, subtitle, starttime);",
2400 "ALTER TABLE program DROP INDEX title;"
2403 updates,
"1316", dbver))
2407 if (dbver ==
"1316")
2411 "ALTER TABLE oldrecorded CHANGE COLUMN programid programid varchar(64);",
2412 "ALTER TABLE oldrecorded CHANGE COLUMN seriesid seriesid varchar(64);",
2413 "ALTER TABLE record CHANGE COLUMN programid programid varchar(64);",
2414 "ALTER TABLE record CHANGE COLUMN seriesid seriesid varchar(64);",
2415 "ALTER TABLE recorded CHANGE COLUMN programid programid varchar(64);",
2416 "ALTER TABLE recorded CHANGE COLUMN seriesid seriesid varchar(64);",
2417 "ALTER TABLE recordedprogram CHANGE COLUMN programid programid varchar(64);",
2418 "ALTER TABLE recordedprogram CHANGE COLUMN seriesid seriesid varchar(64);"
2421 updates,
"1317", dbver))
2425 if (dbver ==
"1317")
2428 "CREATE TABLE IF NOT EXISTS gallery_directories ("
2429 " dir_id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,"
2430 " filename VARCHAR(255) NOT NULL,"
2431 " name VARCHAR(255) NOT NULL,"
2432 " path VARCHAR(255) NOT NULL,"
2433 " parent_id INT(11) NOT NULL,"
2434 " dir_count INT(11) NOT NULL DEFAULT '0',"
2435 " file_count INT(11) NOT NULL DEFAULT '0',"
2436 " hidden TINYINT(1) NOT NULL DEFAULT '0'"
2437 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
2438 "CREATE TABLE IF NOT EXISTS gallery_files ("
2439 " file_id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,"
2440 " filename VARCHAR(255) NOT NULL,"
2441 " name VARCHAR(255) NOT NULL,"
2442 " path VARCHAR(255) NOT NULL,"
2443 " dir_id INT(11) NOT NULL DEFAULT '0',"
2444 " type INT(11) NOT NULL DEFAULT '0',"
2445 " modtime INT(11) NOT NULL DEFAULT '0',"
2446 " size INT(11) NOT NULL DEFAULT '0',"
2447 " extension VARCHAR(255) NOT NULL,"
2448 " angle INT(11) NOT NULL DEFAULT '0',"
2449 " date INT(11) NOT NULL DEFAULT '0',"
2450 " zoom INT(11) NOT NULL DEFAULT '0',"
2451 " hidden TINYINT(1) NOT NULL DEFAULT '0',"
2452 " orientation INT(11) NOT NULL DEFAULT '0'"
2453 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
2454 "INSERT INTO settings VALUES ('ImageStorageGroupName', 'Images', NULL);",
2455 "INSERT INTO settings VALUES ('ImageSortOrder', 0, NULL);",
2456 "INSERT INTO settings VALUES ('ImageShowHiddenFiles', 0, NULL);",
2457 "INSERT INTO settings VALUES ('ImageSlideShowTime', 3500, NULL);",
2458 "INSERT INTO settings VALUES ('ImageTransitionType', 1, NULL);",
2459 "INSERT INTO settings VALUES ('ImageTransitionTime', 1000, NULL);"
2463 updates,
"1318", dbver))
2467 if (dbver ==
"1318")
2470 "ALTER TABLE program "
2471 " ADD COLUMN season INT(4) NOT NULL DEFAULT '0', "
2472 " ADD COLUMN episode INT(4) NOT NULL DEFAULT '0';",
2473 "ALTER TABLE recordedprogram "
2474 " ADD COLUMN season INT(4) NOT NULL DEFAULT '0', "
2475 " ADD COLUMN episode INT(4) NOT NULL DEFAULT '0';"
2479 updates,
"1319", dbver))
2483 if (dbver ==
"1319")
2487 "ALTER TABLE program "
2488 " ADD COLUMN totalepisodes INT(4) NOT NULL DEFAULT '0';",
2489 "ALTER TABLE recordedprogram "
2490 " ADD COLUMN totalepisodes INT(4) NOT NULL DEFAULT '0';"
2494 updates,
"1320", dbver))
2498 if (dbver ==
"1320")
2501 "CREATE TABLE IF NOT EXISTS recgroups ("
2502 "recgroupid SMALLINT(4) NOT NULL AUTO_INCREMENT, "
2503 "recgroup VARCHAR(64) NOT NULL DEFAULT '', "
2504 "displayname VARCHAR(64) NOT NULL DEFAULT '', "
2505 "password VARCHAR(40) NOT NULL DEFAULT '', "
2506 "special TINYINT(1) NOT NULL DEFAULT '0',"
2507 "PRIMARY KEY (recgroupid), "
2508 "UNIQUE KEY recgroup ( recgroup )"
2509 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
2511 "INSERT INTO recgroups ( recgroupid, recgroup, special ) VALUES ( 1, 'Default', '1' );",
2512 "INSERT INTO recgroups ( recgroupid, recgroup, special ) VALUES ( 2, 'LiveTV', '1' );",
2513 "INSERT INTO recgroups ( recgroupid, recgroup, special ) VALUES ( 3, 'Deleted', '1' );",
2515 "DELETE FROM recgrouppassword WHERE password = '';",
2516 "UPDATE recgroups r, recgrouppassword p SET r.password = p.password WHERE r.recgroup = p.recgroup;",
2518 "INSERT IGNORE INTO recgroups ( recgroup, displayname, password ) SELECT DISTINCT recgroup, recgroup, password FROM recgrouppassword;",
2519 "INSERT IGNORE INTO recgroups ( recgroup, displayname ) SELECT DISTINCT recgroup, recgroup FROM record;",
2520 "INSERT IGNORE INTO recgroups ( recgroup, displayname ) SELECT DISTINCT recgroup, recgroup FROM recorded;",
2522 "ALTER TABLE record ADD COLUMN recgroupid SMALLINT(4) NOT NULL DEFAULT '1', ADD INDEX ( recgroupid );",
2523 "ALTER TABLE recorded ADD COLUMN recgroupid SMALLINT(4) NOT NULL DEFAULT '1', ADD INDEX ( recgroupid );",
2525 "UPDATE recorded, recgroups SET recorded.recgroupid = recgroups.recgroupid WHERE recorded.recgroup = recgroups.recgroup;",
2526 "UPDATE record, recgroups SET record.recgroupid = recgroups.recgroupid WHERE record.recgroup = recgroups.recgroup;"
2532 updates,
"1321", dbver))
2536 if (dbver ==
"1321")
2539 "ALTER TABLE `housekeeping` ADD COLUMN `lastsuccess` DATETIME;",
2540 "UPDATE `housekeeping` SET `lastsuccess`=`lastrun`;"
2544 updates,
"1322", dbver))
2548 if (dbver ==
"1322")
2553 "ALTER TABLE program "
2554 " ADD COLUMN inetref varchar(40) DEFAULT '' AFTER videoprop;",
2555 "ALTER TABLE recordedprogram "
2556 " ADD COLUMN inetref varchar(40) DEFAULT '' AFTER videoprop;",
2557 "DELETE FROM settings WHERE value='DefaultStartOffset';",
2558 "DELETE FROM settings WHERE value='DefaultEndOffset';",
2559 "DELETE FROM settings WHERE value='AutoExpireDefault';",
2560 "DELETE FROM settings WHERE value='AutoCommercialFlag';",
2561 "DELETE FROM settings WHERE value='AutoTranscode';",
2562 "DELETE FROM settings WHERE value='DefaultTranscoder';",
2563 "DELETE FROM settings WHERE value='AutoRunUserJob1';",
2564 "DELETE FROM settings WHERE value='AutoRunUserJob2';",
2565 "DELETE FROM settings WHERE value='AutoRunUserJob3';",
2566 "DELETE FROM settings WHERE value='AutoRunUserJob4';",
2567 "DELETE FROM settings WHERE value='AutoMetadataLookup';",
2568 "DELETE FROM housekeeping WHERE tag='DailyCleanup';",
2569 "DELETE FROM housekeeping WHERE tag='ThemeChooserInfoCacheUpdate';"
2572 updates,
"1323", dbver))
2576 if (dbver ==
"1323")
2580 "ALTER TABLE diseqc_tree "
2581 " ADD COLUMN scr_userband INTEGER UNSIGNED NOT NULL DEFAULT 0 AFTER address, "
2582 " ADD COLUMN scr_frequency INTEGER UNSIGNED NOT NULL DEFAULT 1400 AFTER scr_userband, "
2583 " ADD COLUMN scr_pin INTEGER NOT NULL DEFAULT '-1' AFTER scr_frequency;"
2587 updates,
"1324", dbver))
2591 if (dbver ==
"1324")
2594 "ALTER TABLE recorded "
2595 " DROP PRIMARY KEY, "
2596 " ADD recordedid INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, "
2597 " ADD UNIQUE KEY (chanid, starttime) ;"
2601 updates,
"1325", dbver))
2605 if (dbver ==
"1325")
2608 "ALTER TABLE recorded ADD inputname VARCHAR(32);"
2612 updates,
"1326", dbver))
2616 if (dbver ==
"1326")
2620 "REPLACE INTO recordfilter (filterid, description, clause, newruledefault) "
2621 " VALUES (8, 'This time', 'ABS(TIMESTAMPDIFF(MINUTE, CONVERT_TZ("
2622 " ADDTIME(RECTABLE.startdate, RECTABLE.starttime), ''Etc/UTC'', ''SYSTEM''), "
2623 " CONVERT_TZ(program.starttime, ''Etc/UTC'', ''SYSTEM''))) MOD 1440 "
2624 " NOT BETWEEN 11 AND 1429', 0)",
2626 "REPLACE INTO recordfilter (filterid, description, clause, newruledefault) "
2627 " VALUES (9, 'This day and time', 'ABS(TIMESTAMPDIFF(MINUTE, CONVERT_TZ("
2628 " ADDTIME(RECTABLE.startdate, RECTABLE.starttime), ''Etc/UTC'', ''SYSTEM''), "
2629 " CONVERT_TZ(program.starttime, ''Etc/UTC'', ''SYSTEM''))) MOD 10080 "
2630 " NOT BETWEEN 11 AND 10069', 0)"
2633 updates,
"1327", dbver))
2637 if (dbver ==
"1327")
2640 "DELETE r1 FROM record r1, record r2 "
2641 " WHERE r1.chanid = r2.chanid AND "
2642 " r1.starttime = r2.starttime AND "
2643 " r1.startdate = r2.startdate AND "
2644 " r1.title = r2.title AND "
2645 " r1.type = r2.type AND "
2646 " r1.recordid > r2.recordid",
2647 "ALTER TABLE record DROP INDEX chanid",
2648 "ALTER TABLE record ADD UNIQUE INDEX "
2649 " (chanid, starttime, startdate, title, type)"
2652 updates,
"1328", dbver))
2656 if (dbver ==
"1328")
2659 "ALTER TABLE recordedfile "
2660 "DROP KEY `chanid`, "
2661 "DROP COLUMN `chanid`, "
2662 "DROP COLUMN `starttime`;",
2663 "ALTER TABLE recordedfile "
2664 "ADD COLUMN recordedid int(10) unsigned NOT NULL, "
2665 "ADD UNIQUE KEY `recordedid` (recordedid);",
2666 "ALTER TABLE recordedfile "
2667 "CHANGE audio_type audio_codec varchar(255) NOT NULL DEFAULT '';"
2668 "ALTER TABLE recordedfile "
2669 "CHANGE video_type video_codec varchar(255) NOT NULL DEFAULT '';"
2672 updates,
"1329", dbver))
2676 if (dbver ==
"1329")
2679 "ALTER TABLE recordedfile "
2680 "DROP COLUMN audio_bits_per_sample ;",
2681 "ALTER TABLE recordedfile "
2682 "ADD COLUMN container VARCHAR(255) NOT NULL DEFAULT '', "
2683 "ADD COLUMN total_bitrate MEDIUMINT UNSIGNED NOT NULL DEFAULT 0, "
2684 "ADD COLUMN video_avg_bitrate MEDIUMINT UNSIGNED NOT NULL DEFAULT 0, "
2685 "ADD COLUMN video_max_bitrate MEDIUMINT UNSIGNED NOT NULL DEFAULT 0, "
2686 "ADD COLUMN audio_avg_bitrate MEDIUMINT UNSIGNED NOT NULL DEFAULT 0, "
2687 "ADD COLUMN audio_max_bitrate MEDIUMINT UNSIGNED NOT NULL DEFAULT 0 ;"
2690 updates,
"1330", dbver))
2694 if (dbver ==
"1330")
2697 query.
prepare(
"SELECT recordedid FROM recorded");
2699 while (query.
next())
2701 int recordingID = query.
value(0).toInt();
2704 recFile->
m_fileName = recInfo->GetBasename();
2705 recFile->
m_fileSize = recInfo->GetFilesize();
2708 switch (recInfo->QueryAverageAspectRatio())
2725 QSize resolution(recInfo->QueryAverageWidth(),
2726 recInfo->QueryAverageHeight());
2728 recFile->
m_videoFrameRate = (double)recInfo->QueryAverageFrameRate() / 1000.0;
2737 if (dbver ==
"1331")
2739 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1332");
2744 select.
prepare(
"SELECT DISTINCT i1.cardid, i1.cardinputid "
2745 "FROM cardinput i1, cardinput i2 "
2746 "WHERE i1.cardid = i2.cardid AND "
2747 " i1.cardinputid > i2.cardinputid "
2748 "ORDER BY i1.cardid, i1.cardinputid");
2755 while (select.
next())
2757 int cardid = select.
value(0).toInt();
2758 int inputid = select.
value(1).toInt();
2761 update.
prepare(
"INSERT INTO capturecard "
2762 " ( videodevice, audiodevice, vbidevice, "
2763 " cardtype, defaultinput, audioratelimit, "
2764 " hostname, dvb_swfilter, dvb_sat_type, "
2765 " dvb_wait_for_seqstart, skipbtaudio, "
2766 " dvb_on_demand, dvb_diseqc_type, "
2767 " firewire_speed, firewire_model, "
2768 " firewire_connection, signal_timeout, "
2769 " channel_timeout, dvb_tuning_delay, "
2770 " contrast, brightness, colour, hue, "
2771 " diseqcid, dvb_eitscan ) "
2772 "SELECT videodevice, audiodevice, vbidevice, "
2773 " cardtype, defaultinput, audioratelimit, "
2774 " hostname, dvb_swfilter, dvb_sat_type, "
2775 " dvb_wait_for_seqstart, skipbtaudio, "
2776 " dvb_on_demand, dvb_diseqc_type, "
2777 " firewire_speed, firewire_model, "
2778 " firewire_connection, signal_timeout, "
2779 " channel_timeout, dvb_tuning_delay, "
2780 " contrast, brightness, colour, hue, "
2781 " diseqcid, dvb_eitscan "
2782 "FROM capturecard c "
2783 "WHERE c.cardid = :CARDID");
2793 update.
prepare(
"UPDATE cardinput "
2794 "SET cardid = :NEWCARDID "
2795 "WHERE cardinputid = :INPUTID");
2796 update.
bindValue(
":NEWCARDID", newcardid);
2807 "DELETE FROM inputgroup WHERE inputgroupname LIKE 'DVB_%'",
2808 "DELETE FROM inputgroup WHERE inputgroupname LIKE 'CETON_%'",
2809 "DELETE FROM inputgroup WHERE inputgroupname LIKE 'HDHOMERUN_%'",
2812 "ALTER TABLE inputgroup "
2813 " MODIFY COLUMN inputgroupname VARCHAR(48)",
2815 "UPDATE inputgroup "
2816 " SET inputgroupname = CONCAT('user:', inputgroupname)",
2818 "UPDATE inputgroup ig "
2819 " JOIN cardinput i ON ig.cardinputid = i.cardinputid "
2820 " SET ig.cardinputid = i.cardid",
2823 " JOIN cardinput i ON r.prefinput = i.cardinputid "
2824 " SET r.prefinput = i.cardid",
2826 "UPDATE diseqc_config dc "
2827 " JOIN cardinput i ON dc.cardinputid = i.cardinputid "
2828 " SET dc.cardinputid = i.cardid",
2831 "SELECT MAX(cardid) INTO @maxcardid FROM capturecard",
2832 "SELECT MAX(cardinputid) INTO @maxcardinputid FROM cardinput",
2833 "UPDATE cardinput i "
2834 " SET i.cardinputid = i.cardid + @maxcardid + @maxcardinputid",
2835 "UPDATE cardinput i "
2836 " SET i.cardinputid = i.cardid"
2843 select.
prepare(
"SELECT cardid, hostname, videodevice "
2844 "FROM capturecard c "
2845 "ORDER BY c.cardid");
2852 while (select.
next())
2855 QString host = select.
value(1).toString();
2856 QString device = select.
value(2).toString();
2857 QString name = host +
"|" + device;
2873 if (dbver ==
"1332")
2877 "ALTER TABLE capturecard "
2878 " ADD COLUMN inputname VARCHAR(32) NOT NULL DEFAULT '', "
2879 " ADD COLUMN sourceid INT(10) UNSIGNED NOT NULL DEFAULT 0, "
2880 " ADD COLUMN externalcommand VARCHAR(128), "
2881 " ADD COLUMN changer_device VARCHAR(128), "
2882 " ADD COLUMN changer_model VARCHAR(128), "
2883 " ADD COLUMN tunechan VARCHAR(10), "
2884 " ADD COLUMN startchan VARCHAR(10), "
2885 " ADD COLUMN displayname VARCHAR(64) NOT NULL DEFAULT '', "
2886 " ADD COLUMN dishnet_eit TINYINT(1) NOT NULL DEFAULT 0, "
2887 " ADD COLUMN recpriority INT(11) NOT NULL DEFAULT 0, "
2888 " ADD COLUMN quicktune TINYINT(4) NOT NULL DEFAULT 0, "
2889 " ADD COLUMN schedorder INT(10) UNSIGNED NOT NULL DEFAULT 0, "
2890 " ADD COLUMN livetvorder INT(10) UNSIGNED NOT NULL DEFAULT 0",
2891 "UPDATE capturecard c "
2892 " JOIN cardinput i ON c.cardid = i.cardinputid "
2893 " SET c.inputname = i.inputname, "
2894 " c.sourceid = i.sourceid, "
2895 " c.externalcommand = i.externalcommand, "
2896 " c.changer_device = i.changer_device, "
2897 " c.changer_model = i.changer_model, "
2898 " c.tunechan = i.tunechan, "
2899 " c.startchan = i.startchan, "
2900 " c.displayname = i.displayname, "
2901 " c.dishnet_eit = i.dishnet_eit, "
2902 " c.recpriority = i.recpriority, "
2903 " c.quicktune = i.quicktune, "
2904 " c.schedorder = i.schedorder, "
2905 " c.livetvorder = i.livetvorder",
2906 "TRUNCATE cardinput"
2909 updates,
"1333", dbver))
2913 if (dbver ==
"1333")
2917 "ALTER TABLE capturecard "
2918 " MODIFY COLUMN inputname VARCHAR(32) NOT NULL DEFAULT 'None'",
2919 "UPDATE capturecard c "
2920 " SET inputname = 'None' WHERE inputname = '' "
2923 updates,
"1334", dbver))
2927 if (dbver ==
"1334")
2931 "ALTER TABLE capturecard "
2932 " MODIFY COLUMN schedorder INT(10) UNSIGNED "
2933 " NOT NULL DEFAULT 1, "
2934 " MODIFY COLUMN livetvorder INT(10) UNSIGNED "
2935 " NOT NULL DEFAULT 1"
2938 updates,
"1335", dbver))
2942 if (dbver ==
"1335")
2947 "UPDATE record SET description = "
2948 " replace(description, 'cardinputid', 'cardid') "
2949 " WHERE search = 1",
2950 "UPDATE record SET description = "
2951 " replace(description, 'cardinput', 'capturecard') "
2952 " WHERE search = 1",
2953 "UPDATE powerpriority SET selectclause = "
2954 " replace(selectclause, 'cardinputid', 'cardid')",
2955 "UPDATE powerpriority SET selectclause = "
2956 " replace(selectclause, 'cardinput', 'capturecard')"
2959 updates,
"1336", dbver))
2963 if (dbver ==
"1336")
2967 "ALTER TABLE capturecard "
2968 " ADD parentid INT UNSIGNED NOT NULL DEFAULT 0 AFTER cardid",
2969 "UPDATE capturecard c, "
2970 " (SELECT min(cardid) cardid, hostname, videodevice, "
2971 " inputname, cardtype "
2972 " FROM capturecard "
2973 " WHERE cardtype NOT IN "
2974 " ('FREEBOX', 'IMPORT', 'DEMO', 'EXTERNAL') "
2975 " GROUP BY hostname, videodevice, inputname) mins "
2976 "SET c.parentid = mins.cardid "
2977 "WHERE c.hostname = mins.hostname and "
2978 " c.videodevice = mins.videodevice and "
2979 " c.inputname = mins.inputname and "
2980 " c.cardid <> mins.cardid"
2983 updates,
"1337", dbver))
2987 if (dbver ==
"1337")
2991 "ALTER TABLE record MODIFY next_record DATETIME NULL",
2993 "UPDATE record SET next_record = NULL "
2994 " WHERE next_record = '0000-00-00 00:00:00'",
2995 "ALTER TABLE record MODIFY last_record DATETIME NULL",
2996 "UPDATE record SET last_record = NULL "
2997 " WHERE last_record = '0000-00-00 00:00:00'",
2998 "ALTER TABLE record MODIFY last_delete DATETIME NULL",
2999 "UPDATE record SET last_delete = NULL "
3000 " WHERE last_delete = '0000-00-00 00:00:00'"
3003 updates,
"1338", dbver))
3007 if (dbver ==
"1338")
3010 "CREATE TABLE users ("
3011 " userid int(5) unsigned NOT NULL AUTO_INCREMENT,"
3012 " username varchar(128) NOT NULL DEFAULT '',"
3013 " password_digest varchar(32) NOT NULL DEFAULT '',"
3014 " lastlogin datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
3015 " PRIMARY KEY (userid),"
3016 " KEY username (username)"
3017 " ) ENGINE=MyISAM DEFAULT CHARSET=utf8;",
3018 "CREATE TABLE user_permissions ("
3019 " userid int(5) unsigned NOT NULL,"
3020 " permission varchar(128) NOT NULL DEFAULT '',"
3021 " PRIMARY KEY (userid)"
3022 " ) ENGINE=MyISAM DEFAULT CHARSET=utf8;",
3023 "CREATE TABLE user_sessions ("
3024 " sessiontoken varchar(40) NOT NULL DEFAULT '',"
3025 " userid int(5) unsigned NOT NULL,"
3026 " client varchar(128) NOT NULL, "
3027 " created datetime NOT NULL,"
3028 " lastactive datetime NOT NULL,"
3029 " expires datetime NOT NULL,"
3030 " PRIMARY KEY (sessionToken),"
3031 " UNIQUE KEY userid_client (userid,client)"
3032 " ) ENGINE=MyISAM DEFAULT CHARSET=utf8;",
3033 "INSERT INTO users SET username='admin',"
3034 " password_digest='bcd911b2ecb15ffbd6d8e6e744d60cf6';"
3037 updates,
"1339", dbver))
3041 if (dbver ==
"1339")
3046 query.
prepare(
"INSERT INTO profilegroups SET name = 'VBox Recorder', "
3047 "cardtype = 'VBOX', is_default = 1;");
3058 query.
prepare(
"INSERT INTO recordingprofiles SET name = \"Default\", profilegroup = :GROUPID;");
3062 MythDB::DBError(
"Unable to insert 'Default' recordingprofile.", query);
3066 query.
prepare(
"INSERT INTO recordingprofiles SET name = \"Live TV\", profilegroup = :GROUPID;");
3070 MythDB::DBError(
"Unable to insert 'Live TV' recordingprofile.", query);
3074 query.
prepare(
"INSERT INTO recordingprofiles SET name = \"High Quality\", profilegroup = :GROUPID;");
3078 MythDB::DBError(
"Unable to insert 'High Quality' recordingprofile.", query);
3082 query.
prepare(
"INSERT INTO recordingprofiles SET name = \"Low Quality\", profilegroup = :GROUPID;");
3086 MythDB::DBError(
"Unable to insert 'Low Quality' recordingprofile.", query);
3094 if (dbver ==
"1340")
3098 "REPLACE INTO recordfilter (filterid, description, clause, newruledefault) "
3099 " VALUES (11, 'No episodes', 'program.category_type <> ''series''', 0)"
3102 updates,
"1341", dbver))
3106 if (dbver ==
"1341")
3109 "UPDATE profilegroups SET cardtype='FREEBOX' WHERE cardtype='Freebox'"
3112 updates,
"1342", dbver))
3116 if (dbver ==
"1342")
3118 LOG(VB_GENERAL, LOG_CRIT,
"Upgrading to MythTV schema version 1343");
3124 "DELETE FROM inputgroup WHERE inputgroupname REGEXP '^[a-z_-]*\\\\|'",
3126 "ALTER TABLE inputgroup "
3127 " MODIFY COLUMN inputgroupname VARCHAR(128)"
3134 select.
prepare(
"SELECT cardid, parentid, cardtype, hostname, "
3136 "FROM capturecard c "
3137 "ORDER BY c.cardid");
3144 while (select.
next())
3147 uint parentid = select.
value(1).toUInt();
3148 QString
type = select.
value(2).toString();
3149 QString host = select.
value(3).toString();
3150 QString device = select.
value(4).toString();
3151 QString name = host +
"|" + device;
3152 if (
type ==
"FREEBOX" ||
type ==
"IMPORT" ||
3153 type ==
"DEMO" ||
type ==
"EXTERNAL")
3154 name += QString(
"|%1").arg(parentid ? parentid : cardid);
3170 if (dbver ==
"1343")
3173 "DROP TABLE IF EXISTS bdbookmark;",
3174 "CREATE TABLE bdbookmark ("
3175 " serialid varchar(40) NOT NULL DEFAULT '',"
3176 " `name` varchar(128) DEFAULT NULL,"
3177 " bdstate varchar(4096) NOT NULL DEFAULT '',"
3178 " `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,"
3179 " PRIMARY KEY (serialid)"
3180 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
3183 "UPDATE channel SET callsign=REPLACE(callsign,'\\0',''),"
3184 "name=REPLACE(name,'\\0','');",
3187 "DELETE FROM settings WHERE value='BackendWSPort';"
3191 updates,
"1344", dbver))
3195 if (dbver ==
"1344")
3198 "ALTER TABLE capturecard ADD COLUMN "
3199 " reclimit INT UNSIGNED DEFAULT 1 NOT NULL",
3200 "UPDATE capturecard cc, "
3201 " ( SELECT IF(parentid>0, parentid, cardid) cardid, "
3203 " FROM capturecard "
3204 " GROUP BY if(parentid>0, parentid, cardid) "
3206 "SET cc.reclimit = p.cnt "
3207 "WHERE cc.cardid = p.cardid OR cc.parentid = p.cardid"
3211 updates,
"1345", dbver))
3215 if (dbver ==
"1345")
3218 "ALTER TABLE capturecard ADD COLUMN "
3219 " schedgroup TINYINT(1) DEFAULT 0 NOT NULL"
3223 updates,
"1346", dbver))
3234 if (dbver ==
"1346")
3241 "insert into settings (value,data,hostname) "
3242 "values('MasterServerName','"
3248 "insert into settings (value,data,hostname) "
3249 "select 'MasterServerName', b.hostname, null "
3250 "from settings a, settings b "
3251 "where a.value = 'MasterServerIP' "
3252 "and b.value in ('BackendServerIP','BackendServerIP6')"
3253 "and a.data = b.data;";
3258 master.toLocal8Bit().constData(),
3261 "insert into settings (value,data,hostname) "
3262 "select 'BackendServerAddr', data,hostname from settings "
3263 "where value = 'BackendServerIP';",
3265 "update settings a, settings b "
3266 "set b.data = a.data "
3267 "where a.value = 'BackendServerIP6' "
3268 "and b.hostname = a.hostname "
3269 "and b.value = 'BackendServerAddr' "
3270 "and b.data = '127.0.0.1' "
3271 "and a.data != '::1' "
3272 "and a.data is not null "
3273 "and a.data != ''; ",
3276 "update settings a, settings b, settings c "
3277 "set c.data = a.data "
3278 "where a.value = 'MasterServerIP' "
3279 "and b.value = 'MasterServerName' "
3280 "and c.value = 'BackendServerAddr' "
3281 "and c.hostname = b.data;",
3283 "delete from settings "
3284 "where value in ('WatchTVGuide');"
3288 updates,
"1347", dbver))
3292 if (dbver ==
"1347")
3295 "ALTER TABLE record MODIFY COLUMN startdate DATE DEFAULT NULL",
3296 "ALTER TABLE record MODIFY COLUMN enddate DATE DEFAULT NULL",
3297 "ALTER TABLE record MODIFY COLUMN starttime TIME DEFAULT NULL",
3298 "ALTER TABLE record MODIFY COLUMN endtime TIME DEFAULT NULL"
3301 updates,
"1348", dbver))
3305 if (dbver ==
"1348")
3308 "update capturecard "
3309 " set videodevice=left(videodevice, "
3310 " locate('-', videodevice)-1) "
3311 " where cardtype='HDHOMERUN' "
3312 " and videodevice like '%-%'"
3315 updates,
"1349", dbver))
3319 if (dbver ==
"1349")
3325 updates,
"1350", dbver))
3329 if (dbver ==
"1350")
3332 "ALTER TABLE videosource ADD COLUMN bouquet_id INT DEFAULT 0;",
3333 "ALTER TABLE videosource ADD COLUMN region_id INT DEFAULT 0;"
3336 updates,
"1351", dbver))
3340 if (dbver ==
"1351")
3343 "ALTER TABLE videosource MODIFY bouquet_id INT UNSIGNED;",
3344 "ALTER TABLE videosource MODIFY region_id INT UNSIGNED;",
3345 "ALTER TABLE channel ADD COLUMN service_type INT UNSIGNED DEFAULT 0 AFTER serviceid;"
3348 updates,
"1352", dbver))
3352 if (dbver ==
"1352")
3355 "ALTER TABLE capturecard MODIFY schedgroup TINYINT(1) DEFAULT 1 NOT NULL"
3358 updates,
"1353", dbver))
3362 if (dbver ==
"1353")
3365 "ALTER TABLE channel ADD COLUMN deleted TIMESTAMP NULL"
3368 updates,
"1354", dbver))
3372 if (dbver ==
"1354")
3375 "ALTER TABLE videosource ADD COLUMN scanfrequency INT UNSIGNED DEFAULT 0;"
3378 updates,
"1355", dbver))
3382 if (dbver ==
"1355")
3385 "UPDATE capturecard "
3386 "SET displayname = CONCAT('Input ', cardid) "
3387 "WHERE displayname = ''"
3390 updates,
"1356", dbver))
3394 if (dbver ==
"1356")
3397 "REPLACE INTO recordfilter (filterid, description, clause, "
3399 " VALUES (12, 'Priority channel', 'channel.recpriority > 0', 0)"
3402 updates,
"1357", dbver))
3406 if (dbver ==
"1357")
3410 std::vector<MythVideoProfileItem> profiles;
3413 query.
prepare(
"SELECT profileid, value, data FROM displayprofiles "
3414 "ORDER BY profileid");
3421 uint currentprofile = 0;
3422 while (query.
next())
3424 if (query.
value(0).toUInt() != currentprofile)
3429 profiles.push_back(temp);
3432 currentprofile = query.
value(0).toUInt();
3434 temp.
Set(query.
value(1).toString(), query.
value(2).toString());
3440 profiles.push_back(temp);
3450 QString olddecoder =
profile.Get(
"pref_decoder");
3451 QString oldrender =
profile.Get(
"pref_videorenderer");
3452 QString olddeint0 =
profile.Get(
"pref_deint0");
3453 QString olddeint1 =
profile.Get(
"pref_deint1");
3455 if (oldrender ==
"xv-blit")
3457 newdecoder =
"ffmpeg";
3458 newrender =
"opengl-yv12";
3460 if (olddecoder ==
"openmax" || oldrender ==
"openmax")
3462 newdecoder =
"mmal-dec";
3463 newrender =
"opengl-yv12";
3465 if ((olddecoder ==
"mediacodec") || (olddecoder ==
"nvdec") ||
3466 (olddecoder ==
"vda") || (olddecoder ==
"vaapi2") ||
3467 (olddecoder ==
"vaapi" && oldrender ==
"openglvaapi") ||
3468 (olddecoder ==
"vdpau" && oldrender ==
"vdpau"))
3470 if (oldrender !=
"opengl-hw")
3471 newrender =
"opengl-hw";
3473 if (olddecoder ==
"vda")
3475 if (olddecoder ==
"vaapi2")
3476 newdecoder =
"vaapi";
3478 auto UpdateDeinterlacer = [](
const QString &Olddeint, QString &Newdeint,
const QString &
Decoder)
3480 if (Olddeint.isEmpty())
3484 else if (Olddeint ==
"none" ||
3494 QStringList newsettings;
3495 bool driver = (
Decoder !=
"ffmpeg") &&
3496 (Olddeint.contains(
"vaapi") || Olddeint.contains(
"vdpau") ||
3497 Olddeint.contains(
"nvdec"));
3500 if (Olddeint.contains(
"opengl") || driver)
3503 if (Olddeint.contains(
"greedy") || Olddeint.contains(
"yadif") ||
3504 Olddeint.contains(
"kernel") || Olddeint.contains(
"advanced") ||
3505 Olddeint.contains(
"compensated") || Olddeint.contains(
"adaptive"))
3509 else if (Olddeint.contains(
"bob") || Olddeint.contains(
"onefield") ||
3510 Olddeint.contains(
"linedouble"))
3518 Newdeint = newsettings.join(
":");
3521 QString decoder = newdecoder.isEmpty() ? olddecoder : newdecoder;
3522 UpdateDeinterlacer(olddeint0, newdeint0, decoder);
3523 UpdateDeinterlacer(olddeint1, newdeint1, decoder);
3525 auto UpdateData = [](
uint ProfileID,
const QString &Value,
const QString &Data)
3529 "UPDATE displayprofiles SET data = :DATA "
3530 "WHERE profileid = :PROFILEID AND value = :VALUE");
3531 update.
bindValue(
":PROFILEID", ProfileID);
3535 LOG(VB_GENERAL, LOG_ERR,
3536 QString(
"Error updating display profile id %1").arg(ProfileID));
3540 if (!newdecoder.isEmpty())
3541 UpdateData(
id,
"pref_decoder", newdecoder);
3542 if (!newrender.isEmpty())
3543 UpdateData(
id,
"pref_videorenderer", newrender);
3544 if (!newdeint0.isEmpty())
3545 UpdateData(
id,
"pref_deint0", newdeint0);
3546 if (!newdeint1.isEmpty())
3547 UpdateData(
id,
"pref_deint1", newdeint1);
3554 "DELETE FROM keybindings WHERE action='TOGGLESTUDIOLEVELS'"
3558 updates,
"1358", dbver))
3562 if (dbver ==
"1358")
3566 "ALTER TABLE videosource "
3567 " CHANGE COLUMN userid userid VARCHAR(128) NULL DEFAULT NULL",
3569 "UPDATE videosource "
3570 " SET userid = NULL "
3571 " WHERE userid = ''",
3573 "UPDATE videosource "
3574 " SET userid = NULL, password = NULL "
3575 " WHERE xmltvgrabber IN ('schedulesdirect1', 'datadirect')"
3578 updates,
"1359", dbver))
3582 if (dbver ==
"1359")
3588 "UPDATE settings SET data='0.0' WHERE value='XineramaMonitorAspectRatio'"
3591 updates,
"1360", dbver))
3595 if (dbver ==
"1360")
3600 std::vector<MythVideoProfileItem> profiles;
3603 query.
prepare(
"SELECT profileid, value, data FROM displayprofiles "
3604 "ORDER BY profileid");
3612 uint currentprofile = 0;
3613 while (query.
next())
3615 if (query.
value(0).toUInt() != currentprofile)
3620 profiles.push_back(temp);
3623 currentprofile = query.
value(0).toUInt();
3625 temp.
Set(query.
value(1).toString(), query.
value(2).toString());
3631 profiles.push_back(temp);
3637 QString oldrender =
profile.Get(
"pref_videorenderer");
3638 if (oldrender ==
"quartz-blit" || oldrender ==
"openglvaapi" ||
3639 oldrender ==
"vdpau")
3641 auto UpdateData = [](
uint ProfileID,
const QString &Value,
const QString &Data)
3645 "UPDATE displayprofiles SET data = :DATA "
3646 "WHERE profileid = :PROFILEID AND value = :VALUE");
3647 update.
bindValue(
":PROFILEID", ProfileID);
3651 LOG(VB_GENERAL, LOG_ERR,
3652 QString(
"Error updating display profile id %1").arg(ProfileID));
3656 UpdateData(
id,
"pref_decoder",
"ffmpeg");
3657 UpdateData(
id,
"pref_videorenderer",
"opengl-yv12");
3666 if (dbver ==
"1361")
3669 "ALTER TABLE program CHANGE COLUMN videoprop videoprop "
3670 " SET('WIDESCREEN', 'HDTV', 'MPEG2', 'AVC', 'HEVC') NOT NULL; ",
3671 "ALTER TABLE recordedprogram CHANGE COLUMN videoprop videoprop "
3672 " SET('WIDESCREEN', 'HDTV', 'MPEG2', 'AVC', 'HEVC', "
3673 " '720', '1080', '4K', '3DTV', 'PROGRESSIVE', "
3674 " 'DAMAGED') NOT NULL; ",
3677 updates,
"1362", dbver))
3681 if (dbver ==
"1362")
3685 QString(
"select index_name from information_schema.statistics "
3686 "where table_schema = '%1' "
3687 "and table_name = 'recordedartwork' "
3688 "and seq_in_index = 1 "
3689 "and column_name = 'inetref'")
3699 "CREATE INDEX recordedartwork_ix1 ON recordedartwork (inetref); "
3703 if (select.
size() > 0) {
3708 updates,
"1363", dbver))
3712 if (dbver ==
"1363")
3717 query.
prepare(
"INSERT INTO profilegroups SET name = 'Sat>IP Recorder', "
3718 "cardtype = 'SATIP', is_default = 1;");
3729 query.
prepare(
"INSERT INTO recordingprofiles SET name = \"Default\", profilegroup = :GROUPID;");
3733 MythDB::DBError(
"Unable to insert 'Default' recordingprofile.", query);
3737 query.
prepare(
"INSERT INTO recordingprofiles SET name = \"Live TV\", profilegroup = :GROUPID;");
3741 MythDB::DBError(
"Unable to insert 'Live TV' recordingprofile.", query);
3745 query.
prepare(
"INSERT INTO recordingprofiles SET name = \"High Quality\", profilegroup = :GROUPID;");
3749 MythDB::DBError(
"Unable to insert 'High Quality' recordingprofile.", query);
3753 query.
prepare(
"INSERT INTO recordingprofiles SET name = \"Low Quality\", profilegroup = :GROUPID;");
3757 MythDB::DBError(
"Unable to insert 'Low Quality' recordingprofile.", query);
3765 if (dbver ==
"1364")
3769 "UPDATE record SET dupmethod = 1 WHERE search = 5"
3772 updates,
"1365", dbver))
3776 if (dbver ==
"1365")
3779 "ALTER TABLE channelscan_channel ADD COLUMN service_type INT UNSIGNED NOT NULL DEFAULT 0;"
3782 updates,
"1366", dbver))
3786 if (dbver ==
"1366")
3789 "ALTER TABLE channelscan_dtv_multiplex ADD COLUMN signal_strength INT NOT NULL DEFAULT 0;"
3792 updates,
"1367", dbver))
3796 if (dbver ==
"1367")
3799 "ALTER TABLE videosource ADD COLUMN lcnoffset INT UNSIGNED DEFAULT 0;"
3802 updates,
"1368", dbver))
3805 if (dbver ==
"1368")
3809 "ALTER TABLE credits ADD COLUMN priority "
3810 " TINYINT UNSIGNED DEFAULT 0;",
3811 "ALTER TABLE credits ADD COLUMN roleid "
3812 " MEDIUMINT UNSIGNED DEFAULT 0;",
3813 "ALTER TABLE credits drop key chanid, "
3814 " add unique key `chanid` "
3815 " (chanid, starttime, person, role, roleid);"
3816 "ALTER TABLE recordedcredits ADD COLUMN priority "
3817 " TINYINT UNSIGNED DEFAULT 0;",
3818 "ALTER TABLE recordedcredits ADD COLUMN roleid "
3819 " MEDIUMINT UNSIGNED DEFAULT 0;",
3820 "ALTER TABLE recordedcredits drop key chanid, "
3821 " add unique key `chanid` "
3822 " (chanid, starttime, person, role, roleid);"
3823 "CREATE TABLE roles (roleid MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,"
3824 " `name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin"
3825 " NOT NULL DEFAULT '',"
3826 " PRIMARY KEY (roleid),"
3827 " UNIQUE KEY `name` (`name`)"
3828 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
3831 updates,
"1369", dbver))
3834 if (dbver ==
"1369")
3837 "ALTER TABLE programrating MODIFY COLUMN `system` "
3839 "ALTER TABLE programrating MODIFY COLUMN rating "
3841 "ALTER TABLE recordedrating MODIFY COLUMN `system` "
3843 "ALTER TABLE recordedrating MODIFY COLUMN rating "
3847 updates,
"1370", dbver))
3851 if (dbver ==
"1370")
3855 "UPDATE settings SET data=REPLACE(data, 'ttvdb.py', 'ttvdb4.py') "
3856 "WHERE value='TelevisionGrabber'"
3859 updates,
"1371", dbver))
3863 if (dbver ==
"1371")
3870 updates,
"1372", dbver))
3874 if (dbver ==
"1372")
3877 "ALTER TABLE recorded ADD COLUMN lastplay "
3878 " TINYINT UNSIGNED DEFAULT 0 AFTER bookmark;",
3881 updates,
"1373", dbver))
3885 if (dbver ==
"1373")
3889 "UPDATE record SET inetref=REPLACE(inetref, 'ttvdb.py', 'ttvdb4.py');",
3890 "UPDATE recorded SET inetref=REPLACE(inetref, 'ttvdb.py', 'ttvdb4.py');",
3891 "UPDATE oldrecorded SET inetref=REPLACE(inetref, 'ttvdb.py', 'ttvdb4.py');",
3892 "UPDATE videometadata SET inetref=REPLACE(inetref, 'ttvdb.py', 'ttvdb4.py');",
3893 "UPDATE program SET inetref=REPLACE(inetref, 'ttvdb.py', 'ttvdb4.py');",
3894 "UPDATE recordedprogram SET inetref=REPLACE(inetref, 'ttvdb.py', 'ttvdb4.py');",
3895 "UPDATE recordedartwork SET inetref=REPLACE(inetref, 'ttvdb.py', 'ttvdb4.py');"
3898 updates,
"1374", dbver))
3902 if (dbver ==
"1374")
3907 updates,
"1375", dbver))
3911 if (dbver ==
"1375")
3927 updates,
"1376", dbver))
3931 if (dbver ==
"1376")
3934 "DROP TABLE IF EXISTS `logging`;",
3935 "UPDATE settings SET data='0' WHERE value='LogEnabled'; ",
3938 updates,
"1377", dbver))
3942 if (dbver ==
"1377")
3947 updates,
"1378", dbver))
3951 if (dbver ==
"1378")
3954 "CREATE INDEX dir_id ON gallery_files (dir_id);"
3957 updates,
"1379", dbver))
3985 query.
prepare(
"SHOW TABLES;");
3990 QString msg = QString(
3991 "Told to create a NEW database schema, but the database\n"
3992 "already has %1 tables.\n"
3993 "If you are sure this is a good MythTV database, verify\n"
3994 "that the settings table has the DBSchemaVer variable.\n")
3995 .arg(query.
size() - 1);
3996 LOG(VB_GENERAL, LOG_ERR, msg);
4000 LOG(VB_GENERAL, LOG_NOTICE,
4001 "Inserting MythTV initial database information.");
4004 "CREATE TABLE capturecard ("
4005 " cardid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4006 " videodevice varchar(128) DEFAULT NULL,"
4007 " audiodevice varchar(128) DEFAULT NULL,"
4008 " vbidevice varchar(128) DEFAULT NULL,"
4009 " cardtype varchar(32) DEFAULT 'V4L',"
4010 " defaultinput varchar(32) DEFAULT 'Television',"
4011 " audioratelimit int(11) DEFAULT NULL,"
4012 " hostname varchar(64) DEFAULT NULL,"
4013 " dvb_swfilter int(11) DEFAULT '0',"
4014 " dvb_sat_type int(11) NOT NULL DEFAULT '0',"
4015 " dvb_wait_for_seqstart int(11) NOT NULL DEFAULT '1',"
4016 " skipbtaudio tinyint(1) DEFAULT '0',"
4017 " dvb_on_demand tinyint(4) NOT NULL DEFAULT '0',"
4018 " dvb_diseqc_type smallint(6) DEFAULT NULL,"
4019 " firewire_speed int(10) unsigned NOT NULL DEFAULT '0',"
4020 " firewire_model varchar(32) DEFAULT NULL,"
4021 " firewire_connection int(10) unsigned NOT NULL DEFAULT '0',"
4022 " signal_timeout int(11) NOT NULL DEFAULT '1000',"
4023 " channel_timeout int(11) NOT NULL DEFAULT '3000',"
4024 " dvb_tuning_delay int(10) unsigned NOT NULL DEFAULT '0',"
4025 " contrast int(11) NOT NULL DEFAULT '0',"
4026 " brightness int(11) NOT NULL DEFAULT '0',"
4027 " colour int(11) NOT NULL DEFAULT '0',"
4028 " hue int(11) NOT NULL DEFAULT '0',"
4029 " diseqcid int(10) unsigned DEFAULT NULL,"
4030 " dvb_eitscan tinyint(1) NOT NULL DEFAULT '1',"
4031 " PRIMARY KEY (cardid)"
4032 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4033 "CREATE TABLE cardinput ("
4034 " cardinputid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4035 " cardid int(10) unsigned NOT NULL DEFAULT '0',"
4036 " sourceid int(10) unsigned NOT NULL DEFAULT '0',"
4037 " inputname varchar(32) NOT NULL DEFAULT '',"
4038 " externalcommand varchar(128) DEFAULT NULL,"
4039 " changer_device varchar(128) DEFAULT NULL,"
4040 " changer_model varchar(128) DEFAULT NULL,"
4041 " tunechan varchar(10) DEFAULT NULL,"
4042 " startchan varchar(10) DEFAULT NULL,"
4043 " displayname varchar(64) NOT NULL DEFAULT '',"
4044 " dishnet_eit tinyint(1) NOT NULL DEFAULT '0',"
4045 " recpriority int(11) NOT NULL DEFAULT '0',"
4046 " quicktune tinyint(4) NOT NULL DEFAULT '0',"
4047 " schedorder int(10) unsigned NOT NULL DEFAULT '0',"
4048 " livetvorder int(10) unsigned NOT NULL DEFAULT '0',"
4049 " PRIMARY KEY (cardinputid)"
4050 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4051 "CREATE TABLE channel ("
4052 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4053 " channum varchar(10) NOT NULL DEFAULT '',"
4054 " freqid varchar(10) DEFAULT NULL,"
4055 " sourceid int(10) unsigned DEFAULT NULL,"
4056 " callsign varchar(20) NOT NULL DEFAULT '',"
4057 " `name` varchar(64) NOT NULL DEFAULT '',"
4058 " icon varchar(255) NOT NULL DEFAULT '',"
4059 " finetune int(11) DEFAULT NULL,"
4060 " videofilters varchar(255) NOT NULL DEFAULT '',"
4061 " xmltvid varchar(255) NOT NULL DEFAULT '',"
4062 " recpriority int(10) NOT NULL DEFAULT '0',"
4063 " contrast int(11) DEFAULT '32768',"
4064 " brightness int(11) DEFAULT '32768',"
4065 " colour int(11) DEFAULT '32768',"
4066 " hue int(11) DEFAULT '32768',"
4067 " tvformat varchar(10) NOT NULL DEFAULT 'Default',"
4068 " visible tinyint(1) NOT NULL DEFAULT '1',"
4069 " outputfilters varchar(255) NOT NULL DEFAULT '',"
4070 " useonairguide tinyint(1) DEFAULT '0',"
4071 " mplexid smallint(6) DEFAULT NULL,"
4072 " serviceid mediumint(8) unsigned DEFAULT NULL,"
4073 " tmoffset int(11) NOT NULL DEFAULT '0',"
4074 " atsc_major_chan int(10) unsigned NOT NULL DEFAULT '0',"
4075 " atsc_minor_chan int(10) unsigned NOT NULL DEFAULT '0',"
4076 " last_record datetime NOT NULL,"
4077 " default_authority varchar(32) NOT NULL DEFAULT '',"
4078 " commmethod int(11) NOT NULL DEFAULT '-1',"
4079 " iptvid smallint(6) unsigned DEFAULT NULL,"
4080 " PRIMARY KEY (chanid),"
4081 " KEY channel_src (channum,sourceid),"
4082 " KEY sourceid (sourceid,xmltvid,chanid),"
4083 " KEY visible (visible)"
4084 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4085 "CREATE TABLE channelgroup ("
4086 " id int(10) unsigned NOT NULL AUTO_INCREMENT,"
4087 " chanid int(11) unsigned NOT NULL DEFAULT '0',"
4088 " grpid int(11) NOT NULL DEFAULT '1',"
4090 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4091 "CREATE TABLE channelgroupnames ("
4092 " grpid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4093 " `name` varchar(64) NOT NULL DEFAULT '0',"
4094 " PRIMARY KEY (grpid)"
4095 ") ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;",
4096 "CREATE TABLE channelscan ("
4097 " scanid int(3) unsigned NOT NULL AUTO_INCREMENT,"
4098 " cardid int(3) unsigned NOT NULL,"
4099 " sourceid int(3) unsigned NOT NULL,"
4100 " processed tinyint(1) unsigned NOT NULL,"
4101 " scandate datetime NOT NULL,"
4102 " PRIMARY KEY (scanid)"
4103 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4104 "CREATE TABLE channelscan_channel ("
4105 " transportid int(6) unsigned NOT NULL,"
4106 " scanid int(3) unsigned NOT NULL,"
4107 " mplex_id smallint(6) NOT NULL,"
4108 " source_id int(3) unsigned NOT NULL,"
4109 " channel_id int(3) unsigned NOT NULL DEFAULT '0',"
4110 " callsign varchar(20) NOT NULL DEFAULT '',"
4111 " service_name varchar(64) NOT NULL DEFAULT '',"
4112 " chan_num varchar(10) NOT NULL DEFAULT '',"
4113 " service_id mediumint(8) unsigned NOT NULL DEFAULT '0',"
4114 " atsc_major_channel int(4) unsigned NOT NULL DEFAULT '0',"
4115 " atsc_minor_channel int(4) unsigned NOT NULL DEFAULT '0',"
4116 " use_on_air_guide tinyint(1) NOT NULL DEFAULT '0',"
4117 " hidden tinyint(1) NOT NULL DEFAULT '0',"
4118 " hidden_in_guide tinyint(1) NOT NULL DEFAULT '0',"
4119 " freqid varchar(10) NOT NULL DEFAULT '',"
4120 " icon varchar(255) NOT NULL DEFAULT '',"
4121 " tvformat varchar(10) NOT NULL DEFAULT 'Default',"
4122 " xmltvid varchar(64) NOT NULL DEFAULT '',"
4123 " pat_tsid int(5) unsigned NOT NULL DEFAULT '0',"
4124 " vct_tsid int(5) unsigned NOT NULL DEFAULT '0',"
4125 " vct_chan_tsid int(5) unsigned NOT NULL DEFAULT '0',"
4126 " sdt_tsid int(5) unsigned NOT NULL DEFAULT '0',"
4127 " orig_netid int(5) unsigned NOT NULL DEFAULT '0',"
4128 " netid int(5) unsigned NOT NULL DEFAULT '0',"
4129 " si_standard varchar(10) NOT NULL,"
4130 " in_channels_conf tinyint(1) unsigned NOT NULL DEFAULT '0',"
4131 " in_pat tinyint(1) unsigned NOT NULL DEFAULT '0',"
4132 " in_pmt tinyint(1) unsigned NOT NULL DEFAULT '0',"
4133 " in_vct tinyint(1) unsigned NOT NULL DEFAULT '0',"
4134 " in_nit tinyint(1) unsigned NOT NULL DEFAULT '0',"
4135 " in_sdt tinyint(1) unsigned NOT NULL DEFAULT '0',"
4136 " is_encrypted tinyint(1) unsigned NOT NULL DEFAULT '0',"
4137 " is_data_service tinyint(1) unsigned NOT NULL DEFAULT '0',"
4138 " is_audio_service tinyint(1) unsigned NOT NULL DEFAULT '0',"
4139 " is_opencable tinyint(1) unsigned NOT NULL DEFAULT '0',"
4140 " could_be_opencable tinyint(1) unsigned NOT NULL DEFAULT '0',"
4141 " decryption_status smallint(2) unsigned NOT NULL DEFAULT '0',"
4142 " default_authority varchar(32) NOT NULL DEFAULT ''"
4143 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4144 "CREATE TABLE channelscan_dtv_multiplex ("
4145 " transportid int(6) unsigned NOT NULL AUTO_INCREMENT,"
4146 " scanid int(3) unsigned NOT NULL,"
4147 " mplexid smallint(6) unsigned NOT NULL,"
4148 " frequency bigint(12) unsigned NOT NULL,"
4149 " inversion char(1) NOT NULL DEFAULT 'a',"
4150 " symbolrate bigint(12) unsigned NOT NULL DEFAULT '0',"
4151 " fec varchar(10) NOT NULL DEFAULT 'auto',"
4152 " polarity char(1) NOT NULL DEFAULT '',"
4153 " hp_code_rate varchar(10) NOT NULL DEFAULT 'auto',"
4154 " mod_sys varchar(10) DEFAULT NULL,"
4155 " rolloff varchar(4) DEFAULT NULL,"
4156 " lp_code_rate varchar(10) NOT NULL DEFAULT 'auto',"
4157 " modulation varchar(10) NOT NULL DEFAULT 'auto',"
4158 " transmission_mode char(1) NOT NULL DEFAULT 'a',"
4159 " guard_interval varchar(10) NOT NULL DEFAULT 'auto',"
4160 " hierarchy varchar(10) NOT NULL DEFAULT 'auto',"
4161 " bandwidth char(1) NOT NULL DEFAULT 'a',"
4162 " sistandard varchar(10) NOT NULL,"
4163 " tuner_type smallint(2) unsigned NOT NULL,"
4164 " default_authority varchar(32) NOT NULL DEFAULT '',"
4165 " PRIMARY KEY (transportid)"
4166 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4167 "CREATE TABLE codecparams ("
4168 " `profile` int(10) unsigned NOT NULL DEFAULT '0',"
4169 " `name` varchar(128) NOT NULL DEFAULT '',"
4170 " `value` varchar(128) DEFAULT NULL,"
4171 " PRIMARY KEY (`profile`,`name`)"
4172 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4173 "CREATE TABLE credits ("
4174 " person mediumint(8) unsigned NOT NULL DEFAULT '0',"
4175 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4176 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4177 " role set('actor','director','producer','executive_producer','writer','guest_star','host','adapter','presenter','commentator','guest') NOT NULL DEFAULT '',"
4178 " UNIQUE KEY chanid (chanid,starttime,person,role),"
4179 " KEY person (person,role)"
4180 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4181 "CREATE TABLE customexample ("
4182 " rulename varchar(64) NOT NULL,"
4183 " fromclause varchar(10000) NOT NULL DEFAULT '',"
4184 " whereclause varchar(10000) NOT NULL DEFAULT '',"
4185 " search tinyint(4) NOT NULL DEFAULT '0',"
4186 " PRIMARY KEY (rulename)"
4187 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4188 "CREATE TABLE diseqc_config ("
4189 " cardinputid int(10) unsigned NOT NULL,"
4190 " diseqcid int(10) unsigned NOT NULL,"
4191 " `value` varchar(16) NOT NULL DEFAULT '',"
4192 " KEY id (cardinputid)"
4193 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4194 "CREATE TABLE diseqc_tree ("
4195 " diseqcid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4196 " parentid int(10) unsigned DEFAULT NULL,"
4197 " ordinal tinyint(3) unsigned NOT NULL,"
4198 " `type` varchar(16) NOT NULL DEFAULT '',"
4199 " subtype varchar(16) NOT NULL DEFAULT '',"
4200 " description varchar(32) NOT NULL DEFAULT '',"
4201 " switch_ports tinyint(3) unsigned NOT NULL DEFAULT '0',"
4202 " rotor_hi_speed float NOT NULL DEFAULT '0',"
4203 " rotor_lo_speed float NOT NULL DEFAULT '0',"
4204 " rotor_positions varchar(255) NOT NULL DEFAULT '',"
4205 " lnb_lof_switch int(10) NOT NULL DEFAULT '0',"
4206 " lnb_lof_hi int(10) NOT NULL DEFAULT '0',"
4207 " lnb_lof_lo int(10) NOT NULL DEFAULT '0',"
4208 " cmd_repeat int(11) NOT NULL DEFAULT '1',"
4209 " lnb_pol_inv tinyint(4) NOT NULL DEFAULT '0',"
4210 " address tinyint(3) unsigned NOT NULL DEFAULT '0',"
4211 " PRIMARY KEY (diseqcid),"
4212 " KEY parentid (parentid)"
4213 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4214 "CREATE TABLE displayprofilegroups ("
4215 " `name` varchar(128) NOT NULL,"
4216 " hostname varchar(64) NOT NULL,"
4217 " profilegroupid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4218 " PRIMARY KEY (`name`,hostname),"
4219 " UNIQUE KEY profilegroupid (profilegroupid)"
4220 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4221 "CREATE TABLE displayprofiles ("
4222 " profilegroupid int(10) unsigned NOT NULL,"
4223 " profileid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4224 " `value` varchar(128) NOT NULL,"
4225 " `data` varchar(255) NOT NULL DEFAULT '',"
4226 " KEY profilegroupid (profilegroupid),"
4227 " KEY profileid (profileid,`value`),"
4228 " KEY profileid_2 (profileid)"
4229 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4230 "CREATE TABLE dtv_multiplex ("
4231 " mplexid smallint(6) NOT NULL AUTO_INCREMENT,"
4232 " sourceid smallint(6) DEFAULT NULL,"
4233 " transportid int(11) DEFAULT NULL,"
4234 " networkid int(11) DEFAULT NULL,"
4235 " frequency int(11) DEFAULT NULL,"
4236 " inversion char(1) DEFAULT 'a',"
4237 " symbolrate int(11) DEFAULT NULL,"
4238 " fec varchar(10) DEFAULT 'auto',"
4239 " polarity char(1) DEFAULT NULL,"
4240 " modulation varchar(10) DEFAULT 'auto',"
4241 " bandwidth char(1) DEFAULT 'a',"
4242 " lp_code_rate varchar(10) DEFAULT 'auto',"
4243 " transmission_mode char(1) DEFAULT 'a',"
4244 " guard_interval varchar(10) DEFAULT 'auto',"
4245 " visible smallint(1) NOT NULL DEFAULT '0',"
4246 " constellation varchar(10) DEFAULT 'auto',"
4247 " hierarchy varchar(10) DEFAULT 'auto',"
4248 " hp_code_rate varchar(10) DEFAULT 'auto',"
4249 " mod_sys varchar(10) DEFAULT NULL,"
4250 " rolloff varchar(4) DEFAULT NULL,"
4251 " sistandard varchar(10) DEFAULT 'dvb',"
4252 " serviceversion smallint(6) DEFAULT '33',"
4253 " updatetimestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,"
4254 " default_authority varchar(32) NOT NULL DEFAULT '',"
4255 " PRIMARY KEY (mplexid)"
4256 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4257 "CREATE TABLE dtv_privatetypes ("
4258 " sitype varchar(4) NOT NULL DEFAULT '',"
4259 " networkid int(11) NOT NULL DEFAULT '0',"
4260 " private_type varchar(20) NOT NULL DEFAULT '',"
4261 " private_value varchar(100) NOT NULL DEFAULT ''"
4262 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4263 "CREATE TABLE dvdbookmark ("
4264 " serialid varchar(16) NOT NULL DEFAULT '',"
4265 " `name` varchar(32) DEFAULT NULL,"
4266 " title smallint(6) NOT NULL DEFAULT '0',"
4267 " audionum tinyint(4) NOT NULL DEFAULT '-1',"
4268 " subtitlenum tinyint(4) NOT NULL DEFAULT '-1',"
4269 " framenum bigint(20) NOT NULL DEFAULT '0',"
4270 " `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,"
4271 " PRIMARY KEY (serialid)"
4272 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4273 "CREATE TABLE dvdinput ("
4274 " intid int(10) unsigned NOT NULL,"
4275 " hsize int(10) unsigned DEFAULT NULL,"
4276 " vsize int(10) unsigned DEFAULT NULL,"
4277 " ar_num int(10) unsigned DEFAULT NULL,"
4278 " ar_denom int(10) unsigned DEFAULT NULL,"
4279 " fr_code int(10) unsigned DEFAULT NULL,"
4280 " letterbox tinyint(1) DEFAULT NULL,"
4281 " v_format varchar(16) DEFAULT NULL,"
4282 " PRIMARY KEY (intid)"
4283 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4284 "CREATE TABLE dvdtranscode ("
4285 " intid int(11) NOT NULL AUTO_INCREMENT,"
4286 " input int(10) unsigned DEFAULT NULL,"
4287 " `name` varchar(128) NOT NULL,"
4288 " sync_mode int(10) unsigned DEFAULT NULL,"
4289 " use_yv12 tinyint(1) DEFAULT NULL,"
4290 " cliptop int(11) DEFAULT NULL,"
4291 " clipbottom int(11) DEFAULT NULL,"
4292 " clipleft int(11) DEFAULT NULL,"
4293 " clipright int(11) DEFAULT NULL,"
4294 " f_resize_h int(11) DEFAULT NULL,"
4295 " f_resize_w int(11) DEFAULT NULL,"
4296 " hq_resize_h int(11) DEFAULT NULL,"
4297 " hq_resize_w int(11) DEFAULT NULL,"
4298 " grow_h int(11) DEFAULT NULL,"
4299 " grow_w int(11) DEFAULT NULL,"
4300 " clip2top int(11) DEFAULT NULL,"
4301 " clip2bottom int(11) DEFAULT NULL,"
4302 " clip2left int(11) DEFAULT NULL,"
4303 " clip2right int(11) DEFAULT NULL,"
4304 " codec varchar(128) NOT NULL,"
4305 " codec_param varchar(128) DEFAULT NULL,"
4306 " bitrate int(11) DEFAULT NULL,"
4307 " a_sample_r int(11) DEFAULT NULL,"
4308 " a_bitrate int(11) DEFAULT NULL,"
4309 " two_pass tinyint(1) DEFAULT NULL,"
4310 " tc_param varchar(128) DEFAULT NULL,"
4311 " PRIMARY KEY (intid)"
4312 ") ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;",
4313 "CREATE TABLE eit_cache ("
4314 " chanid int(10) NOT NULL,"
4315 " eventid int(10) unsigned NOT NULL DEFAULT '0',"
4316 " tableid tinyint(3) unsigned NOT NULL,"
4317 " version tinyint(3) unsigned NOT NULL,"
4318 " endtime int(10) unsigned NOT NULL,"
4319 " `status` tinyint(4) NOT NULL DEFAULT '0',"
4320 " PRIMARY KEY (chanid,eventid,`status`)"
4321 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4322 "CREATE TABLE filemarkup ("
4323 " filename text NOT NULL,"
4324 " mark mediumint(8) unsigned NOT NULL DEFAULT '0',"
4325 " `offset` bigint(20) unsigned DEFAULT NULL,"
4326 " `type` tinyint(4) NOT NULL DEFAULT '0',"
4327 " KEY filename (filename(255))"
4328 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4329 "CREATE TABLE housekeeping ("
4330 " tag varchar(64) NOT NULL DEFAULT '',"
4331 " lastrun datetime DEFAULT NULL,"
4332 " PRIMARY KEY (tag)"
4333 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4334 "CREATE TABLE inputgroup ("
4335 " cardinputid int(10) unsigned NOT NULL,"
4336 " inputgroupid int(10) unsigned NOT NULL,"
4337 " inputgroupname varchar(32) NOT NULL"
4338 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4339 "CREATE TABLE internetcontent ("
4340 " `name` varchar(255) NOT NULL,"
4341 " thumbnail varchar(255) DEFAULT NULL,"
4342 " `type` smallint(3) NOT NULL,"
4343 " author varchar(128) NOT NULL,"
4344 " description text NOT NULL,"
4345 " commandline text NOT NULL,"
4346 " version double NOT NULL,"
4347 " updated datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4348 " search tinyint(1) NOT NULL,"
4349 " tree tinyint(1) NOT NULL,"
4350 " podcast tinyint(1) NOT NULL,"
4351 " download tinyint(1) NOT NULL,"
4352 " `host` varchar(128) DEFAULT NULL"
4353 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4354 "CREATE TABLE internetcontentarticles ("
4355 " feedtitle varchar(255) NOT NULL,"
4356 " path text NOT NULL,"
4357 " paththumb text NOT NULL,"
4358 " title varchar(255) NOT NULL,"
4359 " subtitle varchar(255) NOT NULL,"
4360 " season smallint(5) NOT NULL DEFAULT '0',"
4361 " episode smallint(5) NOT NULL DEFAULT '0',"
4362 " description text NOT NULL,"
4363 " url text NOT NULL,"
4364 " `type` smallint(3) NOT NULL,"
4365 " thumbnail text NOT NULL,"
4366 " mediaURL text NOT NULL,"
4367 " author varchar(255) NOT NULL,"
4368 " `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4369 " `time` int(11) NOT NULL,"
4370 " rating varchar(255) NOT NULL,"
4371 " filesize bigint(20) NOT NULL,"
4372 " player varchar(255) NOT NULL,"
4373 " playerargs text NOT NULL,"
4374 " download varchar(255) NOT NULL,"
4375 " downloadargs text NOT NULL,"
4376 " width smallint(6) NOT NULL,"
4377 " height smallint(6) NOT NULL,"
4378 " `language` varchar(128) NOT NULL,"
4379 " podcast tinyint(1) NOT NULL,"
4380 " downloadable tinyint(1) NOT NULL,"
4381 " customhtml tinyint(1) NOT NULL,"
4382 " countries varchar(255) NOT NULL"
4383 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4384 "CREATE TABLE inuseprograms ("
4385 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4386 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4387 " recusage varchar(128) NOT NULL DEFAULT '',"
4388 " lastupdatetime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4389 " hostname varchar(64) NOT NULL DEFAULT '',"
4390 " rechost varchar(64) NOT NULL,"
4391 " recdir varchar(255) NOT NULL DEFAULT '',"
4392 " KEY chanid (chanid,starttime),"
4393 " KEY recusage (recusage,lastupdatetime)"
4394 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4395 "CREATE TABLE iptv_channel ("
4396 " iptvid smallint(6) unsigned NOT NULL AUTO_INCREMENT,"
4397 " chanid int(10) unsigned NOT NULL,"
4398 " url text NOT NULL,"
4399 " `type` set('data','rfc2733-1','rfc2733-2','rfc5109-1','rfc5109-2','smpte2022-1','smpte2022-2') DEFAULT NULL,"
4400 " bitrate int(10) unsigned NOT NULL,"
4401 " PRIMARY KEY (iptvid)"
4402 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4403 "CREATE TABLE jobqueue ("
4404 " id int(11) NOT NULL AUTO_INCREMENT,"
4405 " chanid int(10) NOT NULL DEFAULT '0',"
4406 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4407 " inserttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4408 " `type` int(11) NOT NULL DEFAULT '0',"
4409 " cmds int(11) NOT NULL DEFAULT '0',"
4410 " flags int(11) NOT NULL DEFAULT '0',"
4411 " `status` int(11) NOT NULL DEFAULT '0',"
4412 " statustime timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,"
4413 " hostname varchar(64) NOT NULL DEFAULT '',"
4414 " args blob NOT NULL,"
4415 " `comment` varchar(128) NOT NULL DEFAULT '',"
4416 " schedruntime datetime NOT NULL DEFAULT '2007-01-01 00:00:00',"
4417 " PRIMARY KEY (id),"
4418 " UNIQUE KEY chanid (chanid,starttime,`type`,inserttime)"
4419 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4420 "CREATE TABLE jumppoints ("
4421 " destination varchar(128) NOT NULL DEFAULT '',"
4422 " description varchar(255) DEFAULT NULL,"
4423 " keylist varchar(128) DEFAULT NULL,"
4424 " hostname varchar(64) NOT NULL DEFAULT '',"
4425 " PRIMARY KEY (destination,hostname)"
4426 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4427 "CREATE TABLE keybindings ("
4428 " `context` varchar(32) NOT NULL DEFAULT '',"
4429 " `action` varchar(32) NOT NULL DEFAULT '',"
4430 " description varchar(255) DEFAULT NULL,"
4431 " keylist varchar(128) DEFAULT NULL,"
4432 " hostname varchar(64) NOT NULL DEFAULT '',"
4433 " PRIMARY KEY (`context`,`action`,hostname)"
4434 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4435 "CREATE TABLE keyword ("
4436 " phrase varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',"
4437 " searchtype int(10) unsigned NOT NULL DEFAULT '3',"
4438 " UNIQUE KEY phrase (phrase,searchtype)"
4439 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4440 "CREATE TABLE livestream ("
4441 " id int(10) unsigned NOT NULL AUTO_INCREMENT,"
4442 " width int(10) unsigned NOT NULL,"
4443 " height int(10) unsigned NOT NULL,"
4444 " bitrate int(10) unsigned NOT NULL,"
4445 " audiobitrate int(10) unsigned NOT NULL,"
4446 " samplerate int(10) unsigned NOT NULL,"
4447 " audioonlybitrate int(10) unsigned NOT NULL,"
4448 " segmentsize int(10) unsigned NOT NULL DEFAULT '10',"
4449 " maxsegments int(10) unsigned NOT NULL DEFAULT '0',"
4450 " startsegment int(10) unsigned NOT NULL DEFAULT '0',"
4451 " currentsegment int(10) unsigned NOT NULL DEFAULT '0',"
4452 " segmentcount int(10) unsigned NOT NULL DEFAULT '0',"
4453 " percentcomplete int(10) unsigned NOT NULL DEFAULT '0',"
4454 " created datetime NOT NULL,"
4455 " lastmodified datetime NOT NULL,"
4456 " relativeurl varchar(512) NOT NULL,"
4457 " fullurl varchar(1024) NOT NULL,"
4458 " `status` int(10) unsigned NOT NULL DEFAULT '0',"
4459 " statusmessage varchar(256) NOT NULL,"
4460 " sourcefile varchar(512) NOT NULL,"
4461 " sourcehost varchar(64) NOT NULL,"
4462 " sourcewidth int(10) unsigned NOT NULL DEFAULT '0',"
4463 " sourceheight int(10) unsigned NOT NULL DEFAULT '0',"
4464 " outdir varchar(256) NOT NULL,"
4465 " outbase varchar(128) NOT NULL,"
4467 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4468 "CREATE TABLE logging ("
4469 " id bigint(20) unsigned NOT NULL AUTO_INCREMENT,"
4470 " `host` varchar(64) NOT NULL DEFAULT '',"
4471 " application varchar(64) NOT NULL DEFAULT '',"
4472 " pid int(11) NOT NULL DEFAULT '0',"
4473 " tid int(11) NOT NULL DEFAULT '0',"
4474 " thread varchar(64) NOT NULL DEFAULT '',"
4475 " filename varchar(255) NOT NULL DEFAULT '',"
4476 " line int(11) NOT NULL DEFAULT '0',"
4477 " `function` varchar(255) NOT NULL DEFAULT '',"
4478 " msgtime datetime NOT NULL,"
4479 " `level` int(11) NOT NULL DEFAULT '0',"
4480 " message varchar(2048) NOT NULL,"
4481 " PRIMARY KEY (id),"
4482 " KEY `host` (`host`,application,pid,msgtime),"
4483 " KEY msgtime (msgtime),"
4484 " KEY `level` (`level`)"
4485 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4486 "CREATE TABLE mythlog ("
4487 " logid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4488 " module varchar(32) NOT NULL DEFAULT '',"
4489 " priority int(11) NOT NULL DEFAULT '0',"
4490 " acknowledged tinyint(1) DEFAULT '0',"
4491 " logdate datetime DEFAULT NULL,"
4492 " `host` varchar(128) DEFAULT NULL,"
4493 " message varchar(255) NOT NULL DEFAULT '',"
4494 " details varchar(16000) NOT NULL DEFAULT '',"
4495 " PRIMARY KEY (logid),"
4496 " KEY module (module)"
4497 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4498 "CREATE TABLE oldfind ("
4499 " recordid int(11) NOT NULL DEFAULT '0',"
4500 " findid int(11) NOT NULL DEFAULT '0',"
4501 " PRIMARY KEY (recordid,findid)"
4502 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4503 "CREATE TABLE oldprogram ("
4504 " oldtitle varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',"
4505 " airdate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4506 " PRIMARY KEY (oldtitle)"
4507 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4508 "CREATE TABLE oldrecorded ("
4509 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4510 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4511 " endtime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4512 " title varchar(128) NOT NULL DEFAULT '',"
4513 " subtitle varchar(128) NOT NULL DEFAULT '',"
4514 " description varchar(16000) NOT NULL DEFAULT '',"
4515 " season smallint(5) NOT NULL,"
4516 " episode smallint(5) NOT NULL,"
4517 " category varchar(64) NOT NULL DEFAULT '',"
4518 " seriesid varchar(40) NOT NULL DEFAULT '',"
4519 " programid varchar(40) NOT NULL DEFAULT '',"
4520 " inetref varchar(40) NOT NULL,"
4521 " findid int(11) NOT NULL DEFAULT '0',"
4522 " recordid int(11) NOT NULL DEFAULT '0',"
4523 " station varchar(20) NOT NULL DEFAULT '',"
4524 " rectype int(10) unsigned NOT NULL DEFAULT '0',"
4525 " `duplicate` tinyint(1) NOT NULL DEFAULT '0',"
4526 " recstatus int(11) NOT NULL DEFAULT '0',"
4527 " reactivate smallint(6) NOT NULL DEFAULT '0',"
4528 " generic tinyint(1) NOT NULL,"
4529 " future tinyint(1) NOT NULL DEFAULT '0',"
4530 " PRIMARY KEY (station,starttime,title),"
4531 " KEY endtime (endtime),"
4532 " KEY title (title),"
4533 " KEY seriesid (seriesid),"
4534 " KEY programid (programid),"
4535 " KEY recordid (recordid),"
4536 " KEY recstatus (recstatus,programid,seriesid),"
4537 " KEY recstatus_2 (recstatus,title,subtitle),"
4538 " KEY future (future),"
4539 " KEY chanid (chanid,starttime),"
4540 " KEY subtitle (subtitle),"
4541 " KEY description (description(255))"
4542 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4543 "CREATE TABLE people ("
4544 " person mediumint(8) unsigned NOT NULL AUTO_INCREMENT,"
4545 " `name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',"
4546 " PRIMARY KEY (person),"
4547 " UNIQUE KEY `name` (`name`(41))"
4548 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4549 "CREATE TABLE pidcache ("
4550 " chanid smallint(6) NOT NULL DEFAULT '0',"
4551 " pid int(11) NOT NULL DEFAULT '-1',"
4552 " tableid int(11) NOT NULL DEFAULT '-1',"
4553 " KEY chanid (chanid)"
4554 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4555 "CREATE TABLE playgroup ("
4556 " `name` varchar(32) NOT NULL DEFAULT '',"
4557 " titlematch varchar(255) NOT NULL DEFAULT '',"
4558 " skipahead int(11) NOT NULL DEFAULT '0',"
4559 " skipback int(11) NOT NULL DEFAULT '0',"
4560 " timestretch int(11) NOT NULL DEFAULT '0',"
4561 " jump int(11) NOT NULL DEFAULT '0',"
4562 " PRIMARY KEY (`name`)"
4563 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4564 "CREATE TABLE powerpriority ("
4565 " priorityname varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,"
4566 " recpriority int(10) NOT NULL DEFAULT '0',"
4567 " selectclause varchar(16000) NOT NULL DEFAULT '',"
4568 " PRIMARY KEY (priorityname)"
4569 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4570 "CREATE TABLE profilegroups ("
4571 " id int(10) unsigned NOT NULL AUTO_INCREMENT,"
4572 " `name` varchar(128) DEFAULT NULL,"
4573 " cardtype varchar(32) NOT NULL DEFAULT 'V4L',"
4574 " is_default int(1) DEFAULT '0',"
4575 " hostname varchar(64) DEFAULT NULL,"
4576 " PRIMARY KEY (id),"
4577 " UNIQUE KEY `name` (`name`,hostname),"
4578 " KEY cardtype (cardtype)"
4579 ") ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;",
4580 "CREATE TABLE program ("
4581 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4582 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4583 " endtime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4584 " title varchar(128) NOT NULL DEFAULT '',"
4585 " subtitle varchar(128) NOT NULL DEFAULT '',"
4586 " description varchar(16000) NOT NULL DEFAULT '',"
4587 " category varchar(64) NOT NULL DEFAULT '',"
4588 " category_type varchar(64) NOT NULL DEFAULT '',"
4589 " airdate year(4) NOT NULL DEFAULT '0000',"
4590 " stars float NOT NULL DEFAULT '0',"
4591 " previouslyshown tinyint(4) NOT NULL DEFAULT '0',"
4592 " title_pronounce varchar(128) NOT NULL DEFAULT '',"
4593 " stereo tinyint(1) NOT NULL DEFAULT '0',"
4594 " subtitled tinyint(1) NOT NULL DEFAULT '0',"
4595 " hdtv tinyint(1) NOT NULL DEFAULT '0',"
4596 " closecaptioned tinyint(1) NOT NULL DEFAULT '0',"
4597 " partnumber int(11) NOT NULL DEFAULT '0',"
4598 " parttotal int(11) NOT NULL DEFAULT '0',"
4599 " seriesid varchar(64) NOT NULL DEFAULT '',"
4600 " originalairdate date DEFAULT NULL,"
4601 " showtype varchar(30) NOT NULL DEFAULT '',"
4602 " colorcode varchar(20) NOT NULL DEFAULT '',"
4603 " syndicatedepisodenumber varchar(20) NOT NULL DEFAULT '',"
4604 " programid varchar(64) NOT NULL DEFAULT '',"
4605 " manualid int(10) unsigned NOT NULL DEFAULT '0',"
4606 " generic tinyint(1) DEFAULT '0',"
4607 " listingsource int(11) NOT NULL DEFAULT '0',"
4608 " `first` tinyint(1) NOT NULL DEFAULT '0',"
4609 " `last` tinyint(1) NOT NULL DEFAULT '0',"
4610 " audioprop set('STEREO','MONO','SURROUND','DOLBY','HARDHEAR','VISUALIMPAIR') NOT NULL,"
4611 " subtitletypes set('HARDHEAR','NORMAL','ONSCREEN','SIGNED') NOT NULL,"
4612 " videoprop set('HDTV','WIDESCREEN','AVC') NOT NULL,"
4613 " PRIMARY KEY (chanid,starttime,manualid),"
4614 " KEY endtime (endtime),"
4615 " KEY title (title),"
4616 " KEY title_pronounce (title_pronounce),"
4617 " KEY seriesid (seriesid),"
4618 " KEY id_start_end (chanid,starttime,endtime),"
4619 " KEY program_manualid (manualid),"
4620 " KEY previouslyshown (previouslyshown),"
4621 " KEY programid (programid,starttime),"
4622 " KEY starttime (starttime),"
4623 " KEY subtitle (subtitle),"
4624 " KEY description (description(255))"
4625 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4626 "CREATE TABLE programgenres ("
4627 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4628 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4629 " relevance char(1) NOT NULL DEFAULT '',"
4630 " genre varchar(30) DEFAULT NULL,"
4631 " PRIMARY KEY (chanid,starttime,relevance),"
4632 " KEY genre (genre)"
4633 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4634 "CREATE TABLE programrating ("
4635 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4636 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4637 " `system` varchar(8) DEFAULT NULL,"
4638 " rating varchar(16) DEFAULT NULL,"
4639 " UNIQUE KEY chanid (chanid,starttime,`system`,rating),"
4640 " KEY starttime (starttime,`system`)"
4641 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4642 "CREATE TABLE recgrouppassword ("
4643 " recgroup varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',"
4644 " `password` varchar(10) NOT NULL DEFAULT '',"
4645 " PRIMARY KEY (recgroup)"
4646 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4647 "CREATE TABLE record ("
4648 " recordid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4649 " `type` int(10) unsigned NOT NULL DEFAULT '0',"
4650 " chanid int(10) unsigned DEFAULT NULL,"
4651 " starttime time NOT NULL DEFAULT '00:00:00',"
4652 " startdate date NOT NULL DEFAULT '0000-00-00',"
4653 " endtime time NOT NULL DEFAULT '00:00:00',"
4654 " enddate date NOT NULL DEFAULT '0000-00-00',"
4655 " title varchar(128) NOT NULL DEFAULT '',"
4656 " subtitle varchar(128) NOT NULL DEFAULT '',"
4657 " description varchar(16000) NOT NULL DEFAULT '',"
4658 " season smallint(5) NOT NULL,"
4659 " episode smallint(5) NOT NULL,"
4660 " category varchar(64) NOT NULL DEFAULT '',"
4661 " `profile` varchar(128) NOT NULL DEFAULT 'Default',"
4662 " recpriority int(10) NOT NULL DEFAULT '0',"
4663 " autoexpire int(11) NOT NULL DEFAULT '0',"
4664 " maxepisodes int(11) NOT NULL DEFAULT '0',"
4665 " maxnewest int(11) NOT NULL DEFAULT '0',"
4666 " startoffset int(11) NOT NULL DEFAULT '0',"
4667 " endoffset int(11) NOT NULL DEFAULT '0',"
4668 " recgroup varchar(32) NOT NULL DEFAULT 'Default',"
4669 " dupmethod int(11) NOT NULL DEFAULT '6',"
4670 " dupin int(11) NOT NULL DEFAULT '15',"
4671 " station varchar(20) NOT NULL DEFAULT '',"
4672 " seriesid varchar(40) NOT NULL DEFAULT '',"
4673 " programid varchar(40) NOT NULL DEFAULT '',"
4674 " inetref varchar(40) NOT NULL,"
4675 " search int(10) unsigned NOT NULL DEFAULT '0',"
4676 " autotranscode tinyint(1) NOT NULL DEFAULT '0',"
4677 " autocommflag tinyint(1) NOT NULL DEFAULT '0',"
4678 " autouserjob1 tinyint(1) NOT NULL DEFAULT '0',"
4679 " autouserjob2 tinyint(1) NOT NULL DEFAULT '0',"
4680 " autouserjob3 tinyint(1) NOT NULL DEFAULT '0',"
4681 " autouserjob4 tinyint(1) NOT NULL DEFAULT '0',"
4682 " autometadata tinyint(1) NOT NULL DEFAULT '0',"
4683 " findday tinyint(4) NOT NULL DEFAULT '0',"
4684 " findtime time NOT NULL DEFAULT '00:00:00',"
4685 " findid int(11) NOT NULL DEFAULT '0',"
4686 " inactive tinyint(1) NOT NULL DEFAULT '0',"
4687 " parentid int(11) NOT NULL DEFAULT '0',"
4688 " transcoder int(11) NOT NULL DEFAULT '0',"
4689 " playgroup varchar(32) NOT NULL DEFAULT 'Default',"
4690 " prefinput int(10) NOT NULL DEFAULT '0',"
4691 " next_record datetime NOT NULL,"
4692 " last_record datetime NOT NULL,"
4693 " last_delete datetime NOT NULL,"
4694 " storagegroup varchar(32) NOT NULL DEFAULT 'Default',"
4695 " avg_delay int(11) NOT NULL DEFAULT '100',"
4696 " filter int(10) unsigned NOT NULL DEFAULT '0',"
4697 " PRIMARY KEY (recordid),"
4698 " KEY chanid (chanid,starttime),"
4699 " KEY title (title),"
4700 " KEY seriesid (seriesid),"
4701 " KEY programid (programid),"
4702 " KEY maxepisodes (maxepisodes),"
4703 " KEY search (search),"
4704 " KEY `type` (`type`)"
4705 ") ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;",
4706 "CREATE TABLE recorded ("
4707 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4708 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4709 " endtime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4710 " title varchar(128) NOT NULL DEFAULT '',"
4711 " subtitle varchar(128) NOT NULL DEFAULT '',"
4712 " description varchar(16000) NOT NULL DEFAULT '',"
4713 " season smallint(5) NOT NULL,"
4714 " episode smallint(5) NOT NULL,"
4715 " category varchar(64) NOT NULL DEFAULT '',"
4716 " hostname varchar(64) NOT NULL DEFAULT '',"
4717 " bookmark tinyint(1) NOT NULL DEFAULT '0',"
4718 " editing int(10) unsigned NOT NULL DEFAULT '0',"
4719 " cutlist tinyint(1) NOT NULL DEFAULT '0',"
4720 " autoexpire int(11) NOT NULL DEFAULT '0',"
4721 " commflagged int(10) unsigned NOT NULL DEFAULT '0',"
4722 " recgroup varchar(32) NOT NULL DEFAULT 'Default',"
4723 " recordid int(11) DEFAULT NULL,"
4724 " seriesid varchar(40) NOT NULL DEFAULT '',"
4725 " programid varchar(40) NOT NULL DEFAULT '',"
4726 " inetref varchar(40) NOT NULL,"
4727 " lastmodified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,"
4728 " filesize bigint(20) NOT NULL DEFAULT '0',"
4729 " stars float NOT NULL DEFAULT '0',"
4730 " previouslyshown tinyint(1) DEFAULT '0',"
4731 " originalairdate date DEFAULT NULL,"
4732 " `preserve` tinyint(1) NOT NULL DEFAULT '0',"
4733 " findid int(11) NOT NULL DEFAULT '0',"
4734 " deletepending tinyint(1) NOT NULL DEFAULT '0',"
4735 " transcoder int(11) NOT NULL DEFAULT '0',"
4736 " timestretch float NOT NULL DEFAULT '1',"
4737 " recpriority int(11) NOT NULL DEFAULT '0',"
4738 " basename varchar(255) NOT NULL,"
4739 " progstart datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4740 " progend datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4741 " playgroup varchar(32) NOT NULL DEFAULT 'Default',"
4742 " `profile` varchar(32) NOT NULL DEFAULT '',"
4743 " `duplicate` tinyint(1) NOT NULL DEFAULT '0',"
4744 " transcoded tinyint(1) NOT NULL DEFAULT '0',"
4745 " watched tinyint(4) NOT NULL DEFAULT '0',"
4746 " storagegroup varchar(32) NOT NULL DEFAULT 'Default',"
4747 " bookmarkupdate timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',"
4748 " PRIMARY KEY (chanid,starttime),"
4749 " KEY endtime (endtime),"
4750 " KEY seriesid (seriesid),"
4751 " KEY programid (programid),"
4752 " KEY title (title),"
4753 " KEY recordid (recordid),"
4754 " KEY deletepending (deletepending,lastmodified),"
4755 " KEY recgroup (recgroup,endtime)"
4756 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4757 "CREATE TABLE recordedartwork ("
4758 " inetref varchar(255) NOT NULL,"
4759 " season smallint(5) NOT NULL,"
4760 " `host` text NOT NULL,"
4761 " coverart text NOT NULL,"
4762 " fanart text NOT NULL,"
4763 " banner text NOT NULL"
4764 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4765 "CREATE TABLE recordedcredits ("
4766 " person mediumint(8) unsigned NOT NULL DEFAULT '0',"
4767 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4768 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4769 " role set('actor','director','producer','executive_producer','writer','guest_star','host','adapter','presenter','commentator','guest') NOT NULL DEFAULT '',"
4770 " UNIQUE KEY chanid (chanid,starttime,person,role),"
4771 " KEY person (person,role)"
4772 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4773 "CREATE TABLE recordedfile ("
4774 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4775 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4776 " basename varchar(128) NOT NULL DEFAULT '',"
4777 " filesize bigint(20) NOT NULL DEFAULT '0',"
4778 " width smallint(5) unsigned NOT NULL DEFAULT '0',"
4779 " height smallint(5) unsigned NOT NULL DEFAULT '0',"
4780 " fps float(6,3) NOT NULL DEFAULT '0.000',"
4781 " aspect float(8,6) NOT NULL DEFAULT '0.000000',"
4782 " audio_sample_rate smallint(5) unsigned NOT NULL DEFAULT '0',"
4783 " audio_bits_per_sample smallint(5) unsigned NOT NULL DEFAULT '0',"
4784 " audio_channels tinyint(3) unsigned NOT NULL DEFAULT '0',"
4785 " audio_type varchar(255) NOT NULL DEFAULT '',"
4786 " video_type varchar(255) NOT NULL DEFAULT '',"
4787 " `comment` varchar(255) NOT NULL DEFAULT '',"
4788 " hostname varchar(64) NOT NULL,"
4789 " storagegroup varchar(32) NOT NULL,"
4790 " id int(11) NOT NULL AUTO_INCREMENT,"
4791 " PRIMARY KEY (id),"
4792 " UNIQUE KEY chanid (chanid,starttime,basename),"
4793 " KEY basename (basename)"
4794 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4795 "CREATE TABLE recordedmarkup ("
4796 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4797 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4798 " mark mediumint(8) unsigned NOT NULL DEFAULT '0',"
4799 " `type` tinyint(4) NOT NULL DEFAULT '0',"
4800 " `data` int(11) unsigned DEFAULT NULL,"
4801 " PRIMARY KEY (chanid,starttime,`type`,mark)"
4802 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4803 "CREATE TABLE recordedprogram ("
4804 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4805 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4806 " endtime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4807 " title varchar(128) NOT NULL DEFAULT '',"
4808 " subtitle varchar(128) NOT NULL DEFAULT '',"
4809 " description varchar(16000) NOT NULL DEFAULT '',"
4810 " category varchar(64) NOT NULL DEFAULT '',"
4811 " category_type varchar(64) NOT NULL DEFAULT '',"
4812 " airdate year(4) NOT NULL DEFAULT '0000',"
4813 " stars float unsigned NOT NULL DEFAULT '0',"
4814 " previouslyshown tinyint(4) NOT NULL DEFAULT '0',"
4815 " title_pronounce varchar(128) NOT NULL DEFAULT '',"
4816 " stereo tinyint(1) NOT NULL DEFAULT '0',"
4817 " subtitled tinyint(1) NOT NULL DEFAULT '0',"
4818 " hdtv tinyint(1) NOT NULL DEFAULT '0',"
4819 " closecaptioned tinyint(1) NOT NULL DEFAULT '0',"
4820 " partnumber int(11) NOT NULL DEFAULT '0',"
4821 " parttotal int(11) NOT NULL DEFAULT '0',"
4822 " seriesid varchar(40) NOT NULL DEFAULT '',"
4823 " originalairdate date DEFAULT NULL,"
4824 " showtype varchar(30) NOT NULL DEFAULT '',"
4825 " colorcode varchar(20) NOT NULL DEFAULT '',"
4826 " syndicatedepisodenumber varchar(20) NOT NULL DEFAULT '',"
4827 " programid varchar(40) NOT NULL DEFAULT '',"
4828 " manualid int(10) unsigned NOT NULL DEFAULT '0',"
4829 " generic tinyint(1) DEFAULT '0',"
4830 " listingsource int(11) NOT NULL DEFAULT '0',"
4831 " `first` tinyint(1) NOT NULL DEFAULT '0',"
4832 " `last` tinyint(1) NOT NULL DEFAULT '0',"
4833 " audioprop set('STEREO','MONO','SURROUND','DOLBY','HARDHEAR','VISUALIMPAIR') NOT NULL,"
4834 " subtitletypes set('HARDHEAR','NORMAL','ONSCREEN','SIGNED') NOT NULL,"
4835 " videoprop set('HDTV','WIDESCREEN','AVC','720','1080','DAMAGED') NOT NULL,"
4836 " PRIMARY KEY (chanid,starttime,manualid),"
4837 " KEY endtime (endtime),"
4838 " KEY title (title),"
4839 " KEY title_pronounce (title_pronounce),"
4840 " KEY seriesid (seriesid),"
4841 " KEY programid (programid),"
4842 " KEY id_start_end (chanid,starttime,endtime)"
4843 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4844 "CREATE TABLE recordedrating ("
4845 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4846 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4847 " `system` varchar(8) DEFAULT NULL,"
4848 " rating varchar(16) DEFAULT NULL,"
4849 " UNIQUE KEY chanid (chanid,starttime,`system`,rating),"
4850 " KEY starttime (starttime,`system`)"
4851 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4852 "CREATE TABLE recordedseek ("
4853 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4854 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4855 " mark mediumint(8) unsigned NOT NULL DEFAULT '0',"
4856 " `offset` bigint(20) unsigned NOT NULL,"
4857 " `type` tinyint(4) NOT NULL DEFAULT '0',"
4858 " PRIMARY KEY (chanid,starttime,`type`,mark)"
4859 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4860 "CREATE TABLE recordfilter ("
4861 " filterid int(10) unsigned NOT NULL,"
4862 " description varchar(64) DEFAULT NULL,"
4863 " clause varchar(256) DEFAULT NULL,"
4864 " newruledefault tinyint(1) DEFAULT '0',"
4865 " PRIMARY KEY (filterid)"
4866 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4867 "CREATE TABLE recordingprofiles ("
4868 " id int(10) unsigned NOT NULL AUTO_INCREMENT,"
4869 " `name` varchar(128) DEFAULT NULL,"
4870 " videocodec varchar(128) DEFAULT NULL,"
4871 " audiocodec varchar(128) DEFAULT NULL,"
4872 " profilegroup int(10) unsigned NOT NULL DEFAULT '0',"
4873 " PRIMARY KEY (id),"
4874 " KEY profilegroup (profilegroup)"
4875 ") ENGINE=MyISAM AUTO_INCREMENT=70 DEFAULT CHARSET=utf8;",
4876 "CREATE TABLE recordmatch ("
4877 " recordid int(10) unsigned NOT NULL,"
4878 " chanid int(10) unsigned NOT NULL,"
4879 " starttime datetime NOT NULL,"
4880 " manualid int(10) unsigned NOT NULL,"
4881 " oldrecduplicate tinyint(1) DEFAULT NULL,"
4882 " recduplicate tinyint(1) DEFAULT NULL,"
4883 " findduplicate tinyint(1) DEFAULT NULL,"
4884 " oldrecstatus int(11) DEFAULT NULL,"
4885 " findid int(11) NOT NULL DEFAULT '0',"
4886 " UNIQUE KEY recordid (recordid,chanid,starttime),"
4887 " KEY chanid (chanid,starttime,manualid),"
4888 " KEY recordid_2 (recordid,findid)"
4889 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4890 "CREATE TABLE scannerfile ("
4891 " fileid bigint(20) unsigned NOT NULL AUTO_INCREMENT,"
4892 " filesize bigint(20) unsigned NOT NULL DEFAULT '0',"
4893 " filehash varchar(64) NOT NULL DEFAULT '',"
4894 " added timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,"
4895 " PRIMARY KEY (fileid),"
4896 " UNIQUE KEY filehash (filehash)"
4897 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4898 "CREATE TABLE scannerpath ("
4899 " fileid bigint(20) unsigned NOT NULL,"
4900 " hostname varchar(64) NOT NULL DEFAULT 'localhost',"
4901 " storagegroup varchar(32) NOT NULL DEFAULT 'Default',"
4902 " filename varchar(255) NOT NULL DEFAULT '',"
4903 " PRIMARY KEY (fileid)"
4904 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4905 "CREATE TABLE settings ("
4906 " `value` varchar(128) NOT NULL DEFAULT '',"
4907 " `data` varchar(16000) NOT NULL DEFAULT '',"
4908 " hostname varchar(64) DEFAULT NULL,"
4909 " KEY `value` (`value`,hostname)"
4910 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4911 "CREATE TABLE storagegroup ("
4912 " id int(11) NOT NULL AUTO_INCREMENT,"
4913 " groupname varchar(32) NOT NULL,"
4914 " hostname varchar(64) NOT NULL DEFAULT '',"
4915 " dirname varchar(235) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',"
4916 " PRIMARY KEY (id),"
4917 " UNIQUE KEY grouphostdir (groupname,hostname,dirname),"
4918 " KEY hostname (hostname)"
4919 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4920 "CREATE TABLE tvchain ("
4921 " chanid int(10) unsigned NOT NULL DEFAULT '0',"
4922 " starttime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4923 " chainid varchar(128) NOT NULL DEFAULT '',"
4924 " chainpos int(10) NOT NULL DEFAULT '0',"
4925 " discontinuity tinyint(1) NOT NULL DEFAULT '0',"
4926 " watching int(10) NOT NULL DEFAULT '0',"
4927 " hostprefix varchar(128) NOT NULL DEFAULT '',"
4928 " cardtype varchar(32) NOT NULL DEFAULT 'V4L',"
4929 " input varchar(32) NOT NULL DEFAULT '',"
4930 " channame varchar(32) NOT NULL DEFAULT '',"
4931 " endtime datetime NOT NULL DEFAULT '0000-00-00 00:00:00',"
4932 " PRIMARY KEY (chanid,starttime)"
4933 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4934 "CREATE TABLE tvosdmenu ("
4935 " osdcategory varchar(32) NOT NULL,"
4936 " livetv tinyint(4) NOT NULL DEFAULT '0',"
4937 " recorded tinyint(4) NOT NULL DEFAULT '0',"
4938 " video tinyint(4) NOT NULL DEFAULT '0',"
4939 " dvd tinyint(4) NOT NULL DEFAULT '0',"
4940 " description varchar(32) NOT NULL,"
4941 " PRIMARY KEY (osdcategory)"
4942 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4943 "CREATE TABLE upnpmedia ("
4944 " intid int(10) unsigned NOT NULL DEFAULT '0',"
4945 " class varchar(64) NOT NULL DEFAULT '',"
4946 " itemtype varchar(128) NOT NULL DEFAULT '',"
4947 " parentid int(10) unsigned NOT NULL DEFAULT '0',"
4948 " itemproperties varchar(255) NOT NULL DEFAULT '',"
4949 " filepath varchar(512) NOT NULL DEFAULT '',"
4950 " title varchar(255) NOT NULL DEFAULT '',"
4951 " filename varchar(512) NOT NULL DEFAULT '',"
4952 " coverart varchar(512) NOT NULL DEFAULT '',"
4953 " PRIMARY KEY (intid),"
4954 " KEY class (class),"
4955 " KEY filepath (filepath(333)),"
4956 " KEY parentid (parentid)"
4957 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4958 "CREATE TABLE videocast ("
4959 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4960 " cast varchar(128) NOT NULL,"
4961 " PRIMARY KEY (intid)"
4962 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4963 "CREATE TABLE videocategory ("
4964 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4965 " category varchar(128) NOT NULL,"
4966 " PRIMARY KEY (intid)"
4967 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4968 "CREATE TABLE videocollection ("
4969 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4970 " title varchar(256) NOT NULL,"
4971 " contenttype set('MOVIE','TELEVISION','ADULT','MUSICVIDEO','HOMEVIDEO') NOT NULL DEFAULT '',"
4973 " network varchar(128) DEFAULT NULL,"
4974 " collectionref varchar(128) NOT NULL,"
4975 " certification varchar(128) DEFAULT NULL,"
4976 " genre varchar(128) DEFAULT '',"
4977 " releasedate date DEFAULT NULL,"
4978 " `language` varchar(10) DEFAULT NULL,"
4979 " `status` varchar(64) DEFAULT NULL,"
4980 " rating float DEFAULT '0',"
4981 " ratingcount int(10) DEFAULT '0',"
4982 " runtime smallint(5) unsigned DEFAULT '0',"
4986 " PRIMARY KEY (intid),"
4987 " KEY title (title)"
4988 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4989 "CREATE TABLE videocountry ("
4990 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4991 " country varchar(128) NOT NULL,"
4992 " PRIMARY KEY (intid)"
4993 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4994 "CREATE TABLE videogenre ("
4995 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
4996 " genre varchar(128) NOT NULL,"
4997 " PRIMARY KEY (intid)"
4998 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
4999 "CREATE TABLE videometadata ("
5000 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
5001 " title varchar(128) NOT NULL,"
5002 " subtitle text NOT NULL,"
5003 " tagline varchar(255) DEFAULT NULL,"
5004 " director varchar(128) NOT NULL,"
5005 " studio varchar(128) DEFAULT NULL,"
5007 " rating varchar(128) NOT NULL,"
5008 " inetref varchar(255) NOT NULL,"
5009 " collectionref int(10) NOT NULL DEFAULT '-1',"
5010 " homepage text NOT NULL,"
5011 " `year` int(10) unsigned NOT NULL,"
5012 " releasedate date NOT NULL,"
5013 " userrating float NOT NULL,"
5014 " length int(10) unsigned NOT NULL,"
5015 " playcount int(10) NOT NULL DEFAULT '0',"
5016 " season smallint(5) unsigned NOT NULL DEFAULT '0',"
5017 " episode smallint(5) unsigned NOT NULL DEFAULT '0',"
5018 " showlevel int(10) unsigned NOT NULL,"
5019 " filename text NOT NULL,"
5020 " `hash` varchar(128) NOT NULL,"
5021 " coverfile text NOT NULL,"
5022 " childid int(11) NOT NULL DEFAULT '-1',"
5023 " browse tinyint(1) NOT NULL DEFAULT '1',"
5024 " watched tinyint(1) NOT NULL DEFAULT '0',"
5025 " processed tinyint(1) NOT NULL DEFAULT '0',"
5026 " playcommand varchar(255) DEFAULT NULL,"
5027 " category int(10) unsigned NOT NULL DEFAULT '0',"
5029 " `host` text NOT NULL,"
5033 " insertdate timestamp NULL DEFAULT CURRENT_TIMESTAMP,"
5034 " contenttype set('MOVIE','TELEVISION','ADULT','MUSICVIDEO','HOMEVIDEO') NOT NULL DEFAULT '',"
5035 " PRIMARY KEY (intid),"
5036 " KEY director (director),"
5037 " KEY title (title)"
5038 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
5039 "CREATE TABLE videometadatacast ("
5040 " idvideo int(10) unsigned NOT NULL,"
5041 " idcast int(10) unsigned NOT NULL,"
5042 " UNIQUE KEY idvideo (idvideo,idcast)"
5043 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
5044 "CREATE TABLE videometadatacountry ("
5045 " idvideo int(10) unsigned NOT NULL,"
5046 " idcountry int(10) unsigned NOT NULL,"
5047 " UNIQUE KEY idvideo_2 (idvideo,idcountry),"
5048 " KEY idvideo (idvideo),"
5049 " KEY idcountry (idcountry)"
5050 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
5051 "CREATE TABLE videometadatagenre ("
5052 " idvideo int(10) unsigned NOT NULL,"
5053 " idgenre int(10) unsigned NOT NULL,"
5054 " UNIQUE KEY idvideo_2 (idvideo,idgenre),"
5055 " KEY idvideo (idvideo),"
5056 " KEY idgenre (idgenre)"
5057 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
5058 "CREATE TABLE videopart ("
5059 " fileid bigint(20) unsigned NOT NULL,"
5060 " videoid int(10) unsigned NOT NULL,"
5061 " `order` smallint(5) unsigned NOT NULL DEFAULT '1',"
5062 " PRIMARY KEY (videoid,`order`)"
5063 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
5064 "CREATE TABLE videopathinfo ("
5065 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
5067 " contenttype set('MOVIE','TELEVISION','ADULT','MUSICVIDEO','HOMEVIDEO') NOT NULL DEFAULT '',"
5068 " collectionref int(10) DEFAULT '0',"
5069 " recurse tinyint(1) DEFAULT '0',"
5070 " PRIMARY KEY (intid)"
5071 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
5072 "CREATE TABLE videosource ("
5073 " sourceid int(10) unsigned NOT NULL AUTO_INCREMENT,"
5074 " `name` varchar(128) NOT NULL DEFAULT '',"
5075 " xmltvgrabber varchar(128) DEFAULT NULL,"
5076 " userid varchar(128) NOT NULL DEFAULT '',"
5077 " freqtable varchar(16) NOT NULL DEFAULT 'default',"
5078 " lineupid varchar(64) DEFAULT NULL,"
5079 " `password` varchar(64) DEFAULT NULL,"
5080 " useeit smallint(6) NOT NULL DEFAULT '0',"
5081 " configpath varchar(4096) DEFAULT NULL,"
5082 " dvb_nit_id int(6) DEFAULT '-1',"
5083 " PRIMARY KEY (sourceid),"
5084 " UNIQUE KEY `name` (`name`)"
5085 ") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
5086 "CREATE TABLE videotypes ("
5087 " intid int(10) unsigned NOT NULL AUTO_INCREMENT,"
5088 " extension varchar(128) NOT NULL,"
5089 " playcommand varchar(255) NOT NULL,"
5090 " f_ignore tinyint(1) DEFAULT NULL,"
5091 " use_default tinyint(1) DEFAULT NULL,"
5092 " PRIMARY KEY (intid)"
5093 ") ENGINE=MyISAM AUTO_INCREMENT=33 DEFAULT CHARSET=utf8;",
5095 "INSERT INTO channelgroupnames VALUES (1,'Favorites');",
5096 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);"
5100 if (!performActualUpdate("MythTV", "DBSchemaVer",
5101 updates, "1307", dbver))
5104 GetMythDB()->SetHaveSchema(true);
5109 DBUpdates getRecordingExtenderDbInfo (int version)
5115 R"(DROP TABLE IF EXISTS sportscleanup;)",
5116 R"(DROP TABLE IF EXISTS sportslisting;)",
5117 R"(DROP TABLE IF EXISTS sportsapi;)",
5122 R
"(ALTER TABLE record ADD COLUMN autoextend
5123 TINYINT UNSIGNED DEFAULT 0;)",
5128 R
"(CREATE TABLE sportsapi (
5129 id INT UNSIGNED PRIMARY KEY,
5130 provider TINYINT UNSIGNED DEFAULT 0,
5131 name VARCHAR(128) NOT NULL,
5132 key1 VARCHAR(64) NOT NULL,
5133 key2 VARCHAR(64) NOT NULL,
5134 UNIQUE(provider,key1(25),key2(50))
5135 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;)",
5136 R"(INSERT INTO sportsapi
5138 ( 1,1,"Major League Baseball","baseball","mlb"),
5139 ( 2,1,"NCAA Men's Baseball","baseball","college-baseball"),
5140 ( 3,1,"NCAA Women's Softball","baseball","college-softball"),
5141 ( 4,1,"Olympic Men's Baseball","baseball","olympics-baseball"),
5142 ( 5,1,"World Baseball Classic","baseball","world-baseball-classic"),
5143 ( 6,1,"Little League Baseball","baseball","llb"),
5144 ( 7,1,"Caribbean Series","baseball","caribbean-series"),
5145 ( 8,1,"Dominican Winter League","baseball","dominican-winter-league"),
5146 ( 9,1,"Venezuelan Winter League","baseball","venezuelan-winter-league"),
5147 ( 10,1,"Mexican League","baseball","mexican-winter-league"),
5148 ( 11,1,"Puerto Rican Winter League","baseball","puerto-rican-winter-league");)",
5150 R"(INSERT INTO sportsapi
5152 ( 20,1,"National Football League","football","nfl"),
5153 ( 21,1,"NCAA - Football","football","college-football"),
5154 ( 22,1,"XFL","football","xfl"),
5155 ( 23,1,"Canadian Football League","football","cfl");)",
5157 R"(INSERT INTO sportsapi
5159 ( 40,1,"National Basketball Association","basketball","nba"),
5160 ( 41,1,"Women's National Basketball Association","basketball","wnba"),
5161 ( 42,1,"NCAA Men's Basketball","basketball","mens-college-basketball"),
5162 ( 43,1,"NCAA Women's Basketball","basketball","womens-college-basketball"),
5163 ( 44,1,"Olympics Men's Basketball","basketball","mens-olympic-basketball"),
5164 ( 45,1,"Olympics Women's Basketball","basketball","womens-olympic-basketball"),
5165 ( 46,1,"National Basketball Association Summer League Las Vegas","basketball","nba-summer-las-vegas"),
5166 ( 47,1,"National Basketball Association Summer League Utah","basketball","nba-summer-utah"),
5167 ( 48,1,"National Basketball Association Summer League Orlando","basketball","nba-summer-orlando"),
5168 ( 49,1,"National Basketball Association Summer League Sacramento","basketball","nba-summer-sacramento"),
5169 ( 50,1,"NBA G League","basketball","nba-development"),
5170 ( 51,1,"International Basketball Federation","basketball","fiba");)",
5172 R"(INSERT INTO sportsapi
5174 ( 60,1,"National Hockey League","hockey","nfl"),
5175 ( 61,1,"NCAA Men's Ice Hockey","hockey","mens-college-hockey"),
5176 ( 62,1,"NCAA Women's Hockey","hockey","womens-college-hockey"),
5177 ( 63,1,"World Cup of Hockey","hockey","hockey-world-cup"),
5178 ( 64,1,"Men's Olympic Ice Hockey","hockey","mens-olympic-hockey"),
5179 ( 65,1,"Women's Olympic Ice Hockey","hockey","womens-olympic-hockey"),
5180 ( 66,1,"NCAA Women's Field Hockey","field-hockey","womens-college-field-hockey");)",
5182 R"(INSERT INTO sportsapi
5184 ( 80,1,"NCAA Men's Volleyball","volleyball","mens-college-volleyball"),
5185 ( 81,1,"NCAA Women's Volleyball","volleyball","womens-college-volleyball");)",
5187 R"(INSERT INTO sportsapi
5189 ( 100,1,"NCAA Men's Lacrosse","lacrosse","mens-college-lacrosse"),
5190 ( 101,1,"NCAA Women's Lacrosse","lacrosse","womens-college-lacrosse");)",
5192 R"(INSERT INTO sportsapi
5194 ( 120,1,"NCAA Men's Water Polo","water-polo","mens-college-water-polo"),
5195 ( 121,1,"NCAA Women's Water Polo","water-polo","womens-college-water-polo");)",
5197 R"(INSERT INTO sportsapi
5199 ( 200,1,"NCAA Men's Soccer","soccer","usa.ncaa.m.1"),
5200 ( 201,1,"NCAA Women's Soccer","soccer","usa.ncaa.w.1"),
5201 ( 202,1,"Major League Soccer","soccer","usa.1"),
5202 ( 203,1,"English Premier League","soccer","eng.1"),
5203 ( 204,1,"English League Championship","soccer","eng.2"),
5204 ( 205,1,"Italian Serie A","soccer","ita.1"),
5205 ( 206,1,"French Ligue 1","soccer","fra.1"),
5206 ( 207,1,"French Ligue 2","soccer","fra.2"),
5207 ( 208,1,"Spanish LaLiga","soccer","esp.1"),
5208 ( 209,1,"German Bundesliga","soccer","ger.1"),
5209 ( 210,1,"German 2. Bundesliga","soccer","ger.2"),
5210 ( 211,1,"Mexican Liga BBVA MX","soccer","mex.1"),
5211 ( 212,1,"Copa Do Brasil","soccer","bra.copa_do_brazil"),
5212 ( 213,1,"CONCACAF Leagues Cup","soccer","concacaf.leagues.cup"),
5213 ( 214,1,"CONCACAF League","soccer","concacaf.league"),
5214 ( 215,1,"CONCACAF Champions League","soccer","concacaf.champions"),
5215 ( 216,1,"CONCACAF Nations League","soccer","concacaf.nations.league"),
5216 ( 217,1,"CONCACAF Gold Cup","soccer","concacaf.gold"),
5217 ( 218,1,"FIFA World Cup","soccer","fifa.world"),
5218 ( 219,1,"FIFA World Cup Qualifying - UEFA","soccer","fifa.worldq.uefa"),
5219 ( 220,1,"FIFA World Cup Qualifying - CONCACAF","soccer","fifa.worldq.concacaf"),
5220 ( 221,1,"FIFA World Cup Qualifying - CONMEBOL","soccer","fifa.worldq.conmebol"),
5221 ( 222,1,"FIFA World Cup Qualifying - AFC","soccer","fifa.worldq.afc"),
5222 ( 223,1,"FIFA World Cup Qualifying - CAF","soccer","fifa.worldq.caf"),
5223 ( 224,1,"FIFA World Cup Qualifying - OFC","soccer","fifa.worldq.ofc"),
5224 ( 225,1,"UEFA Champions League","soccer","uefa.champions"),
5225 ( 226,1,"UEFA Europa League","soccer","uefa.europa"),
5226 ( 227,1,"UEFA Europa Conference League","soccer","uefa.europa.conf"),
5227 ( 228,1,"English Carabao Cup","soccer","eng.league_cup"),
5228 ( 229,1,"USL Championship","soccer","usa.usl.1"),
5229 ( 230,1,"United States NWSL","soccer","usa.nwsl"),
5230 ( 231,1,"FA Women's Super League","soccer","eng.w.1"),
5231 ( 232,1,"English FA Cup","soccer","eng.fa"),
5232 ( 233,1,"Spanish Copa del Rey","soccer","esp.copa_del_rey"),
5233 ( 234,1,"German DFB Pokal","soccer","ger.dfb_pokal"),
5234 ( 235,1,"Italian Coppa Italia","soccer","ita.coppa_italia"),
5235 ( 236,1,"French Coupe de France","soccer","fra.coupe_de_france"),
5236 ( 237,1,"AFC Champions League","soccer","afc.champions"),
5237 ( 238,1,"Dutch KNVB Beker","soccer","ned.cup"),
5238 ( 239,1,"Dutch Eredivisie","soccer","ned.1"),
5239 ( 240,1,"Portuguese Liga","soccer","por.1"),
5240 ( 241,1,"Russian Premier League","soccer","rus.1"),
5241 ( 242,1,"Mexican Liga de Expansión MX","soccer","mex.2"),
5242 ( 243,1,"Mexican Copa MX","soccer","mex.copa_mx"),
5243 ( 244,1,"Campeones Cup","soccer","campeones.cup"),
5244 ( 245,1,"United States Open Cup","soccer","usa.open"),
5245 ( 246,1,"USL League One","soccer","usa.usl.l1"),
5246 ( 247,1,"Scottish Premiership","soccer","sco.1"),
5247 ( 248,1,"Chinese Super League","soccer","chn.1"),
5248 ( 249,1,"Australian A-League","soccer","aus.1"),
5249 ( 250,1,"International Friendly","soccer","fifa.friendly"),
5250 ( 251,1,"Women's International Friendly","soccer","fifa.friendly.w"),
5251 ( 252,1,"UEFA European Under-21 Championship Qualifying","soccer","uefa.euro_u21_qual"),
5252 ( 253,1,"FIFA Women's World Cup","soccer","fifa.wwc"),
5253 ( 254,1,"FIFA Club World Cup","soccer","fifa.cwc"),
5254 ( 255,1,"CONCACAF Gold Cup Qualifying","soccer","concacaf.gold_qual"),
5255 ( 256,1,"CONCACAF Nations League Qualifying","soccer","concacaf.nations.league_qual"),
5256 ( 257,1,"CONCACAF Cup","soccer","concacaf.confederations_playoff"),
5257 ( 258,1,"UEFA Nations League","soccer","uefa.nations"),
5258 ( 259,1,"UEFA European Championship","soccer","uefa.euro"),
5259 ( 260,1,"UEFA European Championship Qualifying","soccer","uefa.euroq"),
5260 ( 261,1,"Copa America","soccer","conmebol.america"),
5261 ( 262,1,"AFC Asian Cup","soccer","afc.asian.cup"),
5262 ( 263,1,"AFC Asian Cup Qualifiers","soccer","afc.cupq"),
5263 ( 264,1,"Africa Cup of Nations qualifying","soccer","caf.nations_qual"),
5264 ( 265,1,"Africa Cup of Nations","soccer","caf.nations"),
5265 ( 266,1,"Africa Nations Championship","soccer","caf.championship"),
5266 ( 267,1,"WAFU Cup of Nations","soccer","wafu.nations"),
5267 ( 268,1,"SheBelieves Cup","soccer","fifa.shebelieves"),
5268 ( 269,1,"FIFA Confederations Cup","soccer","fifa.confederations"),
5269 ( 270,1,"Non-FIFA Friendly","soccer","nonfifa"),
5270 ( 271,1,"Spanish LaLiga 2","soccer","esp.2"),
5271 ( 272,1,"Spanish Supercopa","soccer","esp.super_cup"),
5272 ( 273,1,"Portuguese Liga Promotion/Relegation Playoffs","soccer","por.1.promotion.relegation"),
5273 ( 274,1,"Belgian First Division A - Promotion/Relegation Playoffs","soccer","bel.promotion.relegation"),
5274 ( 275,1,"Belgian First Division A","soccer","bel.1"),
5275 ( 276,1,"Austrian Bundesliga","soccer","aut.1"),
5276 ( 277,1,"Turkish Super Lig","soccer","tur.1"),
5277 ( 278,1,"Austrian Bundesliga Promotion/Relegation Playoffs","soccer","aut.promotion.relegation"),
5278 ( 279,1,"Greek Super League","soccer","gre.1"),
5279 ( 280,1,"Greek Super League Promotion/Relegation Playoffs","soccer","gre.1.promotion.relegation"),
5280 ( 281,1,"Swiss Super League","soccer","sui.1"),
5281 ( 282,1,"Swiss Super League Promotion/Relegation Playoffs","soccer","sui.1.promotion.relegation"),
5282 ( 283,1,"UEFA Women's Champions League","soccer","uefa.wchampions"),
5283 ( 284,1,"International Champions Cup","soccer","global.champs_cup"),
5284 ( 285,1,"Women's International Champions Cup","soccer","global.wchamps_cup"),
5285 ( 286,1,"Club Friendly","soccer","club.friendly"),
5286 ( 287,1,"UEFA Champions League Qualifying","soccer","uefa.champions_qual"),
5287 ( 288,1,"UEFA Europa Conference League Qualifying","soccer","uefa.europa.conf_qual"),
5288 ( 289,1,"UEFA Europa League Qualifying","soccer","uefa.europa_qual"),
5289 ( 290,1,"UEFA Super Cup","soccer","uefa.super_cup"),
5290 ( 291,1,"English FA Community Shield","soccer","eng.charity"),
5291 ( 292,1,"Supercoppa Italiana","soccer","ita.super_cup"),
5292 ( 293,1,"French Trophee des Champions","soccer","fra.super_cup"),
5293 ( 294,1,"Dutch Johan Cruyff Shield","soccer","ned.supercup"),
5294 ( 295,1,"Trofeo Joan Gamper","soccer","esp.joan_gamper"),
5295 ( 296,1,"German DFL-Supercup","soccer","ger.super_cup"),
5296 ( 297,1,"Audi Cup","soccer","ger.audi_cup"),
5297 ( 298,1,"Premier League Asia Trophy","soccer","eng.asia_trophy"),
5298 ( 299,1,"Emirates Cup","soccer","friendly.emirates_cup"),
5299 ( 300,1,"Japanese J League World Challenge","soccer","jpn.world_challenge"),
5300 ( 301,1,"SuperCopa Euroamericana","soccer","euroamericana.supercopa"),
5301 ( 302,1,"Men's Olympic Tournament","soccer","fifa.olympics"),
5302 ( 303,1,"Women's Olympic Tournament","soccer","fifa.w.olympics"),
5303 ( 304,1,"CONMEBOL Pre-Olympic Tournament","soccer","fifa.conmebol.olympicsq"),
5304 ( 305,1,"CONCACAF Men's Olympic Qualifying","soccer","fifa.concacaf.olympicsq"),
5305 ( 306,1,"CONCACAF Women's Olympic Qualifying Tournament","soccer","fifa.w.concacaf.olympicsq"),
5306 ( 307,1,"CONCACAF Women's Championship","soccer","concacaf.womens.championship"),
5307 ( 308,1,"FIFA Under-20 World Cup","soccer","fifa.world.u20"),
5308 ( 309,1,"FIFA Under-17 World Cup","soccer","fifa.world.u17"),
5309 ( 310,1,"Toulon Tournament","soccer","global.toulon"),
5310 ( 311,1,"UEFA European Under-21 Championship","soccer","uefa.euro_u21"),
5311 ( 312,1,"UEFA European Under-19 Championship","soccer","uefa.euro.u19"),
5312 ( 313,1,"Under-21 International Friendly","soccer","fifa.friendly_u21"),
5313 ( 314,1,"UEFA Women's European Championship","soccer","uefa.weuro"),
5314 ( 315,1,"German Bundesliga Promotion/Relegation Playoff","soccer","ger.playoff.relegation"),
5315 ( 316,1,"German 2. Bundesliga Promotion/Relegation Playoffs","soccer","ger.2.promotion.relegation"),
5316 ( 317,1,"English Women's FA Cup","soccer","eng.w.fa"),
5317 ( 318,1,"English Women's FA Community Shield","soccer","eng.w.charity"),
5318 ( 319,1,"English EFL Trophy","soccer","eng.trophy"),
5319 ( 320,1,"English National League","soccer","eng.5"),
5320 ( 321,1,"English League One","soccer","eng.3"),
5321 ( 322,1,"English League Two","soccer","eng.4"),
5322 ( 323,1,"Scottish Cup","soccer","sco.tennents"),
5323 ( 324,1,"Scottish League Cup","soccer","sco.cis"),
5324 ( 325,1,"Scottish Premiership Promotion/Relegation Playoffs","soccer","sco.1.promotion.relegation"),
5325 ( 326,1,"Scottish League One","soccer","sco.3"),
5326 ( 327,1,"Scottish Championship","soccer","sco.2"),
5327 ( 328,1,"Scottish Championship Promotion/Relegation Playoffs","soccer","sco.2.promotion.relegation"),
5328 ( 329,1,"Scottish League One Promotion/Relegation Playoffs","soccer","sco.3.promotion.relegation"),
5329 ( 330,1,"Scottish League Two Promotion/Relegation Playoffs","soccer","sco.4.promotion.relegation"),
5330 ( 331,1,"Scottish League Two","soccer","sco.4"),
5331 ( 332,1,"Scottish League Challenge Cup","soccer","sco.challenge"),
5332 ( 333,1,"Dutch Eredivisie Promotion/Relegation Playoffs","soccer","ned.playoff.relegation"),
5333 ( 334,1,"Dutch Eredivisie Cup","soccer","ned.w.eredivisie_cup"),
5334 ( 335,1,"Dutch Keuken Kampioen Divisie","soccer","ned.2"),
5335 ( 336,1,"Dutch Tweede Divisie","soccer","ned.3"),
5336 ( 337,1,"Dutch KNVB Beker Vrouwen","soccer","ned.w.knvb_cup"),
5337 ( 338,1,"Dutch Vrouwen Eredivisie","soccer","ned.w.1"),
5338 ( 339,1,"Italian Serie B","soccer","ita.2"),
5339 ( 340,1,"French Ligue 1 Promotion/Relegation Playoffs","soccer","fra.1.promotion.relegation"),
5340 ( 341,1,"French Ligue 2 Promotion/Relegation Playoffs","soccer","fra.2.promotion.relegation"),
5341 ( 342,1,"Swedish Allsvenskan","soccer","swe.1"),
5342 ( 343,1,"Swedish Allsvenskanliga Promotion/Relegation Playoffs","soccer","swe.1.promotion.relegation"),
5343 ( 344,1,"Danish Superliga","soccer","den.1"),
5344 ( 345,1,"Danish SAS-Ligaen Promotion/Relegation Playoffs","soccer","den.promotion.relegation"),
5345 ( 346,1,"Romanian Liga 1 Promotion/Relegation Playoffs","soccer","rou.1.promotion.relegation"),
5346 ( 347,1,"Romanian Liga 1","soccer","rou.1"),
5347 ( 348,1,"Norwegian Eliteserien Promotion/Relegation Playoffs","soccer","nor.1.promotion.relegation"),
5348 ( 349,1,"Norwegian Eliteserien","soccer","nor.1"),
5349 ( 350,1,"Maltese Premier League","soccer","mlt.1"),
5350 ( 351,1,"Israeli Premier League","soccer","isr.1"),
5351 ( 352,1,"Irish Premier Division Promotion/Relegation Playoffs","soccer","ir1.1.promotion.relegation"),
5352 ( 353,1,"Irish Premier Division","soccer","irl.1"),
5353 ( 354,1,"Welsh Premier League","soccer","wal.1"),
5354 ( 355,1,"Northern Irish Premiership","soccer","nir.1"),
5355 ( 356,1,"CONMEBOL Copa Libertadores","soccer","conmebol.libertadores"),
5356 ( 357,1,"CONMEBOL Copa Sudamericana","soccer","conmebol.sudamericana"),
5357 ( 358,1,"CONMEBOL Recopa Sudamericana","soccer","conmebol.recopa"),
5358 ( 359,1,"Argentine Liga Profesional de Fútbol","soccer","arg.1"),
5359 ( 360,1,"Copa Argentina","soccer","arg.copa"),
5360 ( 361,1,"Argentine Copa de la Liga Profesional","soccer","arg.copa_lpf"),
5361 ( 362,1,"Argentine Copa de la Superliga","soccer","arg.copa_de_la_superliga"),
5362 ( 363,1,"Argentine Trofeo de Campeones de la Superliga","soccer","arg.trofeo_de_la_campeones"),
5363 ( 364,1,"Argentine Supercopa","soccer","arg.supercopa"),
5364 ( 365,1,"Argentine Nacional B","soccer","arg.2"),
5365 ( 366,1,"Argentine Primera B","soccer","arg.3"),
5366 ( 367,1,"Argentine Primera C","soccer","arg.4"),
5367 ( 368,1,"Argentine Primera D","soccer","arg.5"),
5368 ( 369,1,"Supercopa Do Brazil","soccer","bra.supercopa_do_brazil"),
5369 ( 370,1,"Brazilian Serie A","soccer","bra.1"),
5370 ( 371,1,"Brazilian Serie B","soccer","bra.2"),
5371 ( 372,1,"Brazilian Serie C","soccer","bra.3"),
5372 ( 373,1,"Copa Do Nordeste","soccer","bra.copa_do_nordeste"),
5373 ( 374,1,"Brazilian Campeonato Carioca","soccer","bra.camp.carioca"),
5374 ( 375,1,"Brazilian Campeonato Paulista","soccer","bra.camp.paulista"),
5375 ( 376,1,"Brazilian Campeonato Gaucho","soccer","bra.camp.gaucho"),
5376 ( 377,1,"Brazilian Campeonato Mineiro","soccer","bra.camp.mineiro"),
5377 ( 378,1,"Chilean Primera División","soccer","chi.1"),
5378 ( 379,1,"Copa Chile","soccer","chi.copa_chi"),
5379 ( 380,1,"International U20 Friendly","soccer","fifa.u20.friendly"),
5380 ( 381,1,"Segunda División de Chile","soccer","chi.2"),
5381 ( 382,1,"Chilean Supercopa","soccer","chi.super_cup"),
5382 ( 383,1,"Uruguayan Primera Division","soccer","uru.1"),
5383 ( 384,1,"Segunda División de Uruguay","soccer","uru.2"),
5384 ( 385,1,"Colombian SuperLiga","soccer","col.superliga"),
5385 ( 386,1,"Colombian Primera A","soccer","col.1"),
5386 ( 387,1,"Colombian Primera B","soccer","col.2"),
5387 ( 388,1,"Peruvian Supercopa","soccer","per.supercopa"),
5388 ( 389,1,"Copa Colombia","soccer","col.copa"),
5389 ( 390,1,"Peruvian Primera Profesional","soccer","per.1"),
5390 ( 391,1,"Paraguayan Primera Division","soccer","par.1"),
5391 ( 392,1,"Ecuadoran Primera A","soccer","ecu.1"),
5392 ( 393,1,"Ecuadoran Supercopa","soccer","ecu.supercopa"),
5393 ( 394,1,"Ecuador Serie B","soccer","ecu.2"),
5394 ( 395,1,"Venezuelan Primera Profesional","soccer","ven.1"),
5395 ( 396,1,"United States NWSL Challenge Cup","soccer","usa.nwsl.cup"),
5396 ( 397,1,"Segunda División de Venezuela","soccer","ven.2"),
5397 ( 398,1,"Bolivian Liga Profesional","soccer","bol.1"),
5398 ( 399,1,"Mexican Supercopa MX","soccer","mex.supercopa"),
5399 ( 400,1,"Mexican Campeon de Campeones","soccer","mex.campeon"),
5400 ( 401,1,"CONCACAF Champions Cup","soccer","concacaf.champions_cup"),
5401 ( 402,1,"CONCACAF U23 Tournament","soccer","concacaf.u23"),
5402 ( 403,1,"Honduran Primera Division","soccer","hon.1"),
5403 ( 404,1,"Costa Rican Primera Division","soccer","crc.1"),
5404 ( 405,1,"Jamaican Premier League","soccer","jam.1"),
5405 ( 406,1,"Guatemalan Liga Nacional","soccer","gua.1"),
5406 ( 407,1,"Australian W-League","soccer","aus.w.1"),
5407 ( 408,1,"Salvadoran Primera Division","soccer","slv.1"),
5408 ( 409,1,"AFF Cup","soccer","aff.championship"),
5409 ( 410,1,"AFC Cup","soccer","afc.cup"),
5410 ( 411,1,"SAFF Championship","soccer","afc.saff.championship"),
5411 ( 412,1,"Chinese Super League Promotion/Relegation Playoffs","soccer","chn.1.promotion.relegation"),
5412 ( 413,1,"Japanese J League","soccer","jpn.1"),
5413 ( 414,1,"Indonesian Liga 1","soccer","idn.1"),
5414 ( 415,1,"Indian Super League","soccer","ind.1"),
5415 ( 416,1,"Indian I-League","soccer","ind.2"),
5416 ( 417,1,"Malaysian Super League","soccer","mys.1"),
5417 ( 418,1,"Singaporean Premier League","soccer","sgp.1"),
5418 ( 419,1,"Thai League 1","soccer","tha.1"),
5419 ( 420,1,"Bangabandhu Cup","soccer","bangabandhu.cup"),
5420 ( 421,1,"COSAFA Cup","soccer","caf.cosafa"),
5421 ( 422,1,"CAF Champions League","soccer","caf.champions"),
5422 ( 423,1,"South African Premiership Promotion/Relegation Playoffs","soccer","rsa.1.promotion.relegation"),
5423 ( 424,1,"CAF Confederations Cup","soccer","caf.confed"),
5424 ( 425,1,"South African Premiership","soccer","rsa.1"),
5425 ( 426,1,"South African First Division","soccer","rsa.2"),
5426 ( 427,1,"South African Telkom Knockout","soccer","rsa.telkom_knockout"),
5427 ( 428,1,"South African Nedbank Cup","soccer","rsa.nedbank"),
5428 ( 429,1,"MTN 8 Cup","soccer","rsa.mtn8"),
5429 ( 430,1,"Nigerian Professional League","soccer","nga.1"),
5430 ( 431,1,"Ghanaian Premier League","soccer","gha.1"),
5431 ( 432,1,"Zambian Super League","soccer","zam.1"),
5432 ( 433,1,"Kenyan Premier League","soccer","ken.1"),
5433 ( 434,1,"Zimbabwean Premier Soccer League","soccer","zim.1"),
5434 ( 435,1,"Ugandan Premier League","soccer","uga.1"),
5435 ( 436,1,"Misc. U.S. Soccer Games","soccer","generic.ussf");)",
5437 R"(INSERT INTO sportsapi
5439 (1000,2,"Major League Baseball","baseball","mlb");)",
5441 R"(CREATE TABLE sportslisting (
5442 id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
5443 api INT UNSIGNED NOT NULL,
5444 title VARCHAR(128) NOT NULL
5445 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;)",
5447 R"(INSERT INTO sportslisting (api,title)
5449 ( 1, "\\A(?:MLB Baseball)\\z"),
5450 ( 1, "\\A(?:Béisbol MLB)\\z"),
5451 ( 1, "\\A(?:MLB All-Star Game)\\z"),
5452 ( 1, "\\A(?:World Series)\\z"),
5453 ( 2, "\\A(?:College Baseball)\\z"),
5454 ( 2, "\\A(?:College World Series)\\z"),
5455 ( 3, "\\A(?:College Softball)\\z"),
5456 ( 4, "\\A(?:Women's College World Series)\\z"),
5457 ( 10, "\\A(?:Béisbol Liga Mexicana)\\z"),
5459 ( 20, "\\A(?:N\\w+ Football)\\z"),
5460 ( 20, "\\A(?:Super Bowl( [CLXVI]+)?)\\z"),
5461 ( 20, "\\A(?:Fútbol Americano NFL)\\z"),
5462 ( 21, "\\A(?:College Football)\\z"),
5463 ( 21, "\\A(?:\\w+ Bowl)\\z"),
5464 ( 21, "\\A(?:Fútbol Americano de Universitario)\\z"),
5466 ( 40, "\\A(?:NBA Basketball)\\z"),
5467 ( 40, "\\A(?:NBA Finals)\\z"),
5468 ( 41, "\\A(?:WNBA Basketball)\\z"),
5469 ( 41, "\\A(?:WNBA Finals)\\z"),
5470 ( 42, "\\A(?:College Basketball)\\z"),
5471 ( 42, "\\A(?:NCAA Basketball Tournament)\\z"),
5472 ( 43, "\\A(?:Women's College Basketball)\\z"),
5473 ( 43, "\\A(?:NCAA Women's Basketball Tournament)\\z"),
5475 ( 60, "\\A(?:NHL Hockey)\\z"),
5476 ( 60, "\\A(?:NHL Winter Classic)\\z"),
5477 ( 60, "\\A(?:NHL \\w+ Conference Final)\\z"),
5478 ( 60, "\\A(?:Stanley Cup Finals)\\z"),
5479 ( 61, "\\A(?:College Hockey)\\z"),
5480 ( 61, "\\A(?:Frozen Four)\\z"),
5481 ( 62, "\\A(?:Women's College Hockey)\\z"),
5482 ( 66, "\\A(?:College Field Hockey)\\z"),
5484 ( 80, "\\A(?:College Volleyball)\\z"),
5485 ( 81, "\\A(?:Women's College Volleyball)\\z"),
5487 ( 100, "\\A(?:College Lacrosse)\\z"),
5488 ( 101, "\\A(?:Women's College Lacrosse)\\z"),
5490 ( 120, "\\A(?:College Water Polo)\\z"),
5491 ( 121, "\\A(?:Women's College Water Polo)\\z"),
5493 ( 200, "\\A(?:College Soccer)\\z"),
5494 ( 201, "\\A(?:Women's College Soccer)\\z"),
5495 ( 202, "\\A(?:MLS Soccer|Fútbol MLS)\\z"),
5496 ( 203, "\\A(?:(Premier League|EPL) Soccer)\\z"),
5497 ( 203, "\\A(?:English Premier League)\\z"),
5498 ( 203, "\\A(?:Fútbol Premier League)\\z"),
5499 ( 205, "\\A(?:Italian Serie A Soccer)\\z"),
5500 ( 339, "\\A(?:Italian Serie B Soccer)\\z"),
5501 ( 206, "\\A(?:French Ligue 1 Soccer|Fútbol Ligue 1|Fútbol Liga 1)\\z"),
5502 ( 207, "\\A(?:French Ligue 2 Soccer|Fútbol Ligue 2|Fútbol Liga 2)\\z"),
5503 ( 208, "\\A(?:Fútbol LaLiga)\\z"),
5504 ( 208, "\\A(?:Fútbol Español Primera Division)\\z"),
5505 ( 208, "\\A(?:Spanish Primera Division Soccer)\\z"),
5506 ( 209, "\\A(?:(German )?Bundesliga Soccer)\\z"),
5507 ( 209, "\\A(?:Fútbol Bundesliga)\\z"),
5508 ( 209, "\\A(?:Fútbol Copa de Alemania)\\z"),
5509 ( 210, "\\A(?:German 2. Bundesliga Soccer)\\z"),
5510 ( 211, "\\A(?:Fútbol Mexicano Primera División|Fútbol Mexicano Liga Premier|Fútbol Mexicano)\\z"),
5511 ( 211, "\\A(?:Mexico Primera Division Soccer)\\z"),
5512 ( 212, "\\A(?:Copa do Brazil Soccer)\\z"),
5513 ( 214, "\\A(?:CONCACAF League Soccer)\\z"),
5514 ( 215, "\\A(?:CONCACAF Champions League Soccer)\\z"),
5515 ( 216, "\\A(?:CONCACAF Nations League Soccer)\\z"),
5516 ( 217, "\\A(?:CONCACAF Gold Cup Soccer)\\z"),
5517 ( 218, "\\A(?:FIFA World Cup Soccer)\\z"),
5518 ( 219, "\\A(?:FIFA World Cup Qualifying( Soccer)?|FIFA Eliminatorias Copa Mundial)\\z"),
5519 ( 220, "\\A(?:FIFA World Cup Qualifying( Soccer)?|FIFA Eliminatorias Copa Mundial)\\z"),
5520 ( 221, "\\A(?:FIFA World Cup Qualifying( Soccer)?|FIFA Eliminatorias Copa Mundial)\\z"),
5521 ( 222, "\\A(?:FIFA World Cup Qualifying( Soccer)?|FIFA Eliminatorias Copa Mundial)\\z"),
5522 ( 223, "\\A(?:FIFA World Cup Qualifying( Soccer)?|FIFA Eliminatorias Copa Mundial)\\z"),
5523 ( 224, "\\A(?:FIFA World Cup Qualifying( Soccer)?|FIFA Eliminatorias Copa Mundial)\\z"),
5524 ( 225, "\\A(?:Fútbol UEFA Champions League)\\z"),
5525 ( 225, "\\A(?:UEFA Champions League Soccer)\\z"),
5526 ( 226, "\\A(?:Fútbol UEFA Europa League)\\z"),
5527 ( 229, "\\A(?:Fútbol USL Championship)\\z"),
5528 ( 229, "\\A(?:USL Championship Soccer)\\z"),
5529 ( 230, "\\A(?:NWSL Soccer)\\z"),
5530 ( 231, "\\A(?:FA Women's Super League)\\z"),
5531 ( 242, "\\A(?:Fútbol Mexicano Liga Expansión)\\z"),
5532 ( 258, "\\A(?:UEFA Nations League Soccer)\\z"),
5533 ( 258, "\\A(?:Fútbol UEFA Nations League)\\z"),
5534 ( 271, "\\A(?:Fútbol Español Segunda Division)\\z"),
5535 ( 277, "\\A(?:Fútbol Turco Superliga)\\z"),
5536 ( 277, "\\A(?:Turkish Super Lig Soccer)\\z"),
5537 ( 279, "\\A(?:Superleague Greek Soccer)\\z"),
5538 ( 356, "\\A(?:Fútbol CONMEBOL Libertadores)\\z"),
5539 ( 357, "\\A(?:Fútbol CONMEBOL Sudamericana)\\z"),
5540 ( 359, "\\A(?:Fútbol Argentino Primera División)\\z"),
5541 ( 360, "\\A(?:Fútbol Copa Argentina)\\z"),
5542 ( 365, "\\A(?:Fútbol Argentino Primera Nacional( B)?)\\z"),
5543 ( 366, "\\A(?:Fútbol Argentino Primera B)\\z"),
5544 ( 367, "\\A(?:Fútbol Argentino Primera C)\\z"),
5545 ( 368, "\\A(?:Fútbol Argentino Primera D)\\z"),
5546 ( 386, "\\A(?:Fútbol Columbiano Primera División)\\z"),
5547 ( 403, "\\A(?:Fútbol Hondureño Primera División)\\z"),
5548 ( 404, "\\A(?:Fútbol Costarricense Primera División)\\z"),
5550 (1000, "\\A(?:MLB Baseball)\\z"),
5551 (1000, "\\A(?:Béisbol MLB)\\z");
5554 R"(CREATE TABLE sportscleanup (
5555 id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
5556 provider TINYINT UNSIGNED DEFAULT 0,
5557 weight INT UNSIGNED NOT NULL,
5558 key1 VARCHAR(256) NOT NULL,
5559 name VARCHAR(256) NOT NULL,
5560 pattern VARCHAR(256) NOT NULL,
5561 nth TINYINT UNSIGNED NOT NULL,
5562 replacement VARCHAR(128) NOT NULL
5563 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;)",
5581 R
"A(INSERT INTO sportscleanup (provider,weight,key1,name,pattern,nth,replacement)
5583 (1,1000,"soccer", "(SE)", "\\(\\w+\\)", 0, ""),
5584 (1,1000,"soccer", "AFC", "\\AA\\.?F\\.?C\\.?|\\bA\\.?F\\.?C\\.?\\Z", 0, ""),
5585 (1,1000,"soccer", "AC etc.", "\\AA\\.?[AC]\\.?|\\bA\\.?[AC]\\.?\\Z", 0, ""),
5586 (1,1000,"soccer", "BK", "\\AB\\.?K\\.?|\\bB\\.?K\\.?\\Z", 0, ""),
5587 (1,1000,"soccer", "BSC", "\\AB\\.?S\\.?C\\.?|\\bB\\.?S\\.?C\\.?\\Z", 0, ""),
5588 (1,1000,"soccer", "CSyD", "\\AC\\.?S\\.?( y )?D\\.?|\\bC\\.?S\\.?( y )?D\\.?\\Z", 0, ""),
5589 (1,1000,"soccer", "CD etc.", "\\AC\\.?[ADFRS]\\.?|\\bC\\.?[ADFRS]\\.?\\Z", 0, ""),
5590 (1,1000,"soccer", "FC", "\\AF\\.?C\\.?|\\bF\\.?C\\.?\\Z", 0, ""),
5591 (1,1000,"soccer", "HSC", "\\AH\\.?S\\.?C\\.?|\\bH\\.?S\\.?C\\.?\\Z", 0, ""),
5592 (1,1000,"soccer", "RC etc.", "\\AR\\.?[BC]\\.?|\\bR\\.?[BC]\\.?\\Z", 0, ""),
5593 (1,1000,"soccer", "SC etc.", "\\AS\\.?[ACV]\\.?|\\bS\\.?[ACV]\\.?\\Z", 0, ""),
5594 (1,1000,"soccer", "TSG", "\\AT\\.?S\\.?G\\.?|\\bT\\.?S\\.?G\\.?\\Z", 0, ""),
5595 (1,1000,"soccer", "VFB etc.", "\\AV\\.?F\\.?[BL]\\.?|\\bV\\.?F\\.?[BL]\\.?\\Z", 0, ""),
5596 (1,2000,"all", "", "Inglaterra", 0, "England"),
5597 (1,2000,"all", "", "Munchen", 0, "Munich");
5605 R
"A(INSERT INTO sportscleanup (provider,weight,key1,name,pattern,nth,replacement)
5607 (1,1100,"basketball", "Cal State", "Cal State", 0, "CSU"),
5608 (1,1000,"basketball", "Grambling", "Grambling State", 0, "Grambling"),
5609 (1,1000,"basketball", "Hawaii", "Hawaii", 0, "Hawai'i"),
5610 (1,1000,"basketball", "LIU", "LIU", 0, "Long Island University"),
5611 (1,1100,"basketball", "Loyola", "Loyola-", 0, "Loyola "),
5612 (1,1000,"basketball", "Loyola (Md.)", "Loyola \(Md.\)", 0, "Loyola (MD)"),
5613 (1,1000,"basketball", "McNeese", "McNeese State", 0, "McNeese"),
5614 (1,1000,"basketball", "Miami (OH)", "Miami \(Ohio\)", 0, "Miami (OH)"),
5615 (1,1000,"basketball", "UAB", "Alabama-Birmingham", 0, "UAB"),
5616 (1,1000,"basketball", "UConn", "Connecticut", 0, "UConn"),
5617 (1,1000,"basketball", "UMass", "Massachusetts", 0, "UMass"),
5618 (1,1100,"basketball", "UNC", "UNC-", 0, "UNC "),
5619 (1,1000,"basketball", "UTEP", "Texas-El Paso", 0, "UTEP"),
5620 (1,1100,"basketball", "Texas", "Texas-", 0, "UT "),
5621 (1,1000,"basketball", "Chattanooga", "UT-Chattanooga", 0, "Chattanooga"),
5622 (1,1100,"basketball", "UT", "UT-", 0, "UT ");