diff --git a/lib/stop_times.js b/lib/stop_times.js index 008093d..dd1c37c 100644 --- a/lib/stop_times.js +++ b/lib/stop_times.js @@ -99,7 +99,7 @@ UPDATE "${opt.schema}".stop_times SET stop_sequence_consec = t.seq FROM ( SELECT - row_number() OVER (PARTITION BY trip_id ORDER BY stop_sequence ASC) - 1 AS seq, + row_number() OVER (PARTITION BY trip_id ORDER BY stop_sequence ASC)::integer - 1 AS seq, trip_id, stop_sequence FROM "${opt.schema}".stop_times ) AS t diff --git a/package.json b/package.json index 6c80c8d..905e733 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gtfs-via-postgres", "description": "Process GTFS using PostgreSQL.", - "version": "4.10.1", + "version": "4.10.2", "main": "lib/index.js", "bin": { "gtfs-to-sql": "cli.js", diff --git a/test/postgraphile.sh b/test/postgraphile.sh index 82721b3..f06bce1 100755 --- a/test/postgraphile.sh +++ b/test/postgraphile.sh @@ -22,7 +22,6 @@ trap 'exit_code=$?; kill -- $(jobs -p); exit $exit_code' SIGINT SIGTERM EXIT ../scripts/run-postgraphile.js & sleep 2 -expected="$(cat sample-gtfs-feed-postgraphile-test.res.json)" body=$(node -e 'process.stdout.write(JSON.stringify({query: fs.readFileSync("sample-gtfs-feed-postgraphile-test.graphql", {encoding: "utf8"})}))') actual_path="$(mktemp -t sample-gtfs-feed-postgraphile-test-XXX)" curl -X POST 'http://localhost:3000/graphql' -H 'Content-Type: application/json' -H 'Accept: application/json' --data "$body" -fsS | jq -r --tab . >"$actual_path"