mirror of
https://github.com/frappe/books.git
synced 2024-12-25 20:11:15 +00:00
fix: String default value must be in quotes
This commit is contained in:
parent
f1823a71ab
commit
bf4b6c6f6b
@ -79,12 +79,16 @@ module.exports = class sqliteDatabase extends Database {
|
||||
}
|
||||
|
||||
getColumnDefinition(field) {
|
||||
let defaultValue = field.default;
|
||||
if (typeof defaultValue === 'string') {
|
||||
defaultValue = `'${defaultValue}'`
|
||||
}
|
||||
let def = [
|
||||
field.fieldname,
|
||||
this.typeMap[field.fieldtype],
|
||||
field.fieldname === 'name' ? 'PRIMARY KEY NOT NULL' : '',
|
||||
field.required ? 'NOT NULL' : '',
|
||||
field.default ? `DEFAULT ${field.default}` : ''
|
||||
field.default ? `DEFAULT ${defaultValue}` : ''
|
||||
].join(' ');
|
||||
|
||||
return def;
|
||||
|
Loading…
Reference in New Issue
Block a user