Skip to content

Commit

Permalink
Remove zero date defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
zerocrates committed Dec 9, 2015
1 parent 403174f commit a58651c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions functions.php
Expand Up @@ -33,8 +33,8 @@ function exhibit_builder_install()
`theme` VARCHAR(30) DEFAULT NULL,
`theme_options` TEXT,
`slug` VARCHAR(30) NOT NULL,
`added` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
`added` TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00',
`modified` TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00',
`owner_id` INT UNSIGNED DEFAULT NULL,
`use_summary_page` TINYINT(1) DEFAULT 1,
`cover_image_file_id` INT UNSIGNED DEFAULT NULL,
Expand Down Expand Up @@ -276,7 +276,12 @@ function exhibit_builder_upgrade($args)
}

if (version_compare($oldVersion, '3.3', '<')) {
$sql = "ALTER TABLE `{$db->prefix}exhibits` ADD `cover_image_file_id` INT UNSIGNED DEFAULT NULL AFTER `use_summary_page`";
$sql = <<<SQL
ALTER TABLE `{$db->prefix}exhibits`
ADD `cover_image_file_id` INT UNSIGNED DEFAULT NULL AFTER `use_summary_page`,
ALTER `added` SET DEFAULT '2000-01-01 00:00:00',
ALTER `modified` SET DEFAULT '2000-01-01 00:00:00'
SQL;
$db->query($sql);
}
}
Expand Down

0 comments on commit a58651c

Please sign in to comment.