sequelize-auto
sequelize-auto copied to clipboard
fix quote for default value
I'm sorry and thank you for your sharing.
This PR is about default value.
I have field that uses single quote in default clause,
`id` binary(16) NOT NULL DEFAULT unhex(replace(uuid(),'-','')) COMMENT 'identifier',
then it generates
defaultValue: Sequelize.Sequelize.literal('unhex(replace(uuid(),'-',''))'),
then it causes error.
I've tried DEFAULT unhex(replace(uuid(),"-","")) , but MariaDB converts " to '.
I always think thanking you when I use sequelize-auto, please consider this.
Best regards.
Besides the fix, this should also be considered: https://github.com/sequelize/sequelize-auto/issues/592