From 45c145c52ed431f81815b14a6fd667700226fc92 Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Thu, 5 Dec 2024 16:45:29 +1100 Subject: [PATCH] chore: ensure migration down matches up --- .../20241231000100_mysql8_compatibility.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/services/api/database/migrations/20241231000100_mysql8_compatibility.js b/services/api/database/migrations/20241231000100_mysql8_compatibility.js index ddf028ac5c..da891923f4 100644 --- a/services/api/database/migrations/20241231000100_mysql8_compatibility.js +++ b/services/api/database/migrations/20241231000100_mysql8_compatibility.js @@ -49,25 +49,29 @@ exports.down = async function(knex) { return knex.schema .alterTable('advanced_task_definition', function (table) { table.specificType('description', 'text').defaultTo('').notNullable().alter(); - table.string('group_name', 300).alter(); + table.string('group_name', 2000).alter(); table.specificType('command', 'text').defaultTo('').alter(); }) + .alterTable('environment', function (table) { + table.string('deploy_base_ref', 100).alter(); + table.string('deploy_head_ref', 100).alter(); + }) .alterTable('environment_fact', function (table) { table.specificType('description', 'text').defaultTo('').alter(); table.specificType('category', 'text').defaultTo('').alter(); }) .alterTable('environment_problem', function (table) { - table.string('identifier', 100).notNullable().alter(); - table.string('lagoon_service', 100).defaultTo('').alter(); + table.string('identifier', 300).notNullable().alter(); + table.string('lagoon_service', 300).defaultTo('').alter(); table.specificType('description', 'text').defaultTo('').alter(); - table.string('version', 100).defaultTo('').alter(); + table.string('version', 300).defaultTo('').alter(); }) .alterTable('project', function (table) { table.json('metadata').defaultTo('{}').alter(); }) .alterTable('s3_file', function (table) { table.datetime('created').notNullable().defaultTo(knex.fn.now()).alter(); - table.datetime('deleted').notNullable().alter(); + table.datetime('deleted').notNullable().defaultTo('0000-00-00 00:00:00').alter(); }) .alterTable('organization', function (table) { table.specificType('description', 'text').notNullable().defaultTo('').alter();