[mythtv] [patch] fix db upgrade error

Tommy Faasen mythtv at zwanebloem.nl
Wed Apr 21 08:27:17 EDT 2004


When upgrading to schema 1038 it does amongst other things this

ALTER TABLE people ADD UNIQUE name (name(41));

I had duplicates so the upgrade failed.

Easily solved by adding IGNORE

so here is the patch to do just that..

-------------- next part --------------
Index: mythtv/libs/libmythtv/dbcheck.cpp
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/dbcheck.cpp,v
retrieving revision 1.43
diff -u -r1.43 dbcheck.cpp
--- mythtv/libs/libmythtv/dbcheck.cpp	19 Apr 2004 19:19:04 -0000	1.43
+++ mythtv/libs/libmythtv/dbcheck.cpp	21 Apr 2004 12:22:05 -0000
@@ -731,7 +731,7 @@
 "ALTER TABLE credits DROP INDEX chanid;",
 "ALTER TABLE credits ADD UNIQUE chanid (chanid, starttime, person, role);",
 "ALTER TABLE people DROP INDEX name;",
-"ALTER TABLE people ADD UNIQUE name (name(41));",
+"ALTER IGNORE TABLE people ADD UNIQUE name (name(41));",
 "CREATE TABLE programgenres ( "
 "    chanid int unsigned NOT NULL, "
 "    starttime timestamp NOT NULL, "

More information about the mythtv-dev mailing list