Ignore:
Timestamp:
Jul 5, 2015, 6:24:33 PM (9 years ago)
Author:
chronos
Message:
  • Modified: Added Direction column to finance operations and invoices. This column will serve as real direction where ValueSign could be different for storno operations.
File:
1 edited

Legend:

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

    r740 r741  
    13551355  `Domain` int(11) NOT NULL,
    13561356  `Sequence` int(11) NOT NULL,
     1357  PRIMARY KEY (`Id`)
    13571358) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;');
    13581359
    1359   $Manager->Execute('ALTER TABLE `NetworkDomainServer`
    1360  ADD PRIMARY KEY (`Id`), ADD KEY `Domain` (`Domain`);');
     1360  $Manager->Execute('ALTER TABLE `NetworkDomainServer` ADD KEY `Domain` (`Domain`);');
    13611361
    13621362  $Manager->Execute('ALTER TABLE `NetworkDomainServer`
     
    14211421  $Manager->Execute('ALTER TABLE `FinanceInvoice` CHANGE `Direction` `ValueSign` INT(11) NOT NULL;');
    14221422  $Manager->Execute('ALTER TABLE `FinanceOperation` CHANGE `Direction` `ValueSign` INT(11) NOT NULL;');
     1423}
     1424
     1425function UpdateTo741($Manager)
     1426{
     1427        // Add Direction column
     1428  $Manager->Execute('ALTER TABLE `FinanceOperationGroup` ADD `Direction` INT NOT NULL ;');
     1429  $Manager->Execute('UPDATE `FinanceOperationGroup` SET `Direction` = 1 WHERE ValueSign=-1');
     1430  $Manager->Execute('ALTER TABLE `FinanceOperation` ADD `Direction` INT NOT NULL AFTER `Cash`;');
     1431  $Manager->Execute('UPDATE `FinanceOperation` SET `Direction` = 1 WHERE ValueSign=-1');
     1432  $Manager->Execute('ALTER TABLE `FinanceInvoiceGroup` ADD `Direction` INT NOT NULL ;');
     1433  $Manager->Execute('UPDATE `FinanceInvoiceGroup` SET `Direction` = 1 WHERE ValueSign=1');
     1434  $Manager->Execute('ALTER TABLE `FinanceInvoice` ADD `Direction` INT NOT NULL AFTER `TimePayment`;'); 
     1435  $Manager->Execute('UPDATE `FinanceInvoice` SET `Direction` = 1 WHERE ValueSign=1');
    14231436}
    14241437
     
    14901503      735 => array('Revision' => 736, 'Function' => 'UpdateTo736'),
    14911504      736 => array('Revision' => 739, 'Function' => 'UpdateTo739'),
     1505        739 => array('Revision' => 740, 'Function' => 'UpdateTo740'),
     1506        740 => array('Revision' => 741, 'Function' => 'UpdateTo741'),
    14921507    ));
    14931508  }
Note: See TracChangeset for help on using the changeset viewer.