Revize 287
Přidáno uživatelem Tomáš Dulík před asi 15 roky(ů)
freenetis/trunk/kohana/application/upgrade_sql/upgrade_sql_281.php | ||
---|---|---|
<?php
|
||
|
||
$upgrade_sql[281] = array(
|
||
"ALTER TABLE `account_attributes` DROP `id`",
|
||
|
||
"ALTER TABLE `account_attributes` CHANGE `number` `id` INT( 11 ) NOT NULL DEFAULT '0'",
|
||
|
||
"ALTER TABLE `account_attributes` ADD PRIMARY KEY ( `id` )",
|
||
|
||
"UPDATE `freenetis`.`account_attributes`
|
||
SET `name` = 'První bankovní účet' WHERE `account_attributes`.`id` =221001 LIMIT 1 ;",
|
||
|
||
"INSERT INTO `freenetis`.`account_attributes` (
|
||
`id` ,
|
||
`name` ,
|
||
`type` ,
|
||
`kind` ,
|
||
`activity` ,
|
||
`track_balance` ,
|
||
`line` ,
|
||
`line_short` ,
|
||
`line_credits` ,
|
||
`line_credits_short` ,
|
||
`comment`
|
||
)
|
||
VALUES (
|
||
'221100', 'Účet kreditu', '42', '45', '0', '0', '74', '9', '0', '0', NULL
|
||
);",
|
||
|
||
"INSERT INTO `freenetis`.`account_attributes` (
|
||
`id` ,
|
||
`name` ,
|
||
`type` ,
|
||
`kind` ,
|
||
`activity` ,
|
||
`track_balance` ,
|
||
`line` ,
|
||
`line_short` ,
|
||
`line_credits` ,
|
||
`line_credits_short` ,
|
||
`comment`
|
||
)
|
||
VALUES (
|
||
'221101', 'Provozní účet', '42', '45', '0', '0', '74', '9', '0', '0', NULL
|
||
);",
|
||
|
||
"INSERT INTO `freenetis`.`account_attributes` (
|
||
`id` ,
|
||
`name` ,
|
||
`type` ,
|
||
`kind` ,
|
||
`activity` ,
|
||
`track_balance` ,
|
||
`line` ,
|
||
`line_short` ,
|
||
`line_credits` ,
|
||
`line_credits_short` ,
|
||
`comment`
|
||
)
|
||
VALUES (
|
||
'221102', 'Účet infrastruktury', '42', '45', '0', '0', '74', '9', '0', '0', NULL
|
||
);",
|
||
|
||
"INSERT INTO `freenetis`.`account_attributes` (
|
||
`id` ,
|
||
`name` ,
|
||
`type` ,
|
||
`kind` ,
|
||
`activity` ,
|
||
`track_balance` ,
|
||
`line` ,
|
||
`line_short` ,
|
||
`line_credits` ,
|
||
`line_credits_short` ,
|
||
`comment`
|
||
)
|
||
VALUES (
|
||
'221103', 'Projektový účet', '42', '45', '0', '0', '74', '9', '0', '0', NULL
|
||
);"
|
||
|
||
);
|
||
|
||
?>
|
freenetis/trunk/kohana/application/upgrade_sql/upgrade_sql.php | ||
---|---|---|
}
|
||
|
||
|
||
$upgrade_sql[get_SVN_rev()] = array(
|
||
"ALTER TABLE `account_attributes` DROP `id`",
|
||
|
||
"ALTER TABLE `account_attributes` CHANGE `number` `id` INT( 11 ) NOT NULL DEFAULT '0'",
|
||
|
||
"ALTER TABLE `account_attributes` ADD PRIMARY KEY ( `id` )",
|
||
|
||
"UPDATE `freenetis`.`account_attributes`
|
||
SET `name` = 'První bankovní účet' WHERE `account_attributes`.`id` =221001 LIMIT 1 ;",
|
||
|
||
"INSERT INTO `freenetis`.`account_attributes` (
|
||
`id` ,
|
||
`name` ,
|
||
`type` ,
|
||
`kind` ,
|
||
`activity` ,
|
||
`track_balance` ,
|
||
`line` ,
|
||
`line_short` ,
|
||
`line_credits` ,
|
||
`line_credits_short` ,
|
||
`comment`
|
||
)
|
||
VALUES (
|
||
'221100', 'Účet kreditu', '42', '45', '0', '0', '74', '9', '0', '0', NULL
|
||
);",
|
||
|
||
"INSERT INTO `freenetis`.`account_attributes` (
|
||
`id` ,
|
||
`name` ,
|
||
`type` ,
|
||
`kind` ,
|
||
`activity` ,
|
||
`track_balance` ,
|
||
`line` ,
|
||
`line_short` ,
|
||
`line_credits` ,
|
||
`line_credits_short` ,
|
||
`comment`
|
||
)
|
||
VALUES (
|
||
'221101', 'Provozní účet', '42', '45', '0', '0', '74', '9', '0', '0', NULL
|
||
);",
|
||
|
||
"INSERT INTO `freenetis`.`account_attributes` (
|
||
`id` ,
|
||
`name` ,
|
||
`type` ,
|
||
`kind` ,
|
||
`activity` ,
|
||
`track_balance` ,
|
||
`line` ,
|
||
`line_short` ,
|
||
`line_credits` ,
|
||
`line_credits_short` ,
|
||
`comment`
|
||
)
|
||
VALUES (
|
||
'221102', 'Účet infrastruktury', '42', '45', '0', '0', '74', '9', '0', '0', NULL
|
||
);",
|
||
|
||
"INSERT INTO `freenetis`.`account_attributes` (
|
||
`id` ,
|
||
`name` ,
|
||
`type` ,
|
||
`kind` ,
|
||
`activity` ,
|
||
`track_balance` ,
|
||
`line` ,
|
||
`line_short` ,
|
||
`line_credits` ,
|
||
`line_credits_short` ,
|
||
`comment`
|
||
)
|
||
VALUES (
|
||
'221103', 'Projektový účet', '42', '45', '0', '0', '74', '9', '0', '0', NULL
|
||
);"
|
||
|
||
$upgrade_sql[get_SVN_rev()] = array("
|
||
CREATE TABLE `freenetis`.`accounts_bank_accounts` (
|
||
`account_id` INT NOT NULL ,
|
||
`bank_account_id` INT NOT NULL ,
|
||
PRIMARY KEY ( `account_id` , `bank_account_id` )
|
||
) ENGINE = InnoDB;
|
||
"
|
||
);
|
||
|
||
?>
|
Také k dispozici: Unified diff
Vytvorena nova spojovaci tabulka accounts_bank_accounts.
Duvod:
Doposud mohl mit account (podvojny ucet) prirazen 0 nebo 1 bankovnich uctu.
Dnes jsem zjistil, ze potrebujeme, aby take bankovni ucet mohl mit prirazeno vice podvojnych uctu,
protoze bankovni ucet, ze ktereho clen plati prispevky a ktery je prirazen uctu 684000,
muze byt cilem platby za zbozi/sluzbu, ktere nam clen doda, tj. musi mit prirazen i podvojny ucet 321000 (dodavatele) a/nebo 331000 (zamestnanci).