Setup Microservice Databases
Microservices typically make use of a variety of database stores. The following command will create the required databases, migrate them to the latest state, and fill them with relevant data.
nx run-many --all --target=prisma-generate --parallel=1
nx run-many --all --target=prisma-migrate
nx run-many --all --target=prisma-seed
To ingest data from bigquery, you will need to start the ingest job. In one terminal, run:
nf start
In a separate terminal, run:
nx ingest api-languages
Once that has completed, run:
nx queue-ingest api-media
Common Issues
prisma-generate failing
If prisma-generate is failing, try running:
nx run-many -t prisma-reset --all
command failed because of mmdc
If prisma generate fails with a error message similar to the one below:
Command failed: "/workspaces/core/node_modules/-bin/mmdc" -i "/tmp/prisma-erd-q0 cpUx/prisma.mmd" -0 "/workspaces/core/apps/api-journeys/db/ERD.svg" -c"/tmp/pri
sma-erd-qOcpUx/config-json" -p"/tmp/prisma-erd-qOcpUx/puppeteerConfig-json"
It is related to prisma-erd-generator attempting to run. Under the hood, it uses puppeteer and chromium to execute. The error this command is experiencing could be related to chromium not being installed, installed incorrectly, or not having the proper permissions to execute.
Here are some steps you can follow to resolve the issue:
- run
sudo apt-get -y install chromium
- On Mac update Docker Desktop to at least 4.28.0
- rebuild your container using latest main