Changeset 80


Ignore:
Timestamp:
Dec 31, 2016, 8:56:00 PM (7 years ago)
Author:
chronos
Message:
  • Added: Upgrade code to rename columns to have first capital name in all data tables.
Location:
trunk/Application
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Core.php

    r78 r80  
    4747      $this->Database->ShowSQLQuery = $Config['Web']['ShowSQLQuery'];
    4848    } catch (Exception $E) {
    49 
    5049    }
    5150
  • trunk/Application/UpdateTrace.php

    r69 r80  
    5858}
    5959
     60function UpdateTo79($Manager)
     61{
     62  $DbResult = $Manager->Execute('SELECT `DataTable`,`DataType` FROM `Measure`;');
     63  while($Measure = $DbResult->fetch_assoc())
     64  {
     65    $Table = $Measure['DataTable'];
     66    $Type = $Measure['DataType'];
     67    $Manager->Execute('ALTER TABLE `'.$Table.'` CHANGE `time` `Time` DATETIME NULL DEFAULT NULL;');
     68    $Manager->Execute('ALTER TABLE `'.$Table.'` CHANGE `measure` `Measure` SMALLINT(11) NOT NULL DEFAULT "0";');
     69    $Manager->Execute('ALTER TABLE `'.$Table.'` CHANGE `min` `Min` '.$Type.' NOT NULL DEFAULT "0"');
     70    $Manager->Execute('ALTER TABLE `'.$Table.'` CHANGE `avg` `Avg` '.$Type.' NOT NULL DEFAULT "0"');
     71    $Manager->Execute('ALTER TABLE `'.$Table.'` CHANGE `max` `Max` '.$Type.' NOT NULL DEFAULT "0"');
     72    $Manager->Execute('ALTER TABLE `'.$Table.'` CHANGE `continuity` `Continuity` TINYINT(1) NOT NULL DEFAULT "0"');
     73    $Manager->Execute('ALTER TABLE `'.$Table.'` CHANGE `level` `Level` TINYINT(4) NOT NULL DEFAULT "0"');
     74  }
     75}
     76
    6077class Updates
    6178{
     
    6481    return(array(
    6582      65 => array('Revision' => 67, 'Function' => 'UpdateTo67'),
     83      67 => array('Revision' => 79, 'Function' => 'UpdateTo79'),
    6684    ));
    6785  }
  • trunk/Application/Version.php

    r78 r80  
    66// and system will need database update.
    77
    8 $Revision = 77;
    9 $DatabaseRevision = 67;
     8$Revision = 79;
     9$DatabaseRevision = 79;
    1010$ReleaseTime = strtotime('2016-12-31');
Note: See TracChangeset for help on using the changeset viewer.