Ignore:
Timestamp:
Sep 3, 2015, 9:25:53 AM (9 years ago)
Author:
chronos
Message:
  • Fixed: Upgrade method.
  • Modified: AppModule Upgrade method improvement.
File:
1 edited

Legend:

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

    r742 r743  
    14321432  $Manager->Execute('ALTER TABLE `FinanceInvoiceGroup` ADD `Direction` INT NOT NULL ;');
    14331433  $Manager->Execute('UPDATE `FinanceInvoiceGroup` SET `Direction` = 1 WHERE ValueSign=1');
    1434   $Manager->Execute('ALTER TABLE `FinanceInvoice` ADD `Direction` INT NOT NULL AFTER `TimePayment`;'); 
     1434  $Manager->Execute('ALTER TABLE `FinanceInvoice` ADD `Direction` INT NOT NULL AFTER `TimePayment`;');
    14351435  $Manager->Execute('UPDATE `FinanceInvoice` SET `Direction` = 1 WHERE ValueSign=1');
    14361436}
     
    14481448  $Manager->Execute('ALTER TABLE `DocumentLineCode`
    14491449ADD CONSTRAINT `DocumentLineCode_ibfk_1` FOREIGN KEY (`DocumentLine`) REFERENCES `DocumentLine` (`Id`);');
    1450  
     1450
    14511451  // Transform finance operations
    14521452  $Manager->Execute('ALTER TABLE `FinanceOperation` CHANGE `BillCode` `BillCodeText` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL');
     
    14541454  $Manager->Execute('ALTER TABLE `FinanceOperation` ADD FOREIGN KEY (`BillCode`) REFERENCES `DocumentLineCode`(`Id`) ON DELETE RESTRICT ON UPDATE RESTRICT;');
    14551455  $DbResult = $Manager->Execute('SELECT `FinanceOperation`.`Id`, `FinanceOperation`.`BillCodeText`, `FinanceOperationGroup`.`DocumentLine` '.
    1456     'FROM `FinanceInvoice` '.
     1456    'FROM `FinanceOperation` '.
    14571457    'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id` = `FinanceOperation`.`Group` '.
    14581458    'WHERE `FinanceOperation`.`BillCodeText`!=""');
     
    14661466  }
    14671467  $Manager->Execute('ALTER TABLE `FinanceOperation` DROP `BillCodeText`;');
    1468  
     1468
    14691469  // Transform invoices
    14701470  $Manager->Execute('ALTER TABLE `FinanceInvoice` CHANGE `BillCode` `BillCodeText` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL');
     
    14841484  }
    14851485  $Manager->Execute('ALTER TABLE `FinanceInvoice` DROP `BillCodeText`;');
    1486  
     1486
    14871487        //$Manager->Execute('RENAME TABLE `FinanceOperationGroup` TO `FinanceOperationTemplate`');
    14881488        //$Manager->Execute('RENAME TABLE `FinanceInvoiceGroup` TO `FinanceInvoiceTemplate`');
Note: See TracChangeset for help on using the changeset viewer.