loopback icon indicating copy to clipboard operation
loopback copied to clipboard

Schema autoupdate fail if property mysql.columnName contains "_" character and mysql datatype is ENUM

Open hishamjaved opened this issue 9 years ago • 2 comments

Bug or feature request

  • [x ] Bug
  • [ ] Feature request

Description of feature (or steps to reproduce if bug)

If property mysql.columnName contains underscore in the name and its mysql.dataType is ENUM then it produced the following error message during autoupdate() but not in automigrate()

Error: ER_BAD_FIELD_ERROR: Unknown column 'photoType' in 'user-common'

Error prone property Syntax "photo": { "type": "string", "mysql": { "columnName": "photo_type", "dataType": "ENUM", "dataLength": "'GIF','PNG','JPG','JPEG'", "nullable": "N" } },

Working property Syntax "photo": { "type": "string", "mysql": { "columnName": "phototype", "dataType": "ENUM", "dataLength": "'GIF','PNG','JPG','JPEG'", "nullable": "N" } },

Link to sample repo to reproduce issue (if bug)

Expected result

Actual result (if bug)

Additional information (Node.js version, LoopBack version, etc)

hishamjaved avatar Dec 31 '16 13:12 hishamjaved

@hishamjaved I believe this problem is fixed in pr https://github.com/strongloop/loopback-connector-mysql/pull/226 while we haven't released the new version.

I am confirming the status of mysql and see when will we be ready to release it.

jannyHou avatar Jan 04 '17 19:01 jannyHou

I label it with "blocked" due to waiting for release. Will confirm then close it after new version of mysql published.

jannyHou avatar Jan 04 '17 19:01 jannyHou