Changeset 21668


Ignore:
Timestamp:
Mar 18, 2013, 11:48:19 AM (11 years ago)
Author:
mistic100
Message:

bad order of SQL commands

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/SmartAlbums/include/install.inc.php

    r21658 r21668  
    5858  }
    5959 
     60  // new column on category filters table
     61  $result = pwg_query('SHOW COLUMNS FROM `' . $prefixeTable . 'category_filters` LIKE "updated";');
     62  if (!pwg_db_num_rows($result))
     63  {     
     64    pwg_query('ALTER TABLE `' . $prefixeTable . 'category_filters` ADD `updated` DATETIME NOT NULL DEFAULT "1970-01-01 00:00:00"');
     65  }
     66 
    6067  // remove column on category table, moved to category filters table
    6168  $result = pwg_query('SHOW COLUMNS FROM `' . CATEGORIES_TABLE . '` LIKE "smart_update";');
     
    6471    pwg_query('UPDATE `' . $prefixeTable . 'category_filters` AS f SET updated = ( SELECT smart_update FROM `' . CATEGORIES_TABLE . '` AS c WHERE c.id = f.category_id );');
    6572    pwg_query('ALTER TABLE `' . CATEGORIES_TABLE . '` DROP `smart_update`;');
    66   }
    67  
    68   // new column on category filters table
    69   $result = pwg_query('SHOW COLUMNS FROM `' . $prefixeTable . 'category_filters` LIKE "updated";');
    70   if (!pwg_db_num_rows($result))
    71   {     
    72     pwg_query('ALTER TABLE `' . $prefixeTable . 'category_filters` ADD `updated` DATETIME NOT NULL DEFAULT "1970-01-01 00:00:00"');
    7373  }
    7474 
Note: See TracChangeset for help on using the changeset viewer.