Skip to content

Commit

Permalink
#1072 Fix assigning default value in SQLite
Browse files Browse the repository at this point in the history
  • Loading branch information
Quy committed Jan 29, 2016
1 parent 5bee150 commit 937c297
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/dblayer/sqlite.php
Expand Up @@ -456,9 +456,9 @@ function add_field($table_name, $field_name, $field_type, $allow_null, $default_

if (!$allow_null)
$query .= ' NOT NULL';
if ($default_value === '')
$default_value = '\'\'';

if (is_string($default_value))
$default_value = '\''.$this->escape($default_value).'\'';

if (!is_null($default_value))
$query .= ' DEFAULT '.$default_value;
Expand Down

0 comments on commit 937c297

Please sign in to comment.