Ignore:
Timestamp:
Mar 3, 2013, 11:27:30 PM (12 years ago)
Author:
chronos
Message:
  • Přidáno: Tabulky pro evidenci importu plateb z účtu a pro seznam měn.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/Updates.php

    r498 r499  
    7676}
    7777
     78function UpdateTo499($Manager)
     79{
     80  $Manager->Execute("CREATE TABLE IF NOT EXISTS `Currency` (
     81  `Id` int(11) NOT NULL AUTO_INCREMENT,
     82  `Code` varchar(3) NOT NULL,
     83  `Name` varchar(255) NOT NULL,
     84  `Symbol` varchar(255) NOT NULL,
     85  PRIMARY KEY (`Id`)
     86) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
     87
     88INSERT INTO `Currency` (`Id`, `Code`, `Name`, `Symbol`) VALUES
     89(1, 'CZK', 'Česká koruna', 'Kč'),
     90(2, 'EUR', 'Euro', '€'),
     91(3, 'USD', 'Americký dolar', '$'),
     92(4, 'CNY', 'Čínský jüan', '¥');");
     93  $Manager->Execute("CREATE TABLE IF NOT EXISTS `FinanceBankImport` (
     94  `Id` int(11) NOT NULL AUTO_INCREMENT,
     95  `BankAccount` int(11) NOT NULL,
     96  `Time` date NOT NULL,
     97  `Identification` varchar(255) NOT NULL,
     98  `AccountNumber` varchar(255) NOT NULL,
     99  `VariableSymbol` varchar(255) NOT NULL,
     100  `ConstantSymbol` varchar(255) NOT NULL,
     101  `SpecificSymbol` varchar(255) NOT NULL,
     102  `Value` decimal(10,0) NOT NULL,
     103  `Currency` int(11) NOT NULL,
     104  `Description` varchar(255) NOT NULL,
     105  `OffsetAccountName` varchar(255) NOT NULL,
     106  `FinanceOperation` int(11) DEFAULT NULL,
     107  PRIMARY KEY (`Id`),
     108  KEY `FinanceOperation` (`FinanceOperation`),
     109  KEY `Currency` (`Currency`),
     110  KEY `BankAccount` (`BankAccount`)
     111) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
     112
     113ALTER TABLE `FinanceBankImport`
     114  ADD CONSTRAINT `FinanceBankImport_ibfk_3` FOREIGN KEY (`FinanceOperation`) REFERENCES `FinanceOperation` (`Id`),
     115  ADD CONSTRAINT `FinanceBankImport_ibfk_1` FOREIGN KEY (`BankAccount`) REFERENCES `FinanceBankAccount` (`Id`),
     116  ADD CONSTRAINT `FinanceBankImport_ibfk_2` FOREIGN KEY (`Currency`) REFERENCES `Currency` (`Id`);");
     117  $Manager->Execute("INSERT INTO `ISMenuItem` (`Id` ,`Name` ,`Parent` ,`Table` ,`IconName`)".
     118  "VALUES (NULL , 'Měny', '2', 'Currency', '');");
     119  $Manager->Execute("INSERT INTO `ISMenuItem` (`Id` ,`Name` ,`Parent` ,`Table` ,`IconName`) ".
     120    "VALUES (NULL , 'Import z účtu', '2', 'FinanceBankImport', '');");
     121}
     122
    78123$Updates = array(
    79124        491 => array('Revision' => 493, 'Function' => 'UpdateTo493'),
     
    81126  494 => array('Revision' => 495, 'Function' => 'UpdateTo495'),
    82127  495 => array('Revision' => 497, 'Function' => 'UpdateTo497'),
    83   497 => array('Revision' => 497, 'Function' => 'UpdateTo498'),
     128  497 => array('Revision' => 498, 'Function' => 'UpdateTo498'),
     129  498 => array('Revision' => 499, 'Function' => 'UpdateTo499'),
    84130);
    85131
Note: See TracChangeset for help on using the changeset viewer.