The initial source comes from sdcuike/issueBlog#4
https://github.com/PacktPublishing free to download books code by Packet
https://love2.io Chinese site
https://github.com/PacktPublishing free to download books code by Packet
https://love2.io Chinese site
| // path: abstract/query-generator.js | |
| 'use strict'; | |
| const Utils = require('../../utils'); | |
| const SqlString = require('../../sql-string'); | |
| const Model = require('../../model'); | |
| const DataTypes = require('../../data-types'); | |
| const util = require('util'); | |
| const _ = require('lodash'); | |
| const Dottie = require('dottie'); |
| import Sequelize from 'sequelize'; | |
| function doTrick() { | |
| console.log('doTrick'); | |
| const { UUID } = Sequelize.DataTypes; | |
| const mysqlUUID = Sequelize.DataTypes.mysql.UUID; | |
| UUID.types.mysql = ['BLOB']; | |
| // TODO trick |
| # This is patch to trick uuid field to force it store as BINARY field in mysql | |
| # In the model-definition | |
| # Try to define uuid id field | |
| ` | |
| "id": { | |
| "type": "string", | |
| "defaultFn": "uuid", | |
| "id": true, | |
| "mysql": { | |
| "columnName": "user_id", |