Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 635

Přidáno uživatelem Jiří Sviták před asi 14 roky(ů)

Oprava chyby ve filtrovani a razeni prevodu uzivatele. Pridana databazova struktura pro ukladani bankovnich vypisu. Pridana tabulka pro zpravy presmerovani a vazebni tabulka mezi zpravami a ip adresami. Pridany pohledy pro snadnejsi zjisteni stavu na podvojnych uctech.

Zobrazit rozdíly:

freenetis/trunk/kohana/application/models/transfer.php
$where .= "t.amount LIKE '%".$value."%' COLLATE utf8_general_ci";
}
if ($order_by == 'amount')
$order_by = 'IF( t.destination_id = '.$account_id.', amount, amount*-1 )';
$order_by = 'IF( t.destination_id = '.$account_id.', t.amount, t.amount*-1 )';
return self::$db->query("SELECT
t.id,
t.text,
freenetis/trunk/kohana/application/upgrade_sql/upgrade_sql.php
// array of sql queries that upgrade database
$upgrade_sql[get_SVN_rev()] = array(
"ALTER TABLE `members` ADD `voip_billing_limit` INT NOT NULL DEFAULT '0' AFTER `locked` ,
ADD `voip_billing_type` VARCHAR( 10 ) NOT NULL DEFAULT 'prepaid' AFTER `voip_billing_limit` ;"
"CREATE ALGORITHM = UNDEFINED VIEW `account_outbounds` AS SELECT a. * , IFNULL( SUM( amount ) , 0 ) AS outbound
FROM accounts a
LEFT JOIN transfers t ON a.id = t.origin_id
GROUP BY a.id",
"CREATE ALGORITHM = UNDEFINED VIEW `account_inbounds` AS SELECT a . * , IFNULL( SUM( amount ) , 0 ) AS inbound
FROM account_outbounds a
LEFT JOIN transfers t ON a.id = t.destination_id
GROUP BY a.id",
"CREATE ALGORITHM = UNDEFINED VIEW `account_balances` AS SELECT a . * , (
inbound - outbound
) AS balance
FROM account_inbounds a",
"CREATE TABLE `bank_statements` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`bank_account_id` INT NOT NULL ,
`user_id` INT NOT NULL ,
`extension` VARCHAR( 10 ) NULL DEFAULT NULL ,
`from` DATETIME NULL DEFAULT NULL ,
`to` DATETIME NULL DEFAULT NULL ,
`opening_balance` DOUBLE NULL DEFAULT NULL ,
`closing_balance` DOUBLE NULL DEFAULT NULL
) ENGINE = InnoDB;",
"ALTER TABLE `bank_transfers` ADD `bank_statement_id` INT NULL AFTER `transfer_id`",
"CREATE TABLE `messages` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`text` TEXT NULL DEFAULT NULL ,
`type` TINYINT NULL DEFAULT NULL ,
`priority` INT NULL DEFAULT NULL ,
`system` TINYINT NULL DEFAULT NULL ,
`self_cancel` TINYINT NULL DEFAULT NULL
) ENGINE = InnoDB COMMENT = 'messages used for redirection';",
"CREATE TABLE `messages_ip_addresses` (
`message_id` INT NOT NULL COMMENT 'redirection message',
`ip_address_id` INT NOT NULL COMMENT 'redirected ip address',
`user_id` INT NOT NULL COMMENT 'user id of admin who redirects',
`comment` TEXT NULL DEFAULT NULL COMMENT 'personal comment from admin for redirected user',
PRIMARY KEY ( `message_id` , `ip_address_id` )
) ENGINE = InnoDB COMMENT = 'junction table between redirected ip address and message of redirection';"
);
?>
freenetis/trunk/kohana/application/upgrade_sql/upgrade_sql_625.php
<?php
// array of sql queries that upgrade database
$upgrade_sql[625] = array(
"ALTER TABLE `members` ADD `voip_billing_limit` INT NOT NULL DEFAULT '0' AFTER `locked` ,
ADD `voip_billing_type` VARCHAR( 10 ) NOT NULL DEFAULT 'prepaid' AFTER `voip_billing_limit` ;"
);
?>

Také k dispozici: Unified diff