feat(addons): Tours is on for every install

A fresh install gets Tours enabled from the addon seeder. An install that
already has the row is switched on by a migration that runs once, so an
admin who turns Tours off afterwards keeps it off.
This commit is contained in:
Maurice
2026-10-20 20:52:00 +02:00
parent e42622d71d
commit 5580ff71a9
4 changed files with 58 additions and 2 deletions
@@ -0,0 +1,15 @@
import { Migration } from '@mikro-orm/migrations';
/**
* Tours is on for every install from v5 on. A fresh install gets it from the
* addon seeder, which now writes it enabled; an install that already has the
* row is switched on here, once. The migration never runs again, so an admin
* who turns Tours off afterwards keeps it off.
*/
export class Migration20200101046140_tours_are_on_for_every_install extends Migration {
override name = 'Migration20200101046140_tours_are_on_for_every_install';
override async up(): Promise<void> {
this.addSql("UPDATE addons SET enabled = 1 WHERE id = 'tours'");
}
}
+2 -2
View File
@@ -13,7 +13,7 @@ interface AddonRow {
sort_order: number;
}
const DEFAULT_ADDONS: AddonRow[] = [
export const DEFAULT_ADDONS: AddonRow[] = [
{
id: 'packing',
name: 'Lists',
@@ -101,7 +101,7 @@ const DEFAULT_ADDONS: AddonRow[] = [
description: 'Hikes and other single-day tours that follow a route',
type: 'trip',
icon: 'Mountain',
enabled: 0,
enabled: 1,
sort_order: 8,
},
{