Skip to content

Added new schema for dashboard#252

Merged
miguelgonrod merged 3 commits into
miguelgonrod/sqlfrom
miguelgonrod/schema
Jun 17, 2026
Merged

Added new schema for dashboard#252
miguelgonrod merged 3 commits into
miguelgonrod/sqlfrom
miguelgonrod/schema

Conversation

@miguelgonrod

Copy link
Copy Markdown
Contributor

Made with GPT-5 mini

Part of #249

Haven't tested yet, the purpose is to modify the schema to allow sql queries search for OS

Signed-off-by: miguelgonrod <miguelgonrod2004@gmail.com>
@miguelgonrod miguelgonrod self-assigned this Jun 10, 2026

@Crola1702 Crola1702 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed in a sync:

  1. Create the sql/migrations add the queries with a migration id prefix (e.g., 01_server_status_platforms.sql
  2. Add a README file in the new directory that shows the schema as today

Signed-off-by: miguelgonrod <miguelgonrod2004@gmail.com>
@miguelgonrod miguelgonrod marked this pull request as ready for review June 12, 2026 14:16
@miguelgonrod miguelgonrod requested a review from Crola1702 June 12, 2026 14:16

@Crola1702 Crola1702 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

A final comment before merging, lets use the prefixes: 01_., 02_, because that way we can organize 99 migration scripts and not only 10

Please before merging, paste the schema diff. I.e., The schema before applying the migrations vs the schema after applying the migrations. And the commands you used

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We already have this table. So this migration should be ALTER TABLE instead

-- dashboard queries do not need to parse job names repeatedly.

ALTER TABLE server_status ADD COLUMN platform_os TEXT;
ALTER TABLE server_status ADD COLUMN platform_arch TEXT;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ahhh here they are. Then, I think we can drop the 01_create_table

Signed-off-by: miguelgonrod <miguelgonrod2004@gmail.com>
@miguelgonrod miguelgonrod requested a review from Crola1702 June 16, 2026 16:22
@miguelgonrod

Copy link
Copy Markdown
Contributor Author

Pre-migration schema

The schema below is the shape used before the platform normalization migration. It is included here so the migration history is explicit and easy to audit.

CREATE TABLE IF NOT EXISTS server_status(
    job_name TEXT PRIMARY KEY NOT NULL,
    server_status TEXT,
    release TEXT,
    os_name TEXT,
    project TEXT,
    domain TEXT
);

Target schema

After the migration, server_status also stores normalized platform columns so downstream queries do not need to parse job_name repeatedly.

CREATE TABLE IF NOT EXISTS server_status(
    job_name TEXT PRIMARY KEY NOT NULL,
    server_status TEXT,
    release TEXT,
    os_name TEXT,
    platform_os TEXT,
    platform_arch TEXT,
    project TEXT,
    domain TEXT
);

@miguelgonrod miguelgonrod merged commit 1c97a9e into miguelgonrod/sql Jun 17, 2026
@miguelgonrod miguelgonrod deleted the miguelgonrod/schema branch June 17, 2026 14:20
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.

2 participants