1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
// mysqlcheck -u root --auto-repair --optimize --all-databases
exports.up = function(knex, Promise) {
var promise
knex.raw("ALTER DATABASE bucky CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci").then(function(){ console.log("OK") })
var sql = [
"comments comment text",
"invites grass tinytext",
"keywords threads text",
"keywords ops text",
"keywords display tinytext",
"messages body text",
"tags ops text",
"tags display tinytext",
"threads allowed tinytext",
"threads display tinytext",
"users grass text",
"users keywords text",
"users stickies text",
"users sink text",
"users display text",
"users boxes text",
].map(function(s){
var ss = s.split(" ")
var sz = [
"ALTER TABLE",
ss[0],
"MODIFY COLUMN",
ss[1],
ss[2],
].join(" ")
console.log(sz + ";")
promise = knex.raw([
"ALTER TABLE",
ss[0],
"MODIFY COLUMN",
ss[1],
ss[2],
"CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci",
].join(" ")).then(function(){ Promise.resolve(); console.log("OK") })
})
return promise
};
exports.down = function(knex, Promise) {
/*
"comments comment blob",
"invites grass tinyblob",
"keywords threads blob",
"keywords ops blob",
"keywords display tinyblob",
"messages body blob",
"tags ops blob",
"tags display tinyblob",
"threads allowed tinyblob",
"threads display tinyblob",
"users grass blob",
"users keywords blob",
"users stickies blob",
"users sink blob",
"users display blob",
"users boxes blob",
*/
};
|