Database's Data Model?

I often prefer the command line.

cd /var/discourse 
sudo ./launcher enter app

enter password, then
sudo -u postgres psql discourse

Then, being very careful I run queries like

SELECT table_name, table_type 
FROM INFORMATION_SCHEMA.TABLES 
WHERE table_catalog = 'discourse' 
AND table_schema = 'public'; 

* currently 138 rows

SELECT table_name, column_name, data_type, column_default, character_maximum_length 
FROM INFORMATION_SCHEMA.COLUMNS 
WHERE table_catalog = 'discourse' 
AND table_schema = 'public' 
ORDER BY table_name;

* currently 1258 rows, a good idea to have a WHERE table_name = '{{some table name here}}' or a LIMIT in that query.

2 Likes