Permalink
Browse files

DB update for RTP. This adds an iptv_channel table.

In the existing IPTV recorder we need to read in a text file on
startup for the RTSP/RTP/UDP urls, this adds a table for those
so we can keep this data in the database. This requires a new
column in channel so we can link to this table. I've also defined
several URL types since an RTP stream require up to three URLs.

I'm adding this now so I can more easily switch between branches
and so others can test the rtp and ceton branches without needing
to manually edit the database.
  • Loading branch information...
1 parent bc9e741 commit 0fcf9631ab2c65a2c9d32cc70e9e44f6a43cdb59 @daniel-kristjansson daniel-kristjansson committed Apr 13, 2012
@@ -114,7 +114,7 @@ package MythTV;
# schema version supported in the main code. We need to check that the schema
# version in the database is as expected by the bindings, which are expected
# to be kept in sync with the main code.
- our $SCHEMA_VERSION = "1300";
+ our $SCHEMA_VERSION = "1301";
# NUMPROGRAMLINES is defined in mythtv/libs/libmythtv/programinfo.h and is
# the number of items in a ProgramInfo QStringList group used by
@@ -5,7 +5,7 @@
"""
OWN_VERSION = (0,25,-1,3)
-SCHEMA_VERSION = 1300
+SCHEMA_VERSION = 1301
NVSCHEMA_VERSION = 1007
MUSICSCHEMA_VERSION = 1018
PROTO_VERSION = '73'
@@ -57,7 +57,7 @@
* mythtv/bindings/php/MythBackend.php
#endif
-#define MYTH_DATABASE_VERSION "1300"
+#define MYTH_DATABASE_VERSION "1301"
MBASE_PUBLIC const char *GetMythSourceVersion();
@@ -1960,6 +1960,28 @@ NULL
return false;
}
+ if (dbver == "1300")
+ {
+ const char *updates[] = {
+"ALTER TABLE channel ADD COLUMN iptvid SMALLINT(6) UNSIGNED;",
+"CREATE TABLE iptv_channel ("
+" iptvid SMALLINT(6) UNSIGNED NOT NULL auto_increment,"
+" chanid INT(10) UNSIGNED NOT NULL,"
+" url TEXT NOT NULL,"
+" type set('data', "
+" 'rfc2733-1','rfc2733-2', "
+" 'rfc5109-1','rfc5109-2', "
+" 'smpte2022-1','smpte2022-2'),"
+" bitrate INT(10) UNSIGNED NOT NULL,"
+" PRIMARY KEY (iptvid)"
+") ENGINE=MyISAM DEFAULT CHARSET=utf8;",
+NULL
+};
+
+ if (!performActualUpdate(updates, "1301", dbver))
+ return false;
+ }
+
return true;
}

0 comments on commit 0fcf963

Please sign in to comment.