Skip to content

Add alembic database migrations#212

Merged
JWCook merged 11 commits intomainfrom
db-migrations
Feb 17, 2026
Merged

Add alembic database migrations#212
JWCook merged 11 commits intomainfrom
db-migrations

Conversation

@JWCook
Copy link
Member

@JWCook JWCook commented Feb 17, 2026

Closes #211

  • Set up database migrations with alembic
  • Split initial revision into multiple revisions based on commit history
  • Update revisions after initial state to not fail if columns already exist (to handle manually/partially updated dbs)
  • Add nox shortcut for alembic autogenerate
  • Include alembic revisions in PyPI package
  • Add migrate() function for other libraries/applications to use
    • Handle databases previously created without alembic
    • Stamp current alembic head revision in create_tables()
    • Handle alembic script location for both package and repo
  • Use prek instead of pre-commit in noxfile

@JWCook JWCook added this to the 0.8 milestone Feb 17, 2026
@JWCook JWCook added the db SQLite taxonomy + observation database label Feb 17, 2026
@JWCook JWCook merged commit 3d2a815 into main Feb 17, 2026
8 checks passed
@JWCook JWCook deleted the db-migrations branch February 17, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

db SQLite taxonomy + observation database

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add alembic database migrations

1 participant