Skip to content

Malformed Array Literal #342

Closed
Closed
@sujeshthekkepatt

Description

@sujeshthekkepatt

Hai,
I am using sequelize for the migration task instead of the default automigrate function. I have created a column "tags" with datatype Array in sequelize. And created the model using "lb model" and defined the type of tags as the array of string. But when i POST to /api/users it throws malformed array literal error. Turns out the default automigrate function create the type of "tags" to "text" not to actual postgres array. Any way to use the default Postgres array type in here?
My model definition is as,

{
"name": "user",
"plural": "users",
"base": "mfy-base",
"idInjection": false,
"options": {
"validateUpsert": true
},
"forceId": false,
"properties": {
"id": {
"type": "string",
"id": true,
"required": false,
"defaultFn": "uuid",
"postgresql": {
"dataType": "uuid"
}
},
"psid": {
"type": "string"
},
"profile_pic": {
"type": "string"
},
"gender": {
"type": "string"
},
"locale": {
"type": "string"
},
"timezone": {
"type": "string"
},
"status": {
"type": "string",
"default": "unread"
},
"tags": {
"type": ["string"]
},
"last_message": {
"type": "object"
},
"last_fb_message_at": {
"type": "date",
"defaultFn": "now"
},
"mmail": {
"type": "string"
},
"is_mmail_allowed": {
"type": "boolean",
"default": true
},
"is_messaging_allowed": {
"type": "boolean",
"default": true
},
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
},
"type": {
"type": "string"
}
},
"validations": [],
"relations": {
"page": {
"type": "belongsTo",
"model": "page",
"foreignKey": "",
"options": {
"nestRemoting": true
}
},
"events": {
"type": "hasMany",
"model": "event",
"foreignKey": "",
"options": {
"nestRemoting": true
}
}
},
"acls": [],
"methods": {}
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions