aboutsummaryrefslogtreecommitdiffstats
path: root/upgrade.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--upgrade.php25
1 files changed, 20 insertions, 5 deletions
diff --git a/upgrade.php b/upgrade.php
index b0edd7609..8a7471b94 100644
--- a/upgrade.php
+++ b/upgrade.php
@@ -322,13 +322,28 @@ else if (!in_array('rating_score', $columns_of[PREFIX_TABLE.'images']))
{
$current_release = '2.2.0';
}
-else if (!in_array('coi', $columns_of[PREFIX_TABLE.'images']))
-{
- $current_release = '2.3.0';
-}
else
{
- die('No upgrade required, the database structure is up to date');
+ // retrieve already applied upgrades
+ $query = '
+SELECT id
+ FROM '.PREFIX_TABLE.'upgrade
+;';
+ $applied_upgrades = array_from_query($query, 'id');
+
+ if (!in_array(127, $applied_upgrades))
+ {
+ $current_release = '2.3.0';
+ }
+ else
+ {
+ // confirm that the database is in the same version as source code files
+ conf_update_param('piwigo_db_version', get_branch_from_version(PHPWG_VERSION));
+
+ echo 'No upgrade required, the database structure is up to date';
+ echo '<br><a href="index.php">← back to gallery</a>';
+ exit();
+ }
}
// +-----------------------------------------------------------------------+