You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-31Lines changed: 8 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -534,42 +534,17 @@ creates the source MSSQL database (_docker/mssql_init/populate.sql_) was changed
534
534
535
535
---
536
536
537
-
## Jore3 stop import script
537
+
## Jore 3 stop import script
538
538
539
539
### Requirements
540
540
541
-
You need to have Python 3 installed on your system to run the script
542
-
543
-
#### Virtual environment
544
-
545
-
To run Python scripts with required libraries you should setup a virtual environment which contains the requirements for the script. To setup an environment, run:
546
-
547
-
`python3 -m venv LOCATION/OF/ENVIRONMENT/HERE`
548
-
549
-
Where you should replace the location with one you want to use. For example a directory under your home directory.
550
-
To use the environment you can either source the virtual environment by running:
Which allows you to use the binaries directly as `python importer.py`
555
-
556
-
Or you can use the virtual environment python directly: `LOCATION/OF/ENVIRONMENT/HERE/bin/python importer.py`
557
-
558
-
#### Script setup
559
-
560
-
You need to run the `import.py` script using Python 3 and it requires the following libraries:
561
-
562
-
- pymssql
563
-
- requests
564
-
- simplejson
565
-
566
-
They can be installed by running `pip install -r requirements.txt`
541
+
You need to have Docker installed on your system to run the script
567
542
568
543
### How to use
569
544
570
-
To run the stop registry importer script you need to have a Jore3 database, a populated Jore4 routes database, Jore4 Hasura and Jore4 Tiamat running.
545
+
To run the stop registry importer script you need to have a Jore 3 database, a populated Jore 4 routes database and the `jore4-hasura` and `jore4-tiamat` microservices running.
571
546
572
-
By default the script runs from the local jore3 test database and uses the base local Jore4 Hasura instance as the target.
547
+
By default the script runs from the local Jore 3 `mssqltestdb` database and uses the base local `jore4-hasura` service as the target.
573
548
You can change the source database and target Hasura instance by creating a `.env` file in the same directory as the script.
574
549
575
550
Set the values for variables you want to set:
@@ -583,6 +558,8 @@ JORE3_DATABASE_URL=
583
558
JORE3_DATABASE_NAME=
584
559
```
585
560
586
-
You should have run the base Jore3 importer first which ensures the Jore4 database has the required scheduled stop points. Then run the stop registry import script which will match scheduled stop points in the Jore4 routes database with stops in the Jore3 database and generate GraphQL mutations to Hasura/Tiamat according to the data. The script will also link the generated stop registry stops with the scheduled stop points by their NeTEx ID using Hasura for the mutation.
561
+
You should have run the base Jore 3 importer first which ensures the Jore 4 database has the required scheduled stop points. Then run the stop registry import script which will match scheduled stop points in the Jore 4 routes database with stops in the Jore 3 database and generate GraphQL mutations to Hasura/Tiamat according to the data. The script will also link the generated stop registry stops with the scheduled stop points by their NeTEx ID using Hasura for the mutation.
562
+
563
+
Running the script will produce multiple errors as there are many stops in the Jore 3 database with overlapping validity. These can be ingored as only the most recent one is the one which ends up being imported.
587
564
588
-
Running the script will produce multiple errors as there are many stops in the Jore3 database with overlapping validity. These can be ingored as only the most recent one is the one which ends up being imported.
565
+
To run the script simply run `run-stop-registry-importer.sh` in the stop-registry-importer directory, this will create and run a Docker container with the environment set up.
0 commit comments