ER_PARSE_ERROR on mysql sequalize字符串数据类型的数组

时间:2016-04-09 07:59:57

标签: mysql node.js sequelize.js

以下代码:

Unhandled rejection SequelizeDatabaseError: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[], `createdAt` DATETIME NOT NULL, `updatedAt` DATETIME NOT NULL, `ReviewId` INT' at line 1
    at Query.formatError (/media/mydata/projects/jobcuejs/node_modules/sequelize/lib/dialects/mysql/query.js:175:14)
    at Query._callback (/media/mydata/projects/jobcuejs/node_modules/sequelize/lib/dialects/mysql/query.js:49:21)
    at Query.Sequence.end (/media/mydata/projects/jobcuejs/node_modules/mysql/lib/protocol/sequences/Sequence.js:96:24)
    at Query.ErrorPacket (/media/mydata/projects/jobcuejs/node_modules/mysql/lib/protocol/sequences/Query.js:94:8)
    at Protocol._parsePacket (/media/mydata/projects/jobcuejs/node_modules/mysql/lib/protocol/Protocol.js:280:23)
    at Parser.write (/media/mydata/projects/jobcuejs/node_modules/mysql/lib/protocol/Parser.js:73:12)
    at Protocol.write (/media/mydata/projects/jobcuejs/node_modules/mysql/lib/protocol/Protocol.js:39:16)
    at Socket.<anonymous> (/media/mydata/projects/jobcuejs/node_modules/mysql/lib/Connection.js:96:28)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Socket.<anonymous> (_stream_readable.js:746:14)
    at Socket.EventEmitter.emit (events.js:92:17)
    at emitReadable_ (_stream_readable.js:408:10)
    at emitReadable (_stream_readable.js:404:5)
    at readableAddChunk (_stream_readable.js:165:9)
    at Socket.Readable.push (_stream_readable.js:127:10)
    at TCP.onread (net.js:526:21)

我收到以下错误:

>mysql --version
mysql  Ver 14.14 Distrib 5.6.28, for debian-linux-gnu (x86_64) using  EditLine wrapper

我做错了什么?

def deleteAtHead(self):
    temp = self.head
    self.head = self.head.next
    delete temp

1 个答案:

答案 0 :(得分:0)

一种类型的数组,例如DataTypes.ARRAY(DataTypes.DECIMAL)。仅适用于postgres。

访问http://docs.sequelizejs.com/en/latest/api/datatypes/?highlight=array#array