mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
DB: Set correct default value for numeric types
Set 0 as default value for columns with numeric data type instead of the
empty string ''. Otherwise the database complains about an invalid
default value for this column.
To reproduce put the following in your ````appinfo/database.xml````:
````
<field>
<name>modified</name>
<type>decimal</type>
<default/>
<notnull>true</notnull>
<length>15</length>
</field>
````
See owncloud/mozilla_sync#14
This commit is contained in:
parent
841c622085
commit
b278356eb9
1 changed files with 1 additions and 1 deletions
|
|
@ -193,7 +193,7 @@ class MDB2SchemaReader {
|
|||
} else {
|
||||
$options['default'] = '';
|
||||
}
|
||||
if ($type == 'integer') {
|
||||
if ($type == 'integer' || $type == 'numeric') {
|
||||
$options['default'] = 0;
|
||||
} elseif ($type == 'boolean') {
|
||||
$options['default'] = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue