aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-08-21 10:30:27 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-08-21 10:30:27 +0200
commit44f7333d9deef81d3468e20b378c63692a9406ec (patch)
treeaeacb99247dba4e48ee61e2792f5476a3770795a /db
parent6667ee479c06c14bb182f36a0a9ee704fca6218d (diff)
Use OSM as the single source of mountain passes
Replace the centcols CSV download/enrichment pipeline with OSM PBF extraction as the primary (only) source: merge osmpass into mountain_pass, drop the centcols table and model fields, filter to named passes with elevation, and remove the centcols CLI flags.
Diffstat (limited to 'db')
-rw-r--r--db/migrations/20260821000000_osm_only_mountain_passes.sql14
-rw-r--r--db/schema.sql13
2 files changed, 17 insertions, 10 deletions
diff --git a/db/migrations/20260821000000_osm_only_mountain_passes.sql b/db/migrations/20260821000000_osm_only_mountain_passes.sql
new file mode 100644
index 0000000..ebeed55
--- /dev/null
+++ b/db/migrations/20260821000000_osm_only_mountain_passes.sql
@@ -0,0 +1,14 @@
+-- migrate:up
+drop table mountain_passes;
+alter table osm_passes rename to mountain_passes;
+
+-- migrate:down
+alter table mountain_passes rename to osm_passes;
+create table mountain_passes (
+ id integer primary key,
+ external_id text unique not null,
+ name text not null,
+ country_code text not null,
+ department_code text not null,
+ elevation integer not null
+);
diff --git a/db/schema.sql b/db/schema.sql
index 4c03183..60505bb 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -1,13 +1,5 @@
CREATE TABLE IF NOT EXISTS "schema_migrations" (version varchar(255) primary key);
-CREATE TABLE mountain_passes (
- id integer primary key,
- external_id text unique not null,
- name text not null,
- country_code text not null,
- department_code text not null,
- elevation integer not null
-, latitude real, longitude real);
-CREATE TABLE osm_passes (
+CREATE TABLE IF NOT EXISTS "mountain_passes" (
id integer primary key,
osm_id integer unique not null,
name text,
@@ -47,4 +39,5 @@ INSERT INTO "schema_migrations" (version) VALUES
('20260804000000'),
('20260807000000'),
('20260813000000'),
- ('20260820184307');
+ ('20260820184307'),
+ ('20260821000000');