Merge 8f4b790b54 into c3b968aa10
This commit is contained in:
commit
d83903ea82
6 changed files with 33 additions and 10 deletions
|
|
@ -1,6 +1,10 @@
|
|||
'use strict';
|
||||
|
||||
const config = require('./config');
|
||||
let config = require('./config');
|
||||
|
||||
config.mysql.charset="utf8mb4";
|
||||
config.mysql.multipleStatements=true;
|
||||
|
||||
|
||||
module.exports = {
|
||||
client: 'mysql',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
exports.up = function(knex, Promise) {
|
||||
return knex.raw('SELECT table_name FROM information_schema.tables WHERE table_schema = ?', [knex.client.database()])
|
||||
.then(function(tablas) {
|
||||
let sql="";
|
||||
tablas=tablas[0];
|
||||
for(let i=0; i<tablas.length; i++) {
|
||||
sql+="ALTER TABLE "+tablas[i].table_name+" CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;";
|
||||
}
|
||||
//console.log(sql);
|
||||
return knex.raw(sql);
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = function(knex, Promise) {
|
||||
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue