Skip to content

Commit

Permalink
backup-container-readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjaytkbabu committed Jul 12, 2024
1 parent 022358e commit d786bf0
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions app/src/db/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,33 @@ See `user.ts` and `document.ts` for examples of the differences.

The `toPrismaModel` and `fromPrismaModel` functions are used to convert Prisma database models to application `src/types/` and vice versa. These functions should only ever be used in the application service layer.

## Update Backup Container
```txt
Change the version to the latest release in backup-postgres yaml and save:
https://console.apps.silver.devops.gov.bc.ca/k8s/ns/d9d78e-<env>/cronjobs/backup-postgres/yaml
```

## Recover Database

#### 1. Perform the following steps from [css-backup-container-wiki](https://github.com/bcgov/common-service-showcase/wiki/Database-Backup#backup-management)
```txt
Manual Run
Acquire Backup
Connect to Remote DB
Wipe Existing DB
```

#### 2. Restore database
```txt
run: gunzip <backup_file_name>
open up the sql file in VSCode and comment out the following lines:
– CREATE ROLE app;
– CREATE ROLE postgres;
– CREATE ROLE replication;
run: psql -h localhost -p 5432 -U postgres -d app -f <backup_file_name>.sql
```

## Future Considerations

Consider the use of namespaces/modules to wrap particular sections of the application. As more initiatives are added to the system there will be naming conflicts.

0 comments on commit d786bf0

Please sign in to comment.