Example migration
A small export from an imaginary fleet system ("FleetBase 4") and the mapping that brings it into the fleet preset.
It is the fixture of lib/migrate.test.ts, so it is known to work. Four rows are wrong on purpose, to show what the
report says about them:
| Row | Problem | What the report says |
|---|---|---|
depots.csv D-03 |
region XX is not in regions.csv |
Region: region "XX" was not imported |
vehicles.csv FB-1004 |
model year 1985 is below the configured minimum | Year: the smallest allowed value is 1990. |
vehicles.csv FB-1005 |
its depot D-03 was refused | Depot: depot "D-03" was not imported |
vehicles.csv FB-1006 |
fuel code H2 has no mapping |
Fuel: no mapping for "H2" |
option-values.csv line 5 |
90000 km is above the option's maximum | The largest allowed value is 60000. |
Try it against a scratch database (see docs/migration.md):
export COUNTERSIGN_STORAGE=sqlite COUNTERSIGN_DATA_FILE=./scratch/migration.sqlite
node scripts/countersign.ts init --config preset:fleet
node scripts/countersign.ts import --mapping examples/migration/mapping.json --dir examples/migration \
--actor-id jdoe --actor-name "Jane Doe" --actor-roles system-owner --dry-run --report ./scratch