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

View File

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

View File

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

View File

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