Sequelize JSON data type

前端 未结 5 711
北荒
北荒 2021-02-02 14:22

I have defined a model as

module.exports = function (sequelize, DataTypes) {
  const MyModel = sequelize.define(\'MyModel\', {
    data: {
      type: DataTypes         


        
5条回答
  •  面向向阳花
    2021-02-02 14:26

    JSON data types aren't supported for MySQL.

    See the docs here http://docs.sequelizejs.com/en/v3/docs/models-definition/#data-types

    A work around could be to use text and stringify/parse when querying it

提交回复
热议问题