~ekez/negativefour

ref: a3ba218efef2773e5826b94d9ca3c096795b3ddc negativefour/docs/db.md -rw-r--r-- 1.2 KiB
a3ba218eZeke Medley Fix race condition between apache restart and status check 8 months ago

#Database Configuration

negativefour is backed by a postgres database.

#Creating a new database

On the machine running the database:

; sudo su postgres
; CREATE DATABASE negativefour_test WITH OWNER admin;

This creates a new databse called negativefour_test which can be accessed by the admin user. The "admin" user matches the name of the non root user which runs the application.

#Test and prod databses

negativefour_test is a testing databse. It accepts external connections with a password so it is suitable for "local" development use as there is only one of me.

negativefour is the real database. It does not accept external connections and can only be accessed from inside production infrastructure.

#Manually inspecting the database

The test database is accessible from anywhere with the following command:

psql -h testdb.negativefour.com -p 5432 -d negativefour_test -U admin -W

This will prompt for a password and the open an interactive postgres console. The password is stored in our password manager.

The production database can only be accessed from the machine serving webpages and can be accessed by running

psql negativefour