Changeset 2768 for trunk/upgrade.php


Ignore:
Timestamp:
Oct 17, 2008, 10:39:30 PM (16 years ago)
Author:
plg
Message:

merge -c2754 from branch 2.0 to trunk

new: upgrade script from 1.7.0. Instead of previous upgrade scripts, I call
directly the "unit" upgrades from 61 to current. Previous upgrades not in
the database are inserted but not applied (and have an explicit description
saying so).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/upgrade.php

    r2747 r2768  
    197197    }
    198198  }
     199  else if (!in_array('md5sum', $columns_of[PREFIX_TABLE.'images']))
     200  {
     201    $current_release = '1.7.0';
     202  }
    199203  else
    200204  {
     
    218222else
    219223{
    220   if (in_array(PREFIX_TABLE.'history_summary', $tables))
     224  if (in_array('md5sum', $columns_of[PREFIX_TABLE.'images']))
    221225  {
    222226    die('No database upgrade required, do not refresh the page');
     
    230234    $conf['die_on_sql_error'] = false;
    231235    include($upgrade_file);
    232 
    233     // Available upgrades must be ignored after a fresh installation. To
    234     // make PWG avoid upgrading, we must tell it upgrades have already been
    235     // made.
    236     list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
    237     define('CURRENT_DATE', $dbnow);
    238     $datas = array();
    239     foreach (get_available_upgrade_ids() as $upgrade_id)
    240     {
    241       array_push(
    242         $datas,
    243         array(
    244           'id'          => $upgrade_id,
    245           'applied'     => CURRENT_DATE,
    246           'description' => 'upgrade included in migration',
    247           )
    248         );
    249     }
    250     mass_inserts(
    251       UPGRADE_TABLE,
    252       array_keys($datas[0]),
    253       $datas
    254       );
    255236
    256237    // Create empty local files to avoid log errors
     
    299280    $template->assign('infos', $page['infos']);
    300281
    301     $query = '
    302 UPDATE '.USER_CACHE_TABLE.'
    303   SET need_update = \'true\'
    304 ;';
    305 
    306     pwg_query($query);
    307     $query = '
    308 REPLACE INTO '.PLUGINS_TABLE.'
    309   (id, state)
    310   VALUES (\'c13y_upgrade\', \'active\')
    311 ;';
    312     pwg_query($query);
     282    invalidate_user_cache();
    313283  }
    314284  else
Note: See TracChangeset for help on using the changeset viewer.