Files
wekan/server/00checkStartup.js
T
Lauri Ojansivu 52d68be755 Remove the per-swimlane-lists-era board migrations that made spurious "Restored Items" columns and empty-looking cards.
#6521: after upgrading toward 10.33 a board grew a new "Restored Items" column
full of cards that looked empty but were not. That column, and the card moves
behind it, came from obsolete board migrations that fight the CURRENT data model:

  * restoreLostCards - created a "Lost Cards" swimlane and a "Restored Items" list
    (i18n lost-cards / lost-cards-list) and moved cards into them. It called a card
    "orphaned" when its list was merely ARCHIVED (archived lists are excluded from
    the set it checks) and "lost" when its swimlaneId was '' - which is NORMAL for a
    board-wide shared card - so it dragged real, fine cards into "Restored Items".
  * comprehensiveBoardMigration / fixMissingListsMigration - converted today's
    board-wide SHARED lists (swimlaneId '') back into per-swimlane DUPLICATE
    columns, i.e. the exact damage the startup schema step merge-per-swimlane-lists
    now UNDOES.
  * restoreAllArchived - un-archived every swimlane/list/card at once.

All four had NO callers left - their admin migration dashboard was already
removed - so they were dead code exposed only as admin-callable Meteor methods, a
footgun that could re-corrupt a board if invoked. They are removed, along with
their imports and the stale commented-out imports in 00checkStartup.js.

The legitimate paths remain and are correct: the board-open self-heal
(repairBoardData) assigns a genuinely missing swimlaneId / relinks orphaned cards
to the board's real first list/swimlane, and the startup schema step
merge-per-swimlane-lists merges any per-swimlane duplicate columns back into one
shared list while cards keep their swimlaneId. It still keys off the era's board
markers (fixMissingListsCompleted / comprehensiveMigrationCompleted) in existing
data, so removing the code that once wrote them changes nothing for already-migrated
boards.

Adds tests/obsoleteBoardMigrationsRemoved.test.cjs so these cannot come back.

Thanks to hmeunier95 and xet7 !

Fixes #6521,
2026-07-24 16:18:24 +03:00

46 lines
1.4 KiB
JavaScript

import '../models/users';
const fs = require('fs');
const os = require('os');
let errors = [];
if (!process.env.WRITABLE_PATH) {
errors.push("WRITABLE_PATH environment variable missing and/or unset, please configure !");
} else {
try {
fs.accessSync(process.env.WRITABLE_PATH, fs.constants.W_OK);
} catch (err) {
const userInfo = os.userInfo();
errors.push("can't write to " + process.env.WRITABLE_PATH, err);
errors.push("the path of WRITABLE_PATH (" + process.env.WRITABLE_PATH + ") must be writable !!!");
errors.push("username: " + userInfo["username"] + " - uid: " + userInfo["uid"] + " - gid: " + userInfo["gid"]);
}
}
if (errors.length > 0) {
console.error("\n\n");
console.error(errors.join("\n"));
console.error("\n");
console.error("Stopping Wekan");
console.error("Wekan isn't runnable. Please resolve the error's above and restart Wekan !");
console.error("\n\n");
process.exit(1);
}
// Import migrations - COMMENTED OUT
// import './migrations/fixAvatarUrls';
// import './migrations/fixAllFileUrls';
// (fixMissingListsMigration / comprehensiveBoardMigration removed in #6521)
// Import file serving routes
import './routes/universalFileServer';
import './routes/customHeadAssets';
// Import server-side custom head rendering
import './lib/customHeadRender';
// Import users for methods
import './import-users-for-methods';
// Note: Automatic migrations are disabled - migrations only run when opening boards