// MySQL Column Compiler // ------- const ColumnCompiler = require('../../../schema/columncompiler'); const { isObject } = require('../../../util/is'); const { toNumber } = require('../../../util/helpers'); const commentEscapeRegex = /(? 255) { this.client.logger.warn( 'Your comment is longer than the max comment length for MySQL' ); } return comment && `comment '${comment.replace(commentEscapeRegex, "\\'")}'`; } first() { return 'first'; } after(column) { return `after ${this.formatter.wrap(column)}`; } collate(collation) { return collation && `collate '${collation}'`; } } ColumnCompiler_MySQL.prototype.increments = ({ primaryKey = true } = {}) => 'int unsigned not null auto_increment' + (primaryKey ? ' primary key' : ''); ColumnCompiler_MySQL.prototype.bigincrements = ({ primaryKey = true } = {}) => 'bigint unsigned not null auto_increment' + (primaryKey ? ' primary key' : ''); ColumnCompiler_MySQL.prototype.bigint = 'bigint'; ColumnCompiler_MySQL.prototype.mediumint = 'mediumint'; ColumnCompiler_MySQL.prototype.smallint = 'smallint'; module.exports = ColumnCompiler_MySQL;