fix: remove formatBoolean calls from migration 032 - critical production fix
Mirror to GitHub / mirror (push) Successful in 30s
Test and Lint / frontend-test (push) Has been cancelled
Test and Lint / backend-test (push) Has been cancelled
Version and Release / version-bump (push) Has been cancelled
Version and Release / trigger-drone (push) Has been cancelled
continuous-integration/drone/push Build is passing
Mirror to GitHub / mirror (push) Successful in 30s
Test and Lint / frontend-test (push) Has been cancelled
Test and Lint / backend-test (push) Has been cancelled
Version and Release / version-bump (push) Has been cancelled
Version and Release / trigger-drone (push) Has been cancelled
continuous-integration/drone/push Build is passing
Migration was failing with "formatBoolean is not a function" error, preventing backend startup. Fixed by: - Removing formatBoolean import - Using direct boolean values for column defaults - Using JSON.stringify for setting values 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
const { formatBoolean, parseBoolean } = require('./helpers');
|
// No helpers needed for this migration
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add restore_runs table for tracking restore operations
|
* Add restore_runs table for tracking restore operations
|
||||||
@@ -30,9 +30,9 @@ exports.up = async function(knex) {
|
|||||||
table.string('pre_restore_backup_path', 500); // Path to pre-restore safety backup
|
table.string('pre_restore_backup_path', 500); // Path to pre-restore safety backup
|
||||||
|
|
||||||
// Flags
|
// Flags
|
||||||
table.boolean('is_dry_run').defaultTo(formatBoolean(false));
|
table.boolean('is_dry_run').defaultTo(false);
|
||||||
table.boolean('was_rollback_attempted').defaultTo(formatBoolean(false));
|
table.boolean('was_rollback_attempted').defaultTo(false);
|
||||||
table.boolean('was_successful').defaultTo(formatBoolean(false));
|
table.boolean('was_successful').defaultTo(false);
|
||||||
|
|
||||||
// Operator information
|
// Operator information
|
||||||
table.string('operator_type', 50).defaultTo('manual'); // manual, scheduled, api
|
table.string('operator_type', 50).defaultTo('manual'); // manual, scheduled, api
|
||||||
@@ -59,7 +59,7 @@ exports.up = async function(knex) {
|
|||||||
|
|
||||||
table.bigInteger('file_size');
|
table.bigInteger('file_size');
|
||||||
table.string('checksum', 64);
|
table.string('checksum', 64);
|
||||||
table.boolean('checksum_verified').defaultTo(formatBoolean(false));
|
table.boolean('checksum_verified').defaultTo(false);
|
||||||
|
|
||||||
table.text('error_message');
|
table.text('error_message');
|
||||||
table.timestamp('started_at');
|
table.timestamp('started_at');
|
||||||
@@ -92,7 +92,7 @@ exports.up = async function(knex) {
|
|||||||
await knex('app_settings').insert([
|
await knex('app_settings').insert([
|
||||||
{
|
{
|
||||||
setting_key: 'restore_allow_force',
|
setting_key: 'restore_allow_force',
|
||||||
setting_value: formatBoolean(false),
|
setting_value: JSON.stringify(false),
|
||||||
setting_type: 'restore',
|
setting_type: 'restore',
|
||||||
description: 'Allow force restore with warnings',
|
description: 'Allow force restore with warnings',
|
||||||
created_at: knex.fn.now(),
|
created_at: knex.fn.now(),
|
||||||
@@ -100,7 +100,7 @@ exports.up = async function(knex) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
setting_key: 'restore_require_pre_backup',
|
setting_key: 'restore_require_pre_backup',
|
||||||
setting_value: formatBoolean(true),
|
setting_value: JSON.stringify(true),
|
||||||
setting_type: 'restore',
|
setting_type: 'restore',
|
||||||
description: 'Require pre-restore backup',
|
description: 'Require pre-restore backup',
|
||||||
created_at: knex.fn.now(),
|
created_at: knex.fn.now(),
|
||||||
@@ -116,7 +116,7 @@ exports.up = async function(knex) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
setting_key: 'restore_verify_checksums',
|
setting_key: 'restore_verify_checksums',
|
||||||
setting_value: formatBoolean(true),
|
setting_value: JSON.stringify(true),
|
||||||
setting_type: 'restore',
|
setting_type: 'restore',
|
||||||
description: 'Verify file checksums during restore',
|
description: 'Verify file checksums during restore',
|
||||||
created_at: knex.fn.now(),
|
created_at: knex.fn.now(),
|
||||||
@@ -124,7 +124,7 @@ exports.up = async function(knex) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
setting_key: 'restore_email_on_completion',
|
setting_key: 'restore_email_on_completion',
|
||||||
setting_value: formatBoolean(true),
|
setting_value: JSON.stringify(true),
|
||||||
setting_type: 'restore',
|
setting_type: 'restore',
|
||||||
description: 'Send email on restore completion',
|
description: 'Send email on restore completion',
|
||||||
created_at: knex.fn.now(),
|
created_at: knex.fn.now(),
|
||||||
@@ -159,7 +159,7 @@ exports.up = async function(knex) {
|
|||||||
|
|
||||||
<p>Please verify that all systems are functioning correctly after the restore.</p>`,
|
<p>Please verify that all systems are functioning correctly after the restore.</p>`,
|
||||||
language: 'en',
|
language: 'en',
|
||||||
is_active: formatBoolean(true),
|
is_active: true,
|
||||||
created_at: knex.fn.now(),
|
created_at: knex.fn.now(),
|
||||||
updated_at: knex.fn.now()
|
updated_at: knex.fn.now()
|
||||||
},
|
},
|
||||||
@@ -180,7 +180,7 @@ exports.up = async function(knex) {
|
|||||||
|
|
||||||
<p><strong>Important:</strong> If a pre-restore backup was created, it may be used for recovery.</p>`,
|
<p><strong>Important:</strong> If a pre-restore backup was created, it may be used for recovery.</p>`,
|
||||||
language: 'en',
|
language: 'en',
|
||||||
is_active: formatBoolean(true),
|
is_active: true,
|
||||||
created_at: knex.fn.now(),
|
created_at: knex.fn.now(),
|
||||||
updated_at: knex.fn.now()
|
updated_at: knex.fn.now()
|
||||||
},
|
},
|
||||||
@@ -201,7 +201,7 @@ exports.up = async function(knex) {
|
|||||||
|
|
||||||
<p>Bitte überprüfen Sie, ob alle Systeme nach der Wiederherstellung ordnungsgemäß funktionieren.</p>`,
|
<p>Bitte überprüfen Sie, ob alle Systeme nach der Wiederherstellung ordnungsgemäß funktionieren.</p>`,
|
||||||
language: 'de',
|
language: 'de',
|
||||||
is_active: formatBoolean(true),
|
is_active: true,
|
||||||
created_at: knex.fn.now(),
|
created_at: knex.fn.now(),
|
||||||
updated_at: knex.fn.now()
|
updated_at: knex.fn.now()
|
||||||
},
|
},
|
||||||
@@ -222,7 +222,7 @@ exports.up = async function(knex) {
|
|||||||
|
|
||||||
<p><strong>Wichtig:</strong> Falls ein Backup vor der Wiederherstellung erstellt wurde, kann es zur Wiederherstellung verwendet werden.</p>`,
|
<p><strong>Wichtig:</strong> Falls ein Backup vor der Wiederherstellung erstellt wurde, kann es zur Wiederherstellung verwendet werden.</p>`,
|
||||||
language: 'de',
|
language: 'de',
|
||||||
is_active: formatBoolean(true),
|
is_active: true,
|
||||||
created_at: knex.fn.now(),
|
created_at: knex.fn.now(),
|
||||||
updated_at: knex.fn.now()
|
updated_at: knex.fn.now()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user