Fix for #5219 - default all string types to basic text format, allow user to switch string types to longform if they desire.

This commit is contained in:
mike12345567 2022-04-27 16:29:03 +01:00
parent 2773c04953
commit 056d9defe4
3 changed files with 13 additions and 5 deletions

View File

@ -144,7 +144,11 @@ export const RelationshipTypes = {
MANY_TO_ONE: "many-to-one",
}
export const ALLOWABLE_STRING_OPTIONS = [FIELDS.STRING, FIELDS.OPTIONS]
export const ALLOWABLE_STRING_OPTIONS = [
FIELDS.STRING,
FIELDS.OPTIONS,
FIELDS.LONGFORM,
]
export const ALLOWABLE_STRING_TYPES = ALLOWABLE_STRING_OPTIONS.map(
opt => opt.type
)

View File

@ -47,7 +47,11 @@ exports.FieldTypes = {
exports.CanSwitchTypes = [
[exports.FieldTypes.JSON, exports.FieldTypes.ARRAY],
[exports.FieldTypes.STRING, exports.FieldTypes.OPTIONS],
[
exports.FieldTypes.STRING,
exports.FieldTypes.OPTIONS,
exports.FieldTypes.LONGFORM,
],
[exports.FieldTypes.BOOLEAN, exports.FieldTypes.NUMBER],
]

View File

@ -42,9 +42,9 @@ const SQL_STRING_TYPE_MAP = {
nvarchar: FieldTypes.STRING,
ntext: FieldTypes.STRING,
enum: FieldTypes.STRING,
blob: FieldTypes.LONGFORM,
long: FieldTypes.LONGFORM,
text: FieldTypes.LONGFORM,
blob: FieldTypes.STRING,
long: FieldTypes.STRING,
text: FieldTypes.STRING,
}
const SQL_BOOLEAN_TYPE_MAP = {