bug fixed: during installation, upgrades from install/db with complex

identifier (X.x) were not correctly inserted.

bug fixed: available upgrades from install/db need to be inserted in
#upgrade table.

deletion: all upgrades from install/db coming from trunk are removed.

new: complete upgrade from any previous release from 1.3.0 to 1.5.2 with
automatic detection detection of the previous release.


git-svn-id: http://piwigo.org/svn/branches/branch-1_6@1209 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
plegall
2006-04-19 20:54:13 +00:00
parent dab8075c96
commit 8789f41f8c
30 changed files with 925 additions and 2003 deletions
+16 -7
View File
@@ -332,16 +332,25 @@ INSERT INTO '.USER_INFOS_TABLE.'
// Available upgrades must be ignored after a fresh installation. To
// make PWG avoid upgrading, we must tell it upgrades have already been
// made.
list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
define('CURRENT_DATE', $dbnow);
$datas = array();
foreach (get_available_upgrade_ids() as $upgrade_id)
{
$query = '
INSERT INTO '.UPGRADE_TABLE.'
(id, applied, description)
VALUES
('.$upgrade_id.', NOW(), \'upgrade included in installation\')
';
mysql_query($query);
array_push(
$datas,
array(
'id' => $upgrade_id,
'applied' => CURRENT_DATE,
'description' => 'upgrade included in installation',
)
);
}
mass_inserts(
UPGRADE_TABLE,
array_keys($datas[0]),
$datas
);
}
}