MantisBT - CDash
View Issue Details
0007804CDashpublic2008-10-13 14:332008-10-13 17:16
Todd Harrington 
Julien Jomier 
normalmajoralways
closedfixed 
1.2 
1.2.2 
0007804: Can not create build groups after upgrading from 1.0 to 1.2
Creating a build group after migrating from CDASH 1.0 to 1.2 appears to have not effect. Actually the build groups are created in the DB tables, but they are not displayed either on the index page, or on the manage build groups page.

The problem is that the schema changed to assign the special value "1980-01-01 00:00:00" to buildgroup.starttime, buildgroup.endtime, buildgroupposition.starttime, and buildgroupposition.endtime. However, the upgrade process does not alter the DB tables to reflect this. Then in the code, only build groups that have the special value "1980-01-01 00:00:00" ever get selected.

Although the code relies on the DB to set this special value for endtime it sets it for starttime in the code. To resolve this issue I just had the code also set the endtime to this special value when creating build groups and build group positions.
No tags attached.
Issue History
2008-10-13 14:33Todd HarringtonNew Issue
2008-10-13 16:37Julien JomierStatusnew => assigned
2008-10-13 16:37Julien JomierAssigned To => Julien Jomier
2008-10-13 16:39Julien JomierNote Added: 0013864
2008-10-13 16:53Todd HarringtonNote Added: 0013865
2008-10-13 17:16Julien JomierStatusassigned => closed
2008-10-13 17:16Julien JomierNote Added: 0013866
2008-10-13 17:16Julien JomierResolutionopen => fixed
2008-10-13 17:16Julien JomierFixed in Version => 1.2.2

Notes
(0013864)
Julien Jomier   
2008-10-13 16:39   
These lines are present in the upgrade process:

  pdo_query("UPDATE buildgroup SET starttime='1980-01-01 00:00:00' WHERE starttime='0000-00-00 00:00:00'");
  pdo_query("UPDATE buildgroup SET endtime='1980-01-01 00:00:00' WHERE endtime='0000-00-00 00:00:00'");
  pdo_query("UPDATE build2grouprule SET starttime='1980-01-01 00:00:00' WHERE starttime='0000-00-00 00:00:00'");
  pdo_query("UPDATE build2grouprule SET endtime='1980-01-01 00:00:00' WHERE endtime='0000-00-00 00:00:00'");
  pdo_query("UPDATE buildgroupposition SET starttime='1980-01-01 00:00:00' WHERE starttime='0000-00-00 00:00:00'");
  pdo_query("UPDATE buildgroupposition SET endtime='1980-01-01 00:00:00' WHERE endtime='0000-00-00 00:00:00'");

That should take care of it. Is there something else going on?
(0013865)
Todd Harrington   
2008-10-13 16:53   
Yes. The schema is not updated when upgrading so attempts to create new build groups still produces the old time stamps "0000-00-00 00:00:00".

To update the live schema you would need something like:

  pdo_query("alter table buildgroup modify starttime timestamp NOT NULL default '1980-01-01 00:00:00'");
  pdo_query("alter table buildgroup modify endtime timestamp NOT NULL default '1980-01-01 00:00:00'");

and so on.
(0013866)
Julien Jomier   
2008-10-13 17:16   
I see now. I thought we had fixed that by adding the starttime and endtime explicitly in the SQL queries but apparently not. This is now fixed in the upgrade script. Thanks again for the report.