Skip to content

alembic migration for 3 new quality tables - #541

Merged
tombrooks248 merged 3 commits into
mainfrom
feat/alembic-for-quality-tables
Jul 20, 2026
Merged

alembic migration for 3 new quality tables#541
tombrooks248 merged 3 commits into
mainfrom
feat/alembic-for-quality-tables

Conversation

@tombrooks248

@tombrooks248 tombrooks248 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Adding 3 new tables to the postgres DB

  • provision_quality
  • dataset_quality
  • organisation_quality

Why

This is all part of the provision quality work, these database tables are required so that we can output the new data into the DB and be accessible to be exposed by the API as requested in the parent ticket.

Related Tickets & Documents

QA Instructions, Screenshots, Recordings

I have tested the migrations in a local postgres and upgrade and downgrade all ran without any errors.

Added/updated tests?

We encourage you to keep the code coverage percentage at 80% and above. Please refer to the Digital Land Testing Guidance for more information.

  • Yes
  • No, and this is why: don't really do tests for database migrations given they only run once.
  • I need help with writing tests

[optional] Are there any post deployment tasks we need to perform?

[optional] Are there any dependencies on other PRs or Work?

Summary by CodeRabbit

  • New Features
    • Added quality metrics for datasets, organisations, and dataset provisions.
    • Introduced tracking for entity totals, ownership, authoritative relationships, active resources, and quality scores.
    • Added database support for storing and querying these quality assessments.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2de09302-9f59-4406-9457-9fda118db477

📥 Commits

Reviewing files that changed from the base of the PR and between 73b2c08 and 35fa16f.

📒 Files selected for processing (1)
  • migrations/versions/befd8e0ddca9_add_provision_quality_tables.py

Walkthrough

Adds database migration and SQLAlchemy ORM mappings for provision, dataset, and organisation quality aggregation tables, including primary keys, quality metrics, and an organisation index.

Changes

Provision quality schema

Layer / File(s) Summary
Create and reverse quality tables
migrations/versions/befd8e0ddca9_add_provision_quality_tables.py
Adds an Alembic migration that creates and removes the three quality tables and the provision organisation index.
Map quality tables to ORM models
application/db/models.py
Adds ORM models for provision, dataset, and organisation quality records, with corresponding keys, metrics, scores, and index metadata. Reformats the SQLAlchemy import block.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the change: an Alembic migration adding three new quality tables.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/alembic-for-quality-tables

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tombrooks248
tombrooks248 marked this pull request as ready for review July 16, 2026 11:33

@eveleighoj eveleighoj 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.

need to ad the relevant ORM models

@tombrooks248
tombrooks248 merged commit 5efb201 into main Jul 20, 2026
3 checks passed
@tombrooks248
tombrooks248 deleted the feat/alembic-for-quality-tables branch July 20, 2026 13:03
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