summaryrefslogtreecommitdiff
path: root/migrations
diff options
context:
space:
mode:
authorjulian laplace <julescarbon@gmail.com>2022-10-25 23:26:31 +0200
committerjulian laplace <julescarbon@gmail.com>2022-10-25 23:26:31 +0200
commit1cfed2612fd1042a15d470a44ec87588c966dc12 (patch)
treeba850f589194a21fd1587dd71dfcd056a242e4ac /migrations
parentae311b71cccf5df9e0e19e276615cc32426d9de1 (diff)
hootstream... dark mode only
Diffstat (limited to 'migrations')
-rw-r--r--migrations/20150905232742_make_blob_fields_text.js91
1 files changed, 51 insertions, 40 deletions
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",
-*/
+*/
};