mysql: Use utf8mb4 character set

This commit is contained in:
Girish Ramakrishnan
2017-04-14 12:30:47 -07:00
parent ba56f7d15d
commit bb91faf23c
2 changed files with 30 additions and 0 deletions
@@ -0,0 +1,14 @@
'use strict';
var url = require('url');
exports.up = function(db, callback) {
var dbName = url.parse(process.env.DATABASE_URL).path.substr(1); // remove slash
// by default, mysql collates case insensitively. 'utf8_general_cs' is not available
db.runSql('ALTER DATABASE ' + dbName + ' DEFAULT CHARACTER SET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci', callback);
};
exports.down = function(db, callback) {
callback();
};