Documentation of removing data from DB
Keypoint in removing data from database from karrierdag pod.
Needed to be done before new event is planned or companies who participated last karrieredag
will not be able to register, as the company organization number is primary key in one table.
# Run command to delete content of `companies` table
# IP of client need to be added as trusted source in DigitalOcean webportal for database and `connection string` need to be found there as well.
$ psql -U karrieredag -h <connection-string> -p <port> -d karrieredag
karrieredag=> delete from companies;
# If running `psql` through pod
# kubectl --kubeconfig <kubeconfig.yaml> -n <namespace> exec -it <pod-name> -c db -- psql -U <db-user> <db-name> --command='delete from companies;'
# example:
# kubectl --kubeconfig ~/Dl/main-f137a4dad2ed7cab-kubeconfig.yaml -n karrieredag-52-review-test-bapqnk exec -it karrieredag-6c7b6df5cd-6b4xd -c db -- psql -U staging karrieredag-staging --command='delete from companies
# redo command for all tables in order from below.
Delete following tables in this order:
karrieredag=> delete from contact_persons;
DELETE 15
karrieredag=> delete from interviews ;
DELETE 0
karrieredag=> delete from presentations ;
DELETE 0
karrieredag=> delete from presenses ;
DELETE 10
karrieredag=> delete from participations ;
DELETE 11
karrieredag=> delete from companies ;
DELETE 15```