Skip to content

Dev: Write up database core tables and schema - #6

Draft
naman0r wants to merge 8 commits into
mainfrom
3-db-schema
Draft

naman0r wants to merge 8 commits into
mainfrom
3-db-schema

Conversation

@naman0r

@naman0r naman0r commented Sep 24, 2026 •

Copy link
Copy Markdown

ℹ️ Issue

Closes #3

📝 Description

Work in progress. This PR will carry the reviewed database core tables and schema for BHO, based on the product spec and the example data (daily observation sheets, F-6, hourly precipitation, daily records, narratives).

The schema is being drafted in a shared doc for team review first; this PR will be updated once the tables are agreed on.

✔️ Verification

TBD

🏕️ (Optional) Future Work / Notes

Open questions for the team (location of the full 141-year daily archive, normals data, canonical units, trace/missing value handling) will be listed here once the doc is shared.

  • hourly_observations.mountainVis (column K, "Mnts VSBL", e.g. 1@1.5) stays text for now. Per the client, it is mountain number @ visibility on a 1-3 scale. Once the weather group sends which number is which mountain, split it into mountainId and mountainVisibility, with a mountains lookup table rather than an enum. Still unknown: whether one cell can list more than one mountain.

Entities and generated migration for users, imports, daily/hourly/scheduled
observations, daily records and audit log, plus docs/database-schema.md
mapping each column to its source cell in the example sheets.
Comment thread docs/database-schema.md Outdated

## imports

Source: the app, one row per uploaded spreadsheet.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add note that these are irrevocable/unmodifiable, logs

Comment thread docs/database-schema.md Outdated
Ryaken-Nakamoto and others added 4 commits September 28, 2026 19:50
Client confirmed more stations are coming, so stationId joins the keys of
the three daily tables now rather than in a later migration. Every row
comes from an upload, so importId is not null on observations and records.
Keying records by station now avoids changing their primary key later if
records become per-station. The hourly notes now say what column H's
fractions and column I's weather codes mean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dev : Write up database core tables and schema

2 participants