Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cleanup script to readme #77

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
- DATABSE_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";
```
Loading