DOCS: documenting and cleaning work from tonight

This commit is contained in:
abpwrs committed 2020-04-08 23:04:19 -05:00
1 parent b4f0997a1c
commit d5d9ba6482
12 files changed
+17 -16

No files matched your search

-1
View File
@@ -6,4 +6,3 @@ pgdata/
.gitsecret/keys/random_seed
!*.secret
db/backups/*.tar.gz
+1 -1
View File
@@ -1 +1 @@
db/backups/20200408.tar.gz:b4f973f283312971e9850e1b8cc58fcbdec518b76b6f7a52a5a3beb2fb45bdee
db/backups/20200408.sql.gz:b365bf5fc13dbbe26d93e88f6523451b092999edc2a3f0680482f3a7e7369468
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+13 -1
View File
@@ -1,5 +1,17 @@
# Database Management
How to load a backup into your postgres docker container
First, decrypt the pg_dump files.
```
git secret reveal
```
Second, restore the pg_dump into the container.
```bash
gunzip -c ./backups/version.sql.gz | docker exec -i hdhs_database_1 psql -U postgres -d app_db
```
## Running Notes
generate backups:
```bash
@@ -8,7 +20,7 @@ docker exec hdhs_database_1 pg_dump -U postgres app_db | gzip > backups/20200408
Enter database container
```bash
docker-compose -f dev-docker-compose.yml run database bash
docker-compose -f dev-docker-compose.yml run database bash
```
Enter DB inside container
+3
View File
@@ -0,0 +1,3 @@
*
!.gitignore
!*.secret
Binary file not shown.
Binary file not shown.
View File
Whitespace-only changes.
-13
View File
@@ -1,13 +0,0 @@
import pandas as pd
from fmp import FMP
fmp_model = FMP("20200303_chihaiti", "hjohnson", "hjohnson")
pk_visit_id = "pk_visit_id"
fk_clinic_id = "fk_clinic_id"
print(fmp_model.get_tablename_from_fieldname(pk_visit_id)) # expect this to be "visits"
print(
fmp_model.get_tablename_from_fieldname(fk_clinic_id)
) # expect this to be "clinics"