gtfs 4.15.4 → 4.15.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/gtfs-import.js
CHANGED
|
@@ -3793,6 +3793,9 @@ var importGtfsFiles = (db, task) => mapSeries2(
|
|
|
3793
3793
|
task.log(`Importing - ${filename}\r`);
|
|
3794
3794
|
const columns = model.schema.filter((column) => column.name !== "id");
|
|
3795
3795
|
const placeholder = columns.map(({ name }) => `@${name}`).join(", ");
|
|
3796
|
+
const prefixedColumns = new Set(
|
|
3797
|
+
columns.filter((col) => col.prefix).map((col) => col.name)
|
|
3798
|
+
);
|
|
3796
3799
|
const prepareStatement = `INSERT ${task.ignoreDuplicates ? "OR IGNORE" : ""} INTO ${model.filenameBase} (${columns.map((column) => column.name).join(", ")}) VALUES (${placeholder})`;
|
|
3797
3800
|
const insert = db.prepare(prepareStatement);
|
|
3798
3801
|
const insertLines = db.transaction((lines) => {
|
|
@@ -3806,7 +3809,7 @@ var importGtfsFiles = (db, task) => mapSeries2(
|
|
|
3806
3809
|
line
|
|
3807
3810
|
).map(([columnName, value]) => [
|
|
3808
3811
|
columnName,
|
|
3809
|
-
|
|
3812
|
+
prefixedColumns.has(columnName) && value !== null ? `${task.prefix}${value}` : value
|
|
3810
3813
|
])
|
|
3811
3814
|
);
|
|
3812
3815
|
insert.run(prefixedLine);
|