diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-09-06 01:31:50 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-09-06 01:31:50 -0400 |
| commit | c88806506d2f8845a9fb914c960d0b6bbc5a8e1e (patch) | |
| tree | c271bb35972175d286f62ecfce76a8fce50f6aa7 /migrations/20150905232742_make_blob_fields_text.js | |
| parent | 0d0c04ad510264f2dbd2deb3bbf0b0d0c0605a62 (diff) | |
display hootbox
Diffstat (limited to 'migrations/20150905232742_make_blob_fields_text.js')
| -rw-r--r-- | migrations/20150905232742_make_blob_fields_text.js | 64 |
1 files changed, 64 insertions, 0 deletions
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", +*/ +}; |
