}
if (isset($name) && isset($type)) {
if (empty($options['default'])) {
+ if (empty($options['notnull']) || !$options['notnull']) {
+ unset($options['default']);
+ }
if ($type == 'integer') {
- if (empty($options['default'])) {
- if (empty($options['notnull'])) {
- unset($options['default']);
- }
- else {
- $options['default'] = 0;
- }
- }
+ $options['default'] = 0;
}
- if (!empty($options['autoincrement'])) {
+ if (!empty($options['autoincrement']) && $options['autoincrement']) {
unset($options['default']);
}
}