mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-06 02:34:21 +00:00
feat(tours): bike tours in the contract and on the server (BIK-01 to BIK-06, RTE-01)
A tour can be a bike tour with a routing profile (touring, road, gravel, mtb), stored per tour by a new migration. The server grades the ways of a mountain bike route from OpenStreetMap (mtb:scale) through one shared Overpass client, offers CyclOSM behind its own admin switch, and exports a bike tour's GPX with the activity of its profile. A hike's route choices are now exactly the three the card names: steep climbs, steps and ferries.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { Migration } from '@mikro-orm/migrations';
|
||||
|
||||
/**
|
||||
* BIK-01: a tour can be a bike tour. The `bike` key has been in `tour_types`,
|
||||
* disabled, since every contract type was seeded; it is switched on here. The
|
||||
* profile it is ridden on (touring, road, gravel, mtb) is a column of the
|
||||
* tour, NULL on every other type, so no existing tour changes its meaning.
|
||||
*/
|
||||
export class Migration20200101045200_a_tour_can_be_ridden extends Migration {
|
||||
override name = 'Migration20200101045200_a_tour_can_be_ridden';
|
||||
|
||||
override up(): void {
|
||||
this.addSql(
|
||||
"ALTER TABLE tours ADD COLUMN bike_profile TEXT CHECK (bike_profile IS NULL OR bike_profile IN ('touring', 'road', 'gravel', 'mtb'))",
|
||||
);
|
||||
this.addSql("UPDATE tour_types SET enabled = 1 WHERE key = 'bike'");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user