Skip to content

Commit

Permalink
Merge pull request #77 from tripleadev/add-cleanup-script
Browse files Browse the repository at this point in the history
Add cleanup script to readme
  • Loading branch information
AdamSiekierski authored Nov 15, 2024
2 parents b4e7249 + 9290899 commit 1c70e1a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The main concepts and features of the app were put toghether on this board: http
- [Environments](#environments)
- [Summary](#summary-1)
- [How do I deploy the app on my own?](#how-do-i-deploy-the-app-on-my-own)
- [Resetting the DB](#resetting-the-db)

## What's it made of?

Expand Down Expand Up @@ -120,3 +121,17 @@ If you want to deploy this app on your own (we are not planning on transfering o
- POSTGRES_URL: the connection string/url of the PostgreSQL database. You can also use the [Prisma Cloud Data Proxy](https://www.prisma.io/docs/concepts/components/prisma-data-platform). You can always inspire from the way [how we deployed the app](#deployment) 😄

Our suggestion for the simpliest and fastest deployment setup is just using Heroku for both deploying the App and Database, without having to worry about Prisma Cloud. But the limitation is a harder setup of multiple environments.

## Resetting the DB

Run the following queries on the database:
```sql
DELETE FROM "Letter";
DELETE FROM "Author";
DELETE FROM "Destination";

REFRESH MATERIALIZED VIEW "AnonymousLettersByDestination";
REFRESH MATERIALIZED VIEW "BasicStats";
REFRESH MATERIALIZED VIEW "LettersByClass";
REFRESH MATERIALIZED VIEW "LettersByDestination";
```

0 comments on commit 1c70e1a

Please sign in to comment.