Ignore:
Timestamp:
Jan 5, 2015, 10:01:40 PM (10 years ago)
Author:
chronos
Message:
  • Modified: Added time designation for scheduled table change actions. This applies to tables Service, ServiceCustomerRel and FinanceCharge. Now time of taking effect is not determined just by customer pay period but by more generally by specified time.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Setup/Updates.php

    r725 r726  
    10331033}
    10341034
    1035 /*
    1036 function UpdateTo719($Manager)
    1037 {       
    1038   $Manager->Execute('ALTER TABLE `FinanceOperation` DROP FOREIGN KEY `FinanceOperation_ibfk_1`;');
    1039   $Manager->Execute('ALTER TABLE `FinanceOperation` CHANGE `Subject` `SubjectFrom` INT(11) NULL DEFAULT "";');
    1040   $Manager->Execute('ALTER TABLE `FinanceOperation` ADD `SubjectTo` INT NULL AFTER `SubjectFrom`, ADD INDEX (`SubjectTo`) ;');
    1041   $Manager->Execute('ALTER TABLE `FinanceOperation` ADD FOREIGN KEY (`SubjectFrom`) REFERENCES `Subject`(`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT;');
    1042   $Manager->Execute('ALTER TABLE `FinanceOperation` ADD FOREIGN KEY (`SubjectTo`) REFERENCES `Subject`(`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT;');
    1043   // Set target subject to 1 = company subject id
    1044   $Manager->Execute('UPDATE `FinanceOperation` SET `SubjectTo` = 1;');
    1045   $Manager->Execute('UPDATE `FinanceOperation` SET `SubjectTo` = `SubjectFrom` WHERE `Value` < 0');
    1046   $Manager->Execute('UPDATE `FinanceOperation` SET `SubjectFrom` = 1,`Value`= -`Value`  WHERE `Value` < 0');
    1047    
    1048 }
    1049 */
    1050 
    10511035function UpdateTo719($Manager)
    10521036{       
     
    11631147        }
    11641148        $DbResult = $Manager->Execute('UPDATE `FinanceInvoiceItem` SET `Description` = "'.$SearchText.'" WHERE `Description` LIKE "'.$SearchText.' za období%";');
     1149}
     1150
     1151function UpdateTo726($Manager)
     1152{
     1153        $Manager->Execute('ALTER TABLE `ServiceCustomerRel` CHANGE `Action` `ChangeAction` ENUM("add","modify","remove") CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;');
     1154        $Manager->Execute('ALTER TABLE `ServiceCustomerRel` ADD `ChangeTime` DATETIME NULL AFTER `ChangeAction`;');
     1155        $Manager->Execute('ALTER TABLE `ServiceCustomerRel` DROP FOREIGN KEY `ServiceCustomerRel_ibfk_4`;');
     1156        $Manager->Execute('ALTER TABLE `ServiceCustomerRel` CHANGE `ReplaceId` `ChangeReplaceId` INT(11) NULL DEFAULT NULL;');
     1157        $Manager->Execute('ALTER TABLE `ServiceCustomerRel` ADD FOREIGN KEY (`ChangeReplaceId`) REFERENCES `ServiceCustomerRel`(`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT;');
     1158
     1159        $Manager->Execute('ALTER TABLE `Service` CHANGE `Action` `ChangeAction` ENUM("add","modify","remove") CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;');
     1160        $Manager->Execute('ALTER TABLE `Service` ADD `ChangeTime` DATETIME NULL AFTER `ChangeAction`;');
     1161        $Manager->Execute('ALTER TABLE `Service` DROP FOREIGN KEY `Service_ibfk_2`;');
     1162        $Manager->Execute('ALTER TABLE `Service` CHANGE `ReplaceId` `ChangeReplaceId` INT(11) NULL DEFAULT NULL;');
     1163        $Manager->Execute('ALTER TABLE `Service` ADD FOREIGN KEY (`ChangeReplaceId`) REFERENCES `Service`(`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT;');
     1164
     1165        $Manager->Execute('ALTER TABLE `FinanceCharge` CHANGE `Action` `ChangeAction` ENUM("add","modify","remove") CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;');
     1166        $Manager->Execute('ALTER TABLE `FinanceCharge` ADD `ChangeTime` DATETIME NULL AFTER `ChangeAction`;');
     1167        $Manager->Execute('ALTER TABLE `FinanceCharge` DROP FOREIGN KEY `FinanceCharge_ibfk_1`;');
     1168        $Manager->Execute('ALTER TABLE `FinanceCharge` CHANGE `ReplaceId` `ChangeReplaceId` INT(11) NULL DEFAULT NULL;');
     1169        $Manager->Execute('ALTER TABLE `FinanceCharge` ADD FOREIGN KEY (`ChangeReplaceId`) REFERENCES `FinanceCharge`(`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT;');
     1170       
     1171        $Manager->Execute('ALTER TABLE `MemberPayment` DROP `NetworkDevice`;');
    11651172}
    11661173
     
    12251232        720 => array('Revision' => 722, 'Function' => 'UpdateTo722'),
    12261233        722 => array('Revision' => 725, 'Function' => 'UpdateTo725'),
     1234        725 => array('Revision' => 726, 'Function' => 'UpdateTo726'),
    12271235    ));
    12281236  }
Note: See TracChangeset for help on using the changeset viewer.