mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-02 09:22:15 +00:00
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:
@@ -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'");
|
||||
}
|
||||
}
|
||||
@@ -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,
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user