[mythtv] PATCH: DATETIME field type

Chris Palmer mythtv at zencow.com
Sun Mar 30 13:14:21 EST 2003


Hi...

Since I was prompted to do so, here's a diff of 
changes I made to both the MC/database/mc.sql and 
MC/database/cvs.sql files to modify all fields of 
type TIMESTAMP to type DATETIME.

It's my first submission, so if I've gotten the 
format wrong, please let me know.  I generated it
by doing a "cvs diff -u" in the MC/database dir.

-Chris

-------------- next part --------------
Index: cvs.sql
===================================================================
RCS file: /var/lib/cvs/MC/database/cvs.sql,v
retrieving revision 1.19
diff -u -r1.19 cvs.sql
--- cvs.sql	12 Mar 2003 04:59:46 -0000	1.19
+++ cvs.sql	30 Mar 2003 21:06:29 -0000
@@ -1,5 +1,26 @@
 USE mythconverg;
 
+ALTER TABLE program MODIFY starttime DATETIME NOT NULL;
+ALTER TABLE program MODIFY endtime DATETIME NOT NULL;
+
+ALTER TABLE recorded MODIFY starttime DATETIME NOT NULL;
+ALTER TABLE recorded MODIFY endtime DATETIME NOT NULL;
+
+ALTER TABLE conflictresolutionoverride MODIFY starttime DATETIME NOT NULL;
+ALTER TABLE conflictresolutionoverride MODIFY endtime DATETIME NOT NULL;
+
+ALTER TABLE conflictresolutionsingle MODIFY preferstarttime DATETIME NOT NULL;
+ALTER TABLE conflictresolutionsingle MODIFY preferendtime DATETIME NOT NULL;
+ALTER TABLE conflictresolutionsingle MODIFY dislikestarttime DATETIME NOT NULL;
+ALTER TABLE conflictresolutionsingle MODIFY dislikeendtime DATETIME NOT NULL;
+
+ALTER TABLE oldrecorded MODIFY starttime DATETIME NOT NULL;
+ALTER TABLE oldrecorded MODIFY endtime DATETIME NOT NULL;
+
+ALTER TABLE recordedmarkup MODIFY starttime DATETIME NOT NULL;
+
+ALTER TABLE programrating MODIFY starttime DATETIME NOT NULL;
+
 ALTER TABLE record MODIFY starttime TIME NOT NULL;
 ALTER TABLE record MODIFY startdate DATE NOT NULL;
 ALTER TABLE record MODIFY endtime TIME NOT NULL;
@@ -15,7 +36,7 @@
 CREATE TABLE IF NOT EXISTS programrating
 (
     chanid INT UNSIGNED NOT NULL,
-    starttime TIMESTAMP NOT NULL,
+    starttime DATETIME NOT NULL,
     system CHAR(8) NOT NULL default '',
     rating CHAR(8) NOT NULL default '',
     UNIQUE KEY chanid (chanid,starttime,system,rating),
@@ -28,7 +49,7 @@
 CREATE TABLE IF NOT EXISTS recordedmarkup
 (
     chanid INT UNSIGNED NOT NULL,
-    starttime TIMESTAMP NOT NULL,
+    starttime DATETIME NOT NULL,
     mark BIGINT(20) NOT NULL,
     type INT NOT NULL,
     primary key (chanid,starttime, mark, type )
Index: mc.sql
===================================================================
RCS file: /var/lib/cvs/MC/database/mc.sql,v
retrieving revision 1.28
diff -u -r1.28 mc.sql
--- mc.sql	12 Mar 2003 04:54:59 -0000	1.28
+++ mc.sql	30 Mar 2003 21:06:29 -0000
@@ -36,8 +36,8 @@
 CREATE TABLE IF NOT EXISTS program
 (
     chanid INT UNSIGNED NOT NULL,
-    starttime TIMESTAMP NOT NULL,
-    endtime TIMESTAMP NOT NULL,
+    starttime DATETIME NOT NULL,
+    endtime DATETIME NOT NULL,
     title VARCHAR(128) NULL,
     subtitle VARCHAR(128) NULL,
     description TEXT NULL,
@@ -64,8 +64,8 @@
 CREATE TABLE IF NOT EXISTS recorded
 (
     chanid INT UNSIGNED NOT NULL,
-    starttime TIMESTAMP NOT NULL,
-    endtime TIMESTAMP NOT NULL,
+    starttime DATETIME NOT NULL,
+    endtime DATETIME NOT NULL,
     title VARCHAR(128) NULL,
     subtitle VARCHAR(128) NULL,
     description TEXT NULL,
@@ -86,19 +86,19 @@
 CREATE TABLE IF NOT EXISTS conflictresolutionoverride
 (
     chanid INT UNSIGNED NOT NULL,
-    starttime TIMESTAMP NOT NULL,
-    endtime TIMESTAMP NOT NULL,
+    starttime DATETIME NOT NULL,
+    endtime DATETIME NOT NULL,
     INDEX (chanid, starttime),
     INDEX (endtime)
 );
 CREATE TABLE IF NOT EXISTS conflictresolutionsingle
 (
     preferchanid INT UNSIGNED NOT NULL,
-    preferstarttime TIMESTAMP NOT NULL,
-    preferendtime TIMESTAMP NOT NULL,
+    preferstarttime DATETIME NOT NULL,
+    preferendtime DATETIME NOT NULL,
     dislikechanid INT UNSIGNED NOT NULL,
-    dislikestarttime TIMESTAMP NOT NULL,
-    dislikeendtime TIMESTAMP NOT NULL,
+    dislikestarttime DATETIME NOT NULL,
+    dislikeendtime DATETIME NOT NULL,
     INDEX (preferchanid, preferstarttime),
     INDEX (preferendtime)
 );
@@ -112,8 +112,8 @@
 CREATE TABLE IF NOT EXISTS oldrecorded
 (
     chanid INT UNSIGNED NOT NULL,
-    starttime TIMESTAMP NOT NULL,
-    endtime TIMESTAMP NOT NULL,
+    starttime DATETIME NOT NULL,
+    endtime DATETIME NOT NULL,
     title VARCHAR(128) NULL,
     subtitle VARCHAR(128) NULL,
     description TEXT NULL,
@@ -160,7 +160,7 @@
 CREATE TABLE IF NOT EXISTS recordedmarkup
 (
     chanid INT UNSIGNED NOT NULL,
-    starttime TIMESTAMP NOT NULL,
+    starttime DATETIME NOT NULL,
     mark BIGINT(20) NOT NULL,
     type INT NOT NULL,
     primary key (chanid,starttime, mark, type )
@@ -168,7 +168,7 @@
 CREATE TABLE IF NOT EXISTS programrating
 (
     chanid INT UNSIGNED NOT NULL,
-    starttime TIMESTAMP NOT NULL,
+    starttime DATETIME NOT NULL,
     system CHAR(8) NOT NULL default '',
     rating CHAR(8) NOT NULL default '',
     UNIQUE KEY chanid (chanid,starttime,system,rating),


More information about the mythtv-dev mailing list