Преглед изворни кода

fix(core): Use "double precision" as column type for float custom fields

"double precision" is an alias for "double" in MySQL and is also supported by Postgres. Closes #217
Michael Bromley пре 6 година
родитељ
комит
8f2d034e97
1 измењених фајлова са 2 додато и 4 уклоњено
  1. 2 4
      packages/core/src/entity/register-custom-entity-fields.ts

+ 2 - 4
packages/core/src/entity/register-custom-entity-fields.ts

@@ -62,9 +62,7 @@ function registerCustomFieldsForEntity(
                     const length = customField.length || 255;
                     if (MAX_STRING_LENGTH < length) {
                         throw new Error(
-                            `ERROR: The "length" property of the custom field "${
-                                customField.name
-                            }" is greater than the maximum allowed value of ${MAX_STRING_LENGTH}`,
+                            `ERROR: The "length" property of the custom field "${customField.name}" is greater than the maximum allowed value of ${MAX_STRING_LENGTH}`,
                         );
                     }
                     options.length = length;
@@ -119,7 +117,7 @@ function getColumnType(dbEngine: ConnectionOptions['type'], type: CustomFieldTyp
         case 'int':
             return 'int';
         case 'float':
-            return 'double';
+            return 'double precision';
         case 'datetime':
             switch (dbEngine) {
                 case 'postgres':