gtfs 4.11.1 → 4.11.2

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.
Files changed (67) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +12 -19
  3. package/lib/export.js +42 -32
  4. package/lib/geojson-utils.js +9 -0
  5. package/lib/gtfs/locations.js +32 -0
  6. package/lib/gtfs.js +4 -0
  7. package/lib/import.js +41 -14
  8. package/models/gtfs/agency.js +9 -8
  9. package/models/gtfs/areas.js +3 -2
  10. package/models/gtfs/attributions.js +9 -8
  11. package/models/gtfs/booking-rules.js +11 -10
  12. package/models/gtfs/calendar-dates.js +3 -2
  13. package/models/gtfs/calendar.js +2 -1
  14. package/models/gtfs/fare-attributes.js +4 -3
  15. package/models/gtfs/fare-leg-rules.js +8 -7
  16. package/models/gtfs/fare-media.js +3 -2
  17. package/models/gtfs/fare-products.js +5 -4
  18. package/models/gtfs/fare-rules.js +6 -5
  19. package/models/gtfs/fare-transfer-rules.js +5 -4
  20. package/models/gtfs/feed-info.js +8 -7
  21. package/models/gtfs/frequencies.js +4 -3
  22. package/models/gtfs/levels.js +3 -2
  23. package/models/gtfs/location-group-stops.js +3 -2
  24. package/models/gtfs/location-groups.js +3 -2
  25. package/models/gtfs/locations.js +12 -0
  26. package/models/gtfs/networks.js +3 -2
  27. package/models/gtfs/pathways.js +6 -5
  28. package/models/gtfs/route-networks.js +3 -2
  29. package/models/gtfs/routes.js +10 -9
  30. package/models/gtfs/shapes.js +2 -1
  31. package/models/gtfs/stop-areas.js +3 -2
  32. package/models/gtfs/stop-times.js +11 -10
  33. package/models/gtfs/stops.js +12 -11
  34. package/models/gtfs/timeframes.js +5 -4
  35. package/models/gtfs/transfers.js +7 -6
  36. package/models/gtfs/translations.js +8 -7
  37. package/models/gtfs/trips.js +8 -7
  38. package/models/gtfs-plus/calendar-attributes.js +3 -2
  39. package/models/gtfs-plus/directions.js +3 -2
  40. package/models/gtfs-plus/route-attributes.js +2 -1
  41. package/models/gtfs-plus/stop-attributes.js +5 -4
  42. package/models/gtfs-realtime/service-alert-targets.js +3 -3
  43. package/models/gtfs-realtime/service-alerts.js +5 -5
  44. package/models/gtfs-realtime/stop-time-updates.js +7 -7
  45. package/models/gtfs-realtime/trip-updates.js +8 -8
  46. package/models/gtfs-realtime/vehicle-positions.js +12 -12
  47. package/models/gtfs-ride/board-alight.js +5 -4
  48. package/models/gtfs-ride/ride-feed-info.js +3 -2
  49. package/models/gtfs-ride/rider-trip.js +9 -8
  50. package/models/gtfs-ride/ridership.js +8 -7
  51. package/models/gtfs-ride/trip-capacity.js +4 -3
  52. package/models/models.js +2 -0
  53. package/models/non-standard/timetable-notes-references.js +6 -5
  54. package/models/non-standard/timetable-notes.js +4 -3
  55. package/models/non-standard/timetable-pages.js +4 -3
  56. package/models/non-standard/timetable-stop-order.js +3 -2
  57. package/models/non-standard/timetables.js +10 -9
  58. package/models/non-standard/trips-dated-vehicle-journey.js +4 -3
  59. package/models/ods/deadhead-times.js +6 -5
  60. package/models/ods/deadheads.js +9 -8
  61. package/models/ods/ops-locations.js +5 -4
  62. package/models/ods/run-events.js +7 -6
  63. package/models/ods/runs-pieces.js +5 -4
  64. package/package.json +4 -4
  65. package/test/mocha/export-gtfs.js +5 -2
  66. package/test/mocha/get-locations.js +71 -0
  67. package/test/mocha/import-gtfs.js +4 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [4.11.2] - 2024-06-13
9
+
10
+ ### Added
11
+
12
+ - Support for [locations.geojson](https://gtfs.org/schedule/reference/#locationsgeojson)
13
+
14
+ ### Updated
15
+
16
+ - Update sqlite type for all models
17
+ - Dependency updates
18
+
8
19
  ## [4.11.1] - 2024-06-05
9
20
 
10
21
  ### Changed
package/README.md CHANGED
@@ -29,27 +29,9 @@ You can use it as a [command-line tool](#command-line-examples) or as a [node.js
29
29
 
30
30
  This library has four parts: the [GTFS import script](#gtfs-import-script), [GTFS export script](#gtfs-export-script) and [GTFS-Realtime update script](#gtfsrealtime-update-script) and the [query methods](#query-methods)
31
31
 
32
- ## Breaking changes in Version 4
33
-
34
- Version 4 of node-gtfs switched to using the better-sqlite3 library. This allowed all query methods to become synchronous and speeds up import and export.
35
-
36
- - All query methods are now synchronous.
37
-
38
- ```js
39
- // Version 3
40
- const routes = await getRoutes();
41
-
42
- // Version 4
43
- const routes = getRoutes();
44
- ```
45
-
46
- - `runRawQuery` has been removed. Use [Raw SQLite Query](#raw-sqlite-query) instead.
47
- - `execRawQuery` has been removed. Use [Raw SQLite Query](#raw-sqlite-query) instead.
48
- - `getDb` has been removed. Use `openDb` instead.
49
-
50
32
  ## Installation
51
33
 
52
- To use this library as a command-line utility, install it globally [npm](https://npmjs.org):
34
+ To use this library as a command-line utility, install it globally with [npm](https://npmjs.org):
53
35
 
54
36
  npm install gtfs -g
55
37
 
@@ -1224,6 +1206,17 @@ const locationGroups = getLocationGroupStops({
1224
1206
  });
1225
1207
  ```
1226
1208
 
1209
+ #### getLocations(query, fields, sortBy, options)
1210
+
1211
+ Returns an array of locations that match query parameters. Each location is text that can be parsed into a geojson object. [Details on locations.geojson](https://gtfs.org/schedule/reference/#locationsgeojson)
1212
+
1213
+ ```js
1214
+ import { getLocations } from 'gtfs';
1215
+
1216
+ // Get all locations
1217
+ const locations = getLocations();
1218
+ ```
1219
+
1227
1220
  #### getPathways(query, fields, sortBy, options)
1228
1221
 
1229
1222
  Returns an array of pathways that match query parameters. [Details on pathways.txt](https://gtfs.org/schedule/reference/#pathwaystxt)
package/lib/export.js CHANGED
@@ -66,52 +66,62 @@ const exportGtfs = async (initialConfig) => {
66
66
 
67
67
  // Loop through each GTFS file
68
68
  const exportedFiles = await mapSeries(models, async (model) => {
69
- const filepath = path.join(exportPath, `${model.filenameBase}.txt`);
69
+ const filePath = path.join(
70
+ exportPath,
71
+ `${model.filenameBase}.${model.filenameExtension}`,
72
+ );
70
73
  const tableName = sqlString.escapeId(model.filenameBase);
71
74
  const lines = db.prepare(`SELECT * FROM ${tableName};`).all();
72
75
 
73
76
  if (!lines || lines.length === 0) {
74
77
  if (!model.nonstandard) {
75
- log(`Skipping (no data) - ${model.filenameBase}.txt\r`);
78
+ log(
79
+ `Skipping (no data) - ${model.filenameBase}.${model.filenameExtension}\r`,
80
+ );
76
81
  }
77
82
 
78
83
  return;
79
84
  }
80
85
 
81
- const excludeColumns = [
82
- 'id',
83
- 'arrival_timestamp',
84
- 'departure_timestamp',
85
- 'start_timestamp',
86
- 'end_timestamp',
87
- 'service_arrival_timestamp',
88
- 'service_departure_timestamp',
89
- 'boarding_timestamp',
90
- 'alighting_timestamp',
91
- 'ridership_start_timestamp',
92
- 'ridership_end_timestamp',
93
- ];
94
-
95
- // If no routes have values for agency_id, add it to the excludeColumns list
96
- if (model.filenameBase === 'routes') {
97
- const routesWithAgencyId = db
98
- .prepare('SELECT agency_id FROM routes WHERE agency_id IS NOT NULL;')
99
- .all();
100
- if (!routesWithAgencyId || routesWithAgencyId.length === 0) {
101
- excludeColumns.push('agency_id');
86
+ if (model.filenameExtension === 'txt') {
87
+ const excludeColumns = [
88
+ 'id',
89
+ 'arrival_timestamp',
90
+ 'departure_timestamp',
91
+ 'start_timestamp',
92
+ 'end_timestamp',
93
+ 'service_arrival_timestamp',
94
+ 'service_departure_timestamp',
95
+ 'boarding_timestamp',
96
+ 'alighting_timestamp',
97
+ 'ridership_start_timestamp',
98
+ 'ridership_end_timestamp',
99
+ ];
100
+
101
+ // If no routes have values for agency_id, add it to the excludeColumns list
102
+ if (model.filenameBase === 'routes') {
103
+ const routesWithAgencyId = db
104
+ .prepare('SELECT agency_id FROM routes WHERE agency_id IS NOT NULL;')
105
+ .all();
106
+ if (!routesWithAgencyId || routesWithAgencyId.length === 0) {
107
+ excludeColumns.push('agency_id');
108
+ }
102
109
  }
103
- }
104
110
 
105
- const columns = without(
106
- model.schema.map((column) => column.name),
107
- ...excludeColumns,
108
- );
109
- const fileText = await stringify(lines, { columns, header: true });
110
- await writeFile(filepath, fileText);
111
+ const columns = without(
112
+ model.schema.map((column) => column.name),
113
+ ...excludeColumns,
114
+ );
115
+ const fileText = await stringify(lines, { columns, header: true });
116
+ await writeFile(filePath, fileText);
117
+ } else if (model.filenameExtension === 'geojson') {
118
+ const fileText = lines?.[0].geojson ?? '';
119
+ await writeFile(filePath, fileText);
120
+ }
111
121
 
112
- log(`Exporting - ${model.filenameBase}.txt\r`);
122
+ log(`Exporting - ${model.filenameBase}.${model.filenameExtension}\r`);
113
123
 
114
- return `${model.filenameBase}.txt`;
124
+ return `${model.filenameBase}.${model.filenameExtension}`;
115
125
  });
116
126
 
117
127
  if (compact(exportedFiles).length === 0) {
@@ -9,6 +9,15 @@ import {
9
9
  } from 'lodash-es';
10
10
  import { feature, featureCollection } from '@turf/helpers';
11
11
 
12
+ export function isValidJSON(string) {
13
+ try {
14
+ JSON.parse(string);
15
+ } catch (error) {
16
+ return false;
17
+ }
18
+ return true;
19
+ }
20
+
12
21
  function isValidLineString(lineString) {
13
22
  if (!lineString) {
14
23
  return false;
@@ -0,0 +1,32 @@
1
+ import sqlString from 'sqlstring-sqlite';
2
+
3
+ import { openDb } from '../db.js';
4
+
5
+ import {
6
+ formatOrderByClause,
7
+ formatSelectClause,
8
+ formatWhereClauses,
9
+ } from '../utils.js';
10
+ import locations from '../../models/gtfs/locations.js';
11
+
12
+ /*
13
+ * Returns an array of all locations that match the query parameters.
14
+ */
15
+ export function getLocations(
16
+ query = {},
17
+ fields = [],
18
+ orderBy = [],
19
+ options = {},
20
+ ) {
21
+ const db = options.db ?? openDb();
22
+ const tableName = sqlString.escapeId(locations.filenameBase);
23
+ const selectClause = formatSelectClause(fields);
24
+ const whereClause = formatWhereClauses(query);
25
+ const orderByClause = formatOrderByClause(orderBy);
26
+
27
+ return db
28
+ .prepare(
29
+ `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`,
30
+ )
31
+ .all();
32
+ }
package/lib/gtfs.js CHANGED
@@ -22,6 +22,7 @@ import { getFrequencies } from './gtfs/frequencies.js';
22
22
  import { getLevels } from './gtfs/levels.js';
23
23
  import { getLocationGroups } from './gtfs/location-groups.js';
24
24
  import { getLocationGroupStops } from './gtfs/location-group-stops.js';
25
+ import { getLocations } from './gtfs/locations.js';
25
26
  import { getNetworks } from './gtfs/networks.js';
26
27
  import { getPathways } from './gtfs/pathways.js';
27
28
  import { getRouteNetworks } from './gtfs/route-networks.js';
@@ -131,6 +132,9 @@ export { _getLocationGroups as getLocationGroups };
131
132
  const _getLocationGroupStops = getLocationGroupStops;
132
133
  export { _getLocationGroupStops as getLocationGroupStops };
133
134
 
135
+ const _getLocations = getLocations;
136
+ export { _getLocations as getLocations };
137
+
134
138
  const _getNetworks = getNetworks;
135
139
  export { _getNetworks as getNetworks };
136
140
 
package/lib/import.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import path from 'node:path';
2
2
  import { createReadStream, existsSync, lstatSync } from 'node:fs';
3
- import { cp, readdir, rename, writeFile } from 'node:fs/promises';
3
+ import { cp, readdir, rename, readFile, writeFile } from 'node:fs/promises';
4
4
  import fetch from 'node-fetch';
5
5
  import { parse } from 'csv-parse';
6
6
  import pluralize from 'pluralize';
@@ -14,6 +14,7 @@ import sqlString from 'sqlstring-sqlite';
14
14
  import models from '../models/models.js';
15
15
  import { openDb } from './db.js';
16
16
  import { unzip } from './file-utils.js';
17
+ import { isValidJSON } from './geojson-utils.js';
17
18
  import {
18
19
  log as _log,
19
20
  logError as _logError,
@@ -445,7 +446,7 @@ const formatLine = (line, model, totalLineCount) => {
445
446
  formattedLine[columnSchema.name] === null
446
447
  ) {
447
448
  throw new Error(
448
- `Missing required value in ${model.filenameBase}.txt for ${columnSchema.name} on line ${lineNumber}.`,
449
+ `Missing required value in ${model.filenameBase}.${model.filenameExtension} for ${columnSchema.name} on line ${lineNumber}.`,
449
450
  );
450
451
  }
451
452
 
@@ -455,7 +456,7 @@ const formatLine = (line, model, totalLineCount) => {
455
456
  formattedLine[columnSchema.name] < columnSchema.min
456
457
  ) {
457
458
  throw new Error(
458
- `Invalid value in ${model.filenameBase}.txt for ${columnSchema.name} on line ${lineNumber}: below minimum value of ${columnSchema.min}.`,
459
+ `Invalid value in ${model.filenameBase}.${model.filenameExtension} for ${columnSchema.name} on line ${lineNumber}: below minimum value of ${columnSchema.min}.`,
459
460
  );
460
461
  }
461
462
 
@@ -465,7 +466,7 @@ const formatLine = (line, model, totalLineCount) => {
465
466
  formattedLine[columnSchema.name] > columnSchema.max
466
467
  ) {
467
468
  throw new Error(
468
- `Invalid value in ${model.filenameBase}.txt for ${columnSchema.name} on line ${lineNumber}: above maximum value of ${columnSchema.max}.`,
469
+ `Invalid value in ${model.filenameBase}.${model.filenameExtension} for ${columnSchema.name} on line ${lineNumber}: above maximum value of ${columnSchema.max}.`,
469
470
  );
470
471
  }
471
472
  }
@@ -539,12 +540,12 @@ const importLines = (task, lines, model, totalLineCount) => {
539
540
  if (error.code === 'SQLITE_CONSTRAINT_PRIMARYKEY') {
540
541
  const primaryColumns = model.schema.filter((column) => column.primary);
541
542
  task.warn(
542
- `Duplicate values for primary key (${primaryColumns.map((column) => column.name).join(', ')}) found in ${model.filenameBase}.txt. Set the \`ignoreDuplicates\` option to true in config.json to ignore this error`,
543
+ `Duplicate values for primary key (${primaryColumns.map((column) => column.name).join(', ')}) found in ${model.filenameBase}.${model.filenameExtension}. Set the \`ignoreDuplicates\` option to true in config.json to ignore this error`,
543
544
  );
544
545
  }
545
546
 
546
547
  task.warn(
547
- `Check ${model.filenameBase}.txt for invalid data between lines ${
548
+ `Check ${model.filenameBase}.${model.filenameExtension} for invalid data between lines ${
548
549
  totalLineCount - linesToImportCount
549
550
  } and ${totalLineCount}.`,
550
551
  );
@@ -552,7 +553,7 @@ const importLines = (task, lines, model, totalLineCount) => {
552
553
  }
553
554
 
554
555
  task.log(
555
- `Importing - ${model.filenameBase}.txt - ${totalLineCount} lines imported\r`,
556
+ `Importing - ${model.filenameBase}.${model.filenameExtension} - ${totalLineCount} lines imported\r`,
556
557
  true,
557
558
  );
558
559
  };
@@ -562,10 +563,16 @@ const importFiles = (task) =>
562
563
  models,
563
564
  (model) =>
564
565
  new Promise((resolve, reject) => {
566
+ const lines = [];
567
+ let totalLineCount = 0;
568
+ const maxInsertVariables = 32_000;
569
+
565
570
  // Loop through each GTFS file
566
571
  // Filter out excluded files from config
567
572
  if (task.exclude && task.exclude.includes(model.filenameBase)) {
568
- task.log(`Skipping - ${model.filenameBase}.txt\r`);
573
+ task.log(
574
+ `Skipping - ${model.filenameBase}.${model.filenameExtension}\r`,
575
+ );
569
576
  resolve();
570
577
  return;
571
578
  }
@@ -578,23 +585,43 @@ const importFiles = (task) =>
578
585
 
579
586
  const filepath = path.join(
580
587
  task.downloadDir,
581
- `${model.filenameBase}.txt`,
588
+ `${model.filenameBase}.${model.filenameExtension}`,
582
589
  );
583
590
 
584
591
  if (!existsSync(filepath)) {
592
+ // Log only missing standard GTFS files
585
593
  if (!model.nonstandard) {
586
- task.log(`Importing - ${model.filenameBase}.txt - No file found\r`);
594
+ task.log(
595
+ `Importing - ${model.filenameBase}.${model.filenameExtension} - No file found\r`,
596
+ );
587
597
  }
588
598
 
589
599
  resolve();
590
600
  return;
591
601
  }
592
602
 
593
- task.log(`Importing - ${model.filenameBase}.txt\r`);
603
+ task.log(
604
+ `Importing - ${model.filenameBase}.${model.filenameExtension}\r`,
605
+ );
606
+
607
+ // Handle geojson files
608
+ if (model.filenameExtension === 'geojson') {
609
+ readFile(filepath, 'utf8')
610
+ .then((data) => {
611
+ if (isValidJSON(data) === false) {
612
+ reject(
613
+ new Error(
614
+ `Invalid JSON in ${model.filenameBase}.${model.filenameExtension}`,
615
+ ),
616
+ );
617
+ }
618
+ const line = formatLine({ geojson: data }, model, totalLineCount);
619
+ importLines(task, [line], model, totalLineCount);
620
+ resolve();
621
+ })
622
+ .catch(reject);
623
+ }
594
624
 
595
- const lines = [];
596
- let totalLineCount = 0;
597
- const maxInsertVariables = 32_000;
598
625
  const parser = parse({
599
626
  columns: true,
600
627
  relax_quotes: true,
@@ -1,45 +1,46 @@
1
1
  const model = {
2
2
  filenameBase: 'agency',
3
+ filenameExtension: 'txt',
3
4
  schema: [
4
5
  {
5
6
  name: 'agency_id',
6
- type: 'varchar(255)',
7
+ type: 'text',
7
8
  primary: true,
8
9
  prefix: true,
9
10
  },
10
11
  {
11
12
  name: 'agency_name',
12
- type: 'varchar(255)',
13
+ type: 'text',
13
14
  required: true,
14
15
  nocase: true,
15
16
  },
16
17
  {
17
18
  name: 'agency_url',
18
- type: 'varchar(2047)',
19
+ type: 'text',
19
20
  required: true,
20
21
  },
21
22
  {
22
23
  name: 'agency_timezone',
23
- type: 'varchar(255)',
24
+ type: 'text',
24
25
  required: true,
25
26
  },
26
27
  {
27
28
  name: 'agency_lang',
28
- type: 'varchar(255)',
29
+ type: 'text',
29
30
  nocase: true,
30
31
  },
31
32
  {
32
33
  name: 'agency_phone',
33
- type: 'varchar(64)',
34
+ type: 'text',
34
35
  nocase: true,
35
36
  },
36
37
  {
37
38
  name: 'agency_fare_url',
38
- type: 'varchar(2047)',
39
+ type: 'text',
39
40
  },
40
41
  {
41
42
  name: 'agency_email',
42
- type: 'varchar(255)',
43
+ type: 'text',
43
44
  nocase: true,
44
45
  },
45
46
  ],
@@ -1,16 +1,17 @@
1
1
  const model = {
2
2
  filenameBase: 'areas',
3
+ filenameExtension: 'txt',
3
4
  schema: [
4
5
  {
5
6
  name: 'area_id',
6
- type: 'varchar(255)',
7
+ type: 'text',
7
8
  required: true,
8
9
  primary: true,
9
10
  prefix: true,
10
11
  },
11
12
  {
12
13
  name: 'area_name',
13
- type: 'varchar(255)',
14
+ type: 'text',
14
15
  },
15
16
  ],
16
17
  };
@@ -1,31 +1,32 @@
1
1
  const model = {
2
2
  filenameBase: 'attributions',
3
+ filenameExtension: 'txt',
3
4
  schema: [
4
5
  {
5
6
  name: 'attribution_id',
6
- type: 'varchar(255)',
7
+ type: 'text',
7
8
  primary: true,
8
9
  required: true,
9
10
  prefix: true,
10
11
  },
11
12
  {
12
13
  name: 'agency_id',
13
- type: 'varchar(255)',
14
+ type: 'text',
14
15
  prefix: true,
15
16
  },
16
17
  {
17
18
  name: 'route_id',
18
- type: 'varchar(255)',
19
+ type: 'text',
19
20
  prefix: true,
20
21
  },
21
22
  {
22
23
  name: 'trip_id',
23
- type: 'varchar(255)',
24
+ type: 'text',
24
25
  prefix: true,
25
26
  },
26
27
  {
27
28
  name: 'organization_name',
28
- type: 'varchar(255)',
29
+ type: 'text',
29
30
  required: true,
30
31
  nocase: true,
31
32
  },
@@ -49,16 +50,16 @@ const model = {
49
50
  },
50
51
  {
51
52
  name: 'attribution_url',
52
- type: 'varchar(2047)',
53
+ type: 'text',
53
54
  },
54
55
  {
55
56
  name: 'attribution_email',
56
- type: 'varchar(255)',
57
+ type: 'text',
57
58
  nocase: true,
58
59
  },
59
60
  {
60
61
  name: 'attribution_phone',
61
- type: 'varchar(255)',
62
+ type: 'text',
62
63
  nocase: true,
63
64
  },
64
65
  ],
@@ -1,9 +1,10 @@
1
1
  const model = {
2
2
  filenameBase: 'booking_rules',
3
+ filenameExtension: 'txt',
3
4
  schema: [
4
5
  {
5
6
  name: 'booking_rule_id',
6
- type: 'varchar(255)',
7
+ type: 'text',
7
8
  primary: true,
8
9
  prefix: true,
9
10
  },
@@ -31,7 +32,7 @@ const model = {
31
32
  },
32
33
  {
33
34
  name: 'prior_notice_last_time',
34
- type: 'varchar(255)',
35
+ type: 'text',
35
36
  },
36
37
  {
37
38
  name: 'prior_notice_last_timestamp',
@@ -45,7 +46,7 @@ const model = {
45
46
  },
46
47
  {
47
48
  name: 'prior_notice_start_time',
48
- type: 'varchar(255)',
49
+ type: 'text',
49
50
  },
50
51
  {
51
52
  name: 'prior_notice_start_timestamp',
@@ -54,36 +55,36 @@ const model = {
54
55
  },
55
56
  {
56
57
  name: 'prior_notice_service_id',
57
- type: 'varchar(255)',
58
+ type: 'text',
58
59
  prefix: true,
59
60
  },
60
61
  {
61
62
  name: 'message',
62
- type: 'varchar(2047)',
63
+ type: 'text',
63
64
  nocase: true,
64
65
  },
65
66
  {
66
67
  name: 'pickup_message',
67
- type: 'varchar(2047)',
68
+ type: 'text',
68
69
  nocase: true,
69
70
  },
70
71
  {
71
72
  name: 'drop_off_message',
72
- type: 'varchar(2047)',
73
+ type: 'text',
73
74
  nocase: true,
74
75
  },
75
76
  {
76
77
  name: 'phone_number',
77
- type: 'varchar(64)',
78
+ type: 'text',
78
79
  nocase: true,
79
80
  },
80
81
  {
81
82
  name: 'info_url',
82
- type: 'varchar(2047)',
83
+ type: 'text',
83
84
  },
84
85
  {
85
86
  name: 'booking_url',
86
- type: 'varchar(2047)',
87
+ type: 'text',
87
88
  },
88
89
  ],
89
90
  };
@@ -1,9 +1,10 @@
1
1
  const model = {
2
2
  filenameBase: 'calendar_dates',
3
+ filenameExtension: 'txt',
3
4
  schema: [
4
5
  {
5
6
  name: 'service_id',
6
- type: 'varchar(255)',
7
+ type: 'text',
7
8
  required: true,
8
9
  primary: true,
9
10
  prefix: true,
@@ -24,7 +25,7 @@ const model = {
24
25
  },
25
26
  {
26
27
  name: 'holiday_name',
27
- type: 'varchar(255)',
28
+ type: 'text',
28
29
  nocase: true,
29
30
  },
30
31
  ],
@@ -1,9 +1,10 @@
1
1
  const model = {
2
2
  filenameBase: 'calendar',
3
+ filenameExtension: 'txt',
3
4
  schema: [
4
5
  {
5
6
  name: 'service_id',
6
- type: 'varchar(255)',
7
+ type: 'text',
7
8
  required: true,
8
9
  primary: true,
9
10
  prefix: true,
@@ -1,9 +1,10 @@
1
1
  const model = {
2
2
  filenameBase: 'fare_attributes',
3
+ filenameExtension: 'txt',
3
4
  schema: [
4
5
  {
5
6
  name: 'fare_id',
6
- type: 'varchar(255)',
7
+ type: 'text',
7
8
  required: true,
8
9
  primary: true,
9
10
  prefix: true,
@@ -15,7 +16,7 @@ const model = {
15
16
  },
16
17
  {
17
18
  name: 'currency_type',
18
- type: 'varchar(255)',
19
+ type: 'text',
19
20
  required: true,
20
21
  },
21
22
  {
@@ -33,7 +34,7 @@ const model = {
33
34
  },
34
35
  {
35
36
  name: 'agency_id',
36
- type: 'varchar(255)',
37
+ type: 'text',
37
38
  prefix: true,
38
39
  },
39
40
  {