kaneo (minimalist kanban) fork to experiment adding a tangled integration github.com/usekaneo/kaneo
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: stop column migration from restoring deleted default columns

Tin dd9d0384 17d4e59e

+21 -16
+21 -16
apps/api/src/migrations/column-migration.ts
··· 44 44 projectColumns.map((column) => [column.slug, column.id]), 45 45 ); 46 46 47 - for (const defaultColumn of DEFAULT_COLUMNS) { 48 - if (columnMap.has(defaultColumn.slug)) { 49 - continue; 50 - } 47 + // Only seed missing default slugs for legacy projects that have no columns yet. 48 + // If the project already has columns, missing slugs are intentional (user removed them); 49 + // re-inserting on every startup would undo deletions after each API restart. 50 + if (projectColumns.length === 0) { 51 + for (const defaultColumn of DEFAULT_COLUMNS) { 52 + if (columnMap.has(defaultColumn.slug)) { 53 + continue; 54 + } 51 55 52 - const [inserted] = await db 53 - .insert(columnTable) 54 - .values({ 55 - projectId: project.id, 56 - name: defaultColumn.name, 57 - slug: defaultColumn.slug, 58 - position: defaultColumn.position, 59 - isFinal: defaultColumn.isFinal, 60 - }) 61 - .returning({ id: columnTable.id, slug: columnTable.slug }); 56 + const [inserted] = await db 57 + .insert(columnTable) 58 + .values({ 59 + projectId: project.id, 60 + name: defaultColumn.name, 61 + slug: defaultColumn.slug, 62 + position: defaultColumn.position, 63 + isFinal: defaultColumn.isFinal, 64 + }) 65 + .returning({ id: columnTable.id, slug: columnTable.slug }); 62 66 63 - if (inserted) { 64 - columnMap.set(inserted.slug, inserted.id); 67 + if (inserted) { 68 + columnMap.set(inserted.slug, inserted.id); 69 + } 65 70 } 66 71 } 67 72