Use double type for more precision

This commit is contained in:
Alexandre Bodin 2021-09-16 14:04:10 +02:00
parent 76caaba714
commit e57a40b328
4 changed files with 5 additions and 5 deletions

View File

@ -56,8 +56,8 @@ const toStrapiType = column => {
case 'decimal': {
return { type: 'decimal', args: [10, 2] };
}
case 'float': {
return { type: 'float', args: [10, 2] };
case 'double': {
return { type: 'double' };
}
case 'bigint': {
return { type: 'bigInteger' };
@ -90,7 +90,6 @@ const toStrapiType = column => {
case 'timestamp': {
return { type: 'timestamp', args: [{ useTz: false, precision: 6 }] };
}
case 'json': {
return { type: 'jsonb' };
}

View File

@ -97,7 +97,7 @@ const toStrapiType = column => {
}
case 'real':
case 'double': {
return { type: 'float', args: [10, 2] };
return { type: 'double' };
}
case 'bigint': {
return { type: 'bigInteger' };

View File

@ -39,6 +39,7 @@ class SqliteDialect extends Dialect {
case 'enum': {
return 'text';
}
case 'double':
case 'decimal': {
return 'float';
}

View File

@ -154,7 +154,7 @@ const getColumnType = attribute => {
return { type: 'bigInteger' };
}
case 'float': {
return { type: 'float', args: [10, 2] };
return { type: 'double' };
}
case 'decimal': {
return { type: 'decimal', args: [10, 2] };