This file contains some extra topics that are helpful for development.
Juxtaposition currently uses two databases: postgresql (with prisma) and mongodb (with mongoose). Mongodb is being phased out and replaced with postgresql.
Here are some situations which require extra steps to work with the databases, run all steps.
Before starting the app:
mongodb: No steps requiredpostgresql: Deploy the new migrations usingnpm run migration:deploy
Changing database models:
mongodb: Automatic, no manual steps neededpostgresql: Create a migration usingnpm run migration:createand deploy it usingnpm run migration:deploy
Creating a data migration:
mongodb: Add a mongosh script to/migrationspostgresql: Create a blank migration usingnpm run migration:createand fill it with your SQL script to do a data migration- Cross-db data migrations: Create a NodeJS script in
/migrationsand give it a package.json for it's dependencies.