Skip to content

Commit

Permalink
Add Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Peyton-McKee committed Jan 14, 2025
1 parent 3a43062 commit 702f823
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
13 changes: 13 additions & 0 deletions charybdis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Charybdis

To initialize the databases run `yarn database:setup`

You can also individually teardown and bringup the databases by running `yarn database:cloud:setup` or `yarn: database:local:setup` and `yarn database:cloud:teardown` or `yarn database:local:teardown`.

To teardown all the databases run `yarn database:teardown`

When updating the local database schema, *Delete the existing migrations files in local-prisma* and then run `yarn prisma:migrate:local:dev`. Ensure to name the file `init`. This will create the migration file, copy it to scylla and rerun the diesel migration onto the database to ensure consistency between the two projects.

When updating the cloud schema, only run `yarn prisma:migrate:cloud:dev` and name it appropriately to whatever changes were made. Ensure that when deploying migrations to the cloud you only run `yarn prisma:migrate:cloud`. You will also have to change the cloud database url in your .env file to point to the cloud database

To access the prisma client for each respective database ensure that you use the proper prisma client from the cloud-prisma and local-prisma prisma files respectively. AKA to access the cloud prisma ensure you are importing `prisma` from `cloud-prisma/prisma.ts`. To access local prisma ensure you are importing `prisma` from `local-prisma/prisma.ts`.
3 changes: 3 additions & 0 deletions charybdis/cloud-prisma/prisma.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { PrismaClient } from "./cloud-prisma-client";

export const prisma = new PrismaClient();
3 changes: 3 additions & 0 deletions charybdis/local-prisma/prisma.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { PrismaClient } from "./local-prisma-client";

export const prisma = new PrismaClient();

0 comments on commit 702f823

Please sign in to comment.