This is an old revision of the document!


Update to r403 from < r401

Update to r403 (V1.4.7) from older versions < r401 (V1.4.6)

Vorgehensweise nach Installation r403 V1.4.7 wenn das Update von einer älteren Version nicht funktioniert: Procedure for installation r403 V1.4.7 if the update is not working from a previous version:

  • Copy script to /template/inc_script/frontend_render/update_403.php.
  • The front end call once
  • Delete this Script from /frontend_render/ !!


Update 18.11.2010

  • Checks if the field “sysvalue_vartype” in the table “phpwcms_sysvalue” exists and creates it if not yet available. (Since r171 available)
    This field has not been used and was made only on new installations to r171.
    In DB updates, the system is not available!


frontend_render Script:

<?php
/* --------------- < 401 */
 
    // check if sysvalue_vartype field exists
    $result = _dbQuery("SHOW COLUMNS FROM ".DB_PREPEND."phpwcms_sysvalue LIKE 'sysvalue_vartype'", 'COUNT_SHOW');
 
    if(empty($result)) {
        $result = _dbQuery("ALTER TABLE ".DB_PREPEND."phpwcms_sysvalue ADD sysvalue_vartype VARCHAR(100) NOT NULL DEFAULT ''", 'ALTER');
 
 
 
/* --------------- 401 */
    $revision = '401';
 
    // check if article description field exists
    $result = _dbQuery("SHOW COLUMNS FROM ".DB_PREPEND."phpwcms_article LIKE 'article_description'", 'COUNT_SHOW');
 
    if(empty($result)) {
        $result = _dbQuery("ALTER TABLE ".DB_PREPEND."phpwcms_article ADD article_description VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
        @write_textfile(PHPWCMS_TEMP.'r'.$revision.'.checked.tmp', date('Y-d-m H:i:s'));
    }
 
 
 
 
 
/* ---------------- 403 */
    $revision = '403';
 
    $result = _dbQuery("SHOW COLUMNS FROM ".DB_PREPEND."phpwcms_articlecontent LIKE 'acontent_tab'", 'COUNT_SHOW');
 
    if(empty($result)) {
        $result = _dbQuery("ALTER TABLE ".DB_PREPEND."phpwcms_articlecontent ADD acontent_tab VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
    }
 
    // check if new structure level class field exists
    $result = _dbQuery("SHOW COLUMNS FROM ".DB_PREPEND."phpwcms_articlecat LIKE 'acat_class'", 'COUNT_SHOW');
 
    if(empty($result)) {
        $result = _dbQuery("ALTER TABLE ".DB_PREPEND."phpwcms_articlecat ADD acat_class VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
    }
 
    // check if new structure level keywords field exists
    $result = _dbQuery("SHOW COLUMNS FROM ".DB_PREPEND."phpwcms_articlecat LIKE 'acat_keywords'", 'COUNT_SHOW');
 
    if(empty($result)) {
        $result = _dbQuery("ALTER TABLE ".DB_PREPEND."phpwcms_articlecat ADD acat_keywords VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
    }
 
    // upgrade sysvalue fields
    $result = _dbQuery("SHOW COLUMNS FROM ".DB_PREPEND."phpwcms_sysvalue LIKE 'sysvalue_vartype'");
    if(isset($result[0]['Type']) && $result[0]['Type'] == 'varchar(100)') {
        $result = _dbQuery("ALTER TABLE ".DB_PREPEND."phpwcms_sysvalue CHANGE sysvalue_vartype sysvalue_vartype VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
    }
    $result = _dbQuery("SHOW COLUMNS FROM ".DB_PREPEND."phpwcms_sysvalue LIKE 'sysvalue_value'");
    if(isset($result[0]['Type']) && $result[0]['Type'] == 'text') {
        $result = _dbQuery("ALTER TABLE ".DB_PREPEND."phpwcms_sysvalue CHANGE sysvalue_value sysvalue_value MEDIUMTEXT NOT NULL", 'ALTER');
    }
 
    @write_textfile(PHPWCMS_TEMP.'r'.$revision.'.checked.tmp', date('Y-d-m H:i:s'));
 
?>


<note important>Not tested!!</note>

Knut Heermann (flip-flop) 2010/11/07 19:47

english/installation/update/r403.1290035812.txt.gz · Last modified: 2018/06/03 18:08 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0