Skip to content

issue-cas-7746: extensions join table + vocabulary on Schemamapping#8032

Open
foozleface wants to merge 4 commits intoissue-7745from
issue-cas-7746
Open

issue-cas-7746: extensions join table + vocabulary on Schemamapping#8032
foozleface wants to merge 4 commits intoissue-7745from
issue-cas-7746

Conversation

@foozleface
Copy link
Copy Markdown
Collaborator

Summary

First in a 7-PR atomic stack implementing Cal Academy's DwC export work on top of @CarolineDenis's schema foundation (#7873, #7874, #7877).

This PR adds:

  • ExportDataSetExtension join table — links extension SchemaMappings to a parent ExportDataSet with sort order
  • vocabulary field on SchemaMapping — optional CharField(32) for tagging mappings to a controlled vocabulary

Migration specify.0048_extensions_and_vocabulary depends on 0047_spqueryfield_dwc_fields (Caroline's PR #7873).

Prerequisites

This PR is based on issue-7745 (PR #7877). The 09815b3268 commit visible in the diff is a rebased duplicate of #7873 (issue-7748); once #7873 lands, that commit folds into main on rebase.

Stack

Subsequent PRs in this stack (each rebased on its predecessor):

  1. issue-cas-7746 — extensions table + vocabulary (this PR)
  2. issue-cas-7737 — CacheTableMeta model + cache table infrastructure
  3. issue-cas-7714 — DwC schema terms vocabulary + permissions
  4. issue-cas-7709 — Schema Mapper UI shell + Schema Config DwC section
  5. issue-cas-7712 — Clone endpoint + list APIs + Export Packages tool shell
  6. issue-cas-7710 — Mapping UI features (NewMappingDialog, autoMap, toolbar)
  7. issue-cas-7733 — DwC export pipeline (DwCA, EML, GBIF, RSS, scheduling)

Each PR maps to a single Specify issue and was tested independently.

Test plan

  • Migrations apply cleanly on a fresh database
  • python manage.py test specifyweb.backend.export.tests.test_models — 8/8 passing
  • unique_together on (exportdataset, schemamapping) enforced
  • Cascade delete from ExportDataSet drops extension rows

Caroline Denis and others added 2 commits April 27, 2026 11:50
…pping

Adds the missing pieces for multi-mapping DwC archives:
- Exportdatasetextension model + table linking ExportDataSet to multiple
  Schemamappings (core + N extensions) with sort order
- vocabulary field on Schemamapping for vocab-locked mappings (e.g. dwc, ac)

Fixes #7746 (extensions join table). Vocabulary support is required by
the backend code for term/vocab validation; included here as a small
schema completion ahead of the backend PR.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 782671c5-4e1a-41de-8b93-da2477b78eef

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-cas-7746

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

… errors

Adding the new `extensions` one-to-many relationship to ExportDataset
in datamodel.py raised test_sqlalchemy_model_errors because the
SQLAlchemy auto-generated models don't carry that relationship. Add an
expected_errors entry for ExportDataset matching the codebase's existing
pattern for other tables with similar gaps (Collection, Discipline,
Division, etc.).
…eptions

The ExportDataSetExtension.exportDataSet relationship is skipped by the
SA model builder due to a casing mismatch (datamodel classname is
'ExportDataset' but referenced as 'ExportDataSet'), so it surfaces as a
'not_found' error. SchemaMapping has a known direction mismatch on its
query relationship (datamodel one-to-one vs SA many-to-one). Both follow
the codebase's existing pattern for tables with these gaps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📋Back Log

Development

Successfully merging this pull request may close these issues.

1 participant