Implement basic city portal logic (and severely deabstract)

- Create a podman compose for Postgres
- Implement types and tables for urban data
- No longer use a Cargo workspace as there's no point currently
- Create query functionality (not mutation yet)
This commit is contained in:
Zeph Levy 2025-11-28 22:33:07 +01:00
parent 69b06ec43b
commit e5ac7b13b7
14 changed files with 1704 additions and 150 deletions

20
db/init.sql Normal file
View file

@ -0,0 +1,20 @@
CREATE TABLE datasets (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
description TEXT
);
CREATE TABLE locations (
id SERIAL PRIMARY KEY,
name TEXT,
lat DOUBLE PRECISION NOT NULL,
lon DOUBLE PRECISION NOT NULL
);
CREATE TABLE records (
id SERIAL PRIMARY KEY,
dataset_id INTEGER NOT NULL REFERENCES datasets(id),
location_id INTEGER REFERENCES locations(id),
timestamp TIMESTAMPTZ NOT NULL,
data JSONB
);