From 1cfed2612fd1042a15d470a44ec87588c966dc12 Mon Sep 17 00:00:00 2001 From: julian laplace Date: Tue, 25 Oct 2022 23:26:31 +0200 Subject: hootstream... dark mode only --- migrations/20150905232742_make_blob_fields_text.js | 91 ++++++++++++---------- 1 file changed, 51 insertions(+), 40 deletions(-) (limited to 'migrations') diff --git a/migrations/20150905232742_make_blob_fields_text.js b/migrations/20150905232742_make_blob_fields_text.js index fe50ba2..0ee2dbd 100644 --- a/migrations/20150905232742_make_blob_fields_text.js +++ b/migrations/20150905232742_make_blob_fields_text.js @@ -1,50 +1,61 @@ // 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") }) +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 = [ -// these ones dont workb ecause of weird unicode somewhere in the db! -// "comments comment text", -// "messages body text", - "invites grass tinytext", - "keywords threads text", - "keywords ops text", - "keywords display tinytext", - "tags ops text", - "tags display tinytext", - "threads allowed tinytext", - "threads display tinytext", + // these ones dont workb ecause of weird unicode somewhere in the db! + "comments comment text", + "messages body text", + // "invites grass tinytext", + // "keywords threads text", + // "keywords ops text", + // "keywords display tinytext", + // "tags ops text", + // "tags display tinytext", + "threads allowed text", + // "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 + // "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"); + }) + .catch(function (error) { + console.log("error", s, error.message); + }); + }); + return promise; }; -exports.down = function(knex, Promise) { -/* +exports.down = function (knex, Promise) { + return () => {}; + /* "comments comment blob", "invites grass tinyblob", "keywords threads blob", @@ -61,5 +72,5 @@ exports.down = function(knex, Promise) { "users sink blob", "users display blob", "users boxes blob", -*/ +*/ }; -- cgit v1.2.3-70-g09d2