Skip to content

Add orcid_id column to User model + migration#38

Open
leotrs wants to merge 2 commits intomainfrom
prs-614.1
Open

Add orcid_id column to User model + migration#38
leotrs wants to merge 2 commits intomainfrom
prs-614.1

Conversation

@leotrs
Copy link
Copy Markdown
Contributor

@leotrs leotrs commented Mar 28, 2026

Summary

  • Adds orcid_id column (String(20), nullable, unique, indexed) to the users table
  • Format validation via @validates decorator and standalone validate_orcid_id() function (XXXX-XXXX-XXXX-XXXX, last char may be X checksum)
  • Alembic migration a1b2c3d4e5f6 adds the column with unique index
  • 14 unit tests covering validation, uniqueness constraints, NULL handling, and backward compatibility

Test plan

  • Unit tests for validate_orcid_id() pure function (8 tests)
  • Database tests for column behavior (6 tests): create with/without ORCID, uniqueness constraint, multiple NULLs, checksum X variant, invalid format rejection
  • CI runs full suite including migration on PostgreSQL

Closes prs-614.1

🤖 Generated with Claude Code

leotrs and others added 2 commits March 28, 2026 07:25
Adds nullable, unique, indexed orcid_id column (String(20)) to the users
table for ORCID iD storage. Includes format validation (XXXX-XXXX-XXXX-XXXX
with optional X checksum) via @validates decorator and standalone function.
14 tests covering validation, uniqueness, NULL handling, and backward compat.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The orcid_id migration shared revision ID a1b2c3d4e5f6 with the
slug/publication_year migration, causing 'Multiple head revisions'
error during CI. Assign unique revision ID 596bb368fc0d.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Deploy Preview

https://scroll-press-pr-38.fly.dev

This preview will be destroyed when the PR is closed.

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.

1 participant