From c88806506d2f8845a9fb914c960d0b6bbc5a8e1e Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 6 Sep 2015 01:31:50 -0400 Subject: display hootbox --- migrations/20150905232742_make_blob_fields_text.js | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 migrations/20150905232742_make_blob_fields_text.js (limited to 'migrations') diff --git a/migrations/20150905232742_make_blob_fields_text.js b/migrations/20150905232742_make_blob_fields_text.js new file mode 100644 index 0000000..6e24278 --- /dev/null +++ b/migrations/20150905232742_make_blob_fields_text.js @@ -0,0 +1,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", +*/ +}; -- cgit v1.2.3-70-g09d2