diff --git a/src/data/migrations/20201019013831_fix_thread_messages_body_column_type.js b/src/data/migrations/20201019013831_fix_thread_messages_body_column_type.js new file mode 100644 index 0000000..ecfbdd5 --- /dev/null +++ b/src/data/migrations/20201019013831_fix_thread_messages_body_column_type.js @@ -0,0 +1,19 @@ +exports.up = async function(knex) { + await knex.schema.table("thread_messages", table => { + table.text("temp_body"); + }); + + await knex.raw("UPDATE thread_messages SET temp_body = body"); + + await knex.schema.table("thread_messages", table => { + table.dropColumn("body"); + }); + + await knex.schema.table("thread_messages", table => { + table.renameColumn("temp_body", "body"); + }); +}; + +exports.down = async function(knex) { + +};