generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
Database Cleanup
MCatherine edited this page Sep 14, 2022
·
4 revisions
In the case need to remove duplicate fail records in the database for old growth CHEFS API version:
- Run the following query in the database in test deployment:
delete from public.email_submission_log OT
where email_submission_log_id not in
(
SELECT max(email_submission_log_id) as email_submission_log_id
FROM public.email_submission_log
where code = 'FAILED'
group by DATE(create_timestamp), form_id
ORDER BY MAX(email_submission_log_id)
)
and code = 'FAILED'
- Confirm the result in test
- Run the same query in the database in prod deployment
- Confirm the result
- Run the following command in the terminal
# login to the namespace.
oc project [namespace]
# port forward the pod
oc port-forward [postgres-db-pod] 4200:5432
- Open the PgAdmin on the local
- right click on servers -> porstgresSQL 14
- select properties -> click on connection tab
- update the port to be 4200, username to be nrog (the db username), click save
- refresh the database, and then quit and reopen the pgadmin, will be able to connect to the deployed database in openshift