You are here

function page_theme_update_6101 in Page Theme 7.2

Same name and namespace in other branches
  1. 6 page_theme.install \page_theme_update_6101()
  2. 7 page_theme.install \page_theme_update_6101()

Add preview field.

File

./page_theme.install, line 130
Install, update and uninstall functions for the page_theme module.

Code

function page_theme_update_6101() {
  db_add_field('page_theme', 'preview', array(
    'type' => 'int',
    'size' => 'tiny',
    'not null' => TRUE,
    'default' => 0,
  ));
  $result = db_query('SELECT theme FROM {page_theme}');
  foreach ($result as $page_theme) {
    db_update('page_theme')
      ->fields(array(
      'preview' => 1,
    ))
      ->condition('theme', $page_theme->theme)
      ->execute();
  }
}