You are here

function publication_date_update_7002 in Publication Date 7.2

Change default published_at value to NULL.

File

./publication_date.install, line 91
Installation functions for the Publication Date module.

Code

function publication_date_update_7002() {
  db_drop_index('publication_date', 'published_at');
  db_change_field('publication_date', 'published_at', 'published_at', array(
    'description' => 'The timestamp of the node\'s first publication.',
    'type' => 'int',
    'not null' => FALSE,
    'default' => NULL,
  ), array(
    'indexes' => array(
      'published_at' => array(
        'published_at',
      ),
    ),
  ));
  db_update('publication_date')
    ->fields(array(
    'published_at' => NULL,
  ))
    ->condition('published_at', 2147483647)
    ->execute();
}