Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1529

Přidáno uživatelem Ondřej Fibich před více než 12 roky(ů)

Opravy:
- oprava chyb v posloupnosti upgradu sql

Zobrazit rozdíly:

freenetis/branches/testing/application/vendors/unit_tester/unit_testing_config.xml
<input></input>
</values>
</method>
<method name="show" autogenerate="on">
<attributes>
<attribute name="email_id" default_value="" />
</attributes>
<values>
<input></input>
<input>
<param value="" />
</input>
</values>
</method>
<method name="push" autogenerate="on">
<attributes>
<attribute name="from" default_value="" />
<attribute name="to" default_value="" />
<attribute name="subject" default_value="" />
<attribute name="body" default_value="" />
</attributes>
<values>
<input>
<param value="" />
<param value="" />
<param value="" />
<param value="" />
</input>
</values>
</method>
</controller>
<controller name="email_queues">
<method name="index" autogenerate="on">
......
<attribute name="input" default_value="" />
</attributes>
<values>
<input></input>
<input>
<param value="" />
</input>
......
</input>
</values>
</method>
<method name="active_traffic_members_ip_addresses" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="authorized_keys" autogenerate="on">
<attributes>
<attribute name="device_id" default_value="" />
......
</values>
</method>
</helper>
<helper name="module_state">
<method name="get_state" autogenerate="on">
<attributes>
<attribute name="module" default_value="" />
<attribute name="add_text" default_value="false" />
</attributes>
<values>
<input></input>
<input>
<param value="" />
</input>
<input>
<param value="" />
<param value="false" />
</input>
</values>
</method>
</helper>
<helper name="money"></helper>
<helper name="network">
<method name="netmask2cidr" autogenerate="off">
freenetis/branches/testing/application/controllers/email.php
}
/**
* Adds message to the beginning of queue (will be send first)
*
* @author Michal Kliment
* @param type $from
* @param type $to
* @param type $subject
* @param type $body
* @return type
*/
public function push($from, $to, $subject, $body)
{
return $this->db->query("
INSERT INTO email_queues
SELECT
NULL, ?, ?, ?, ?, ?,
FROM_UNIXTIME(UNIX_TIMESTAMP(MIN(access_time))-1)
FROM email_queues
", array($from, $to, $subject, $body, self::STATE_NEW));
}
/**
* Callback for state of SMS message
*
* @param object $item
freenetis/branches/testing/application/upgrade_sql/upgrade_sql.php
*/
$upgrade_sql[get_SVN_rev()] = array
(
// previous commit 1397 in network branch ==>
"ALTER TABLE `ports` ADD `mode` INT( 11 ) NOT NULL ,
ADD `port_vlan_id` INT( 11 ) NOT NULL ,
ADD INDEX ( `port_vlan_id` )",
"ALTER TABLE `vlans` ADD UNIQUE (
`tag_802_1q`
)",
"INSERT INTO vlans(id, name, tag_802_1q, comment)
VALUES (NULL, 'Default VLAN', 1, 'Default VLAN')
ON DUPLICATE KEY
UPDATE name='Default VLAN', comment='Default VLAN';",
"ALTER TABLE `ports_vlans` ADD `tagged` BOOLEAN NOT NULL ",
"ALTER TABLE `segments` CHANGE `bitrate` `bitrate` BIGINT NULL DEFAULT NULL",
"UPDATE ports p,
(
SELECT port_id, vlan_id, IF(COUNT(*)=1, 1, 2) AS mode
FROM ports_vlans pv
GROUP BY pv.port_id
) pv
SET p.mode = pv.mode, p.port_vlan_id = pv.vlan_id
WHERE pv.port_id = p.id",
// previous commit 1397 in network branch ==>
"ALTER TABLE `ifaces` CHANGE `device_id` `device_id` INT( 11 ) NOT NULL",
"ALTER TABLE `ifaces` ADD `number` INT( 11 ) NULL DEFAULT NULL AFTER `name`",
......
ADD FOREIGN KEY `ip_addresses_key_subnet_id` ( `subnet_id` ) REFERENCES `subnets` (`id`
) ON DELETE CASCADE ON UPDATE RESTRICT",
// last commin in upgrade in network branch ==>
"CREATE TABLE IF NOT EXISTS `device_templates` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`enum_type_id` int(11) NOT NULL,
freenetis/branches/testing/application/upgrade_sql/upgrade_sql_1397.php
<?php defined('SYSPATH') or die('No direct script access.');
/*
* This file is part of open source system FreeNetIS
* and it is released under GPLv3 licence.
*
* More info about licence can be found:
* http://www.gnu.org/licenses/gpl-3.0.html
*
* More info about project can be found:
* http://www.freenetis.org/
*
*/
$upgrade_sql[1397] = array
(
"ALTER TABLE `ports` ADD `mode` INT( 11 ) NOT NULL ,
ADD `port_vlan_id` INT( 11 ) NOT NULL ,
ADD INDEX ( `port_vlan_id` )",
"ALTER TABLE `vlans` ADD UNIQUE (
`tag_802_1q`
)",
"INSERT INTO vlans(id, name, tag_802_1q, comment)
VALUES (NULL, 'Default VLAN', 1, 'Default VLAN')
ON DUPLICATE KEY
UPDATE name='Default VLAN', comment='Default VLAN';",
"ALTER TABLE `ports_vlans` ADD `tagged` BOOLEAN NOT NULL ",
"ALTER TABLE `segments` CHANGE `bitrate` `bitrate` BIGINT NULL DEFAULT NULL",
"UPDATE ports p,
(
SELECT port_id, vlan_id, IF(COUNT(*)=1, 1, 2) AS mode
FROM ports_vlans pv
GROUP BY pv.port_id
) pv
SET p.mode = pv.mode, p.port_vlan_id = pv.vlan_id
WHERE pv.port_id = p.id"
);

Také k dispozici: Unified diff