Skip to content

docs: DB migration docs#222

Merged
betodealmeida merged 2 commits intomainfrom
migration_docs
Oct 13, 2022
Merged

docs: DB migration docs#222
betodealmeida merged 2 commits intomainfrom
migration_docs

Conversation

@betodealmeida
Copy link
Member

Summary

This PR adds documentation on how to create new DB migrations.

I also created a new migration (following the process outlined in the docs) to update the DB schema to the DJ models, after upgrading sqlmodel in #220.

Test Plan

Deployment Plan

Needs a DB migration.

@betodealmeida betodealmeida linked an issue Oct 13, 2022 that may be closed by this pull request
@betodealmeida betodealmeida added the documentation Improvements or additions to documentation label Oct 13, 2022
Copy link
Member

@agorajek agorajek left a comment

Choose a reason for hiding this comment

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

One nit and one question in-line. Thanks @betodealmeida this PR will be very helpful for me.

CONTRIBUTING.rst Outdated
Database migrations
===================

We use `Alembic <https://alembic.sqlalchemy.org/en/latest/index.html>`_ to manage schema migrations. If a PR introduces new models are changes existing ones a migration must be created.
Copy link
Member

Choose a reason for hiding this comment

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

s/are/or

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, thanks!

@@ -0,0 +1,203 @@
"""Update schema types
Copy link
Member

Choose a reason for hiding this comment

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

What's the goal of this update?

Copy link
Member Author

Choose a reason for hiding this comment

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

I just ran alembic revision --autogenerate without any changes to the model. All the changes you see here are because of the upgrade in sqlmodel. This way, when we add a new migration (and I'm planning to because of #193) we'll see only relevant changes.

@betodealmeida betodealmeida merged commit 549ff89 into main Oct 13, 2022
@samredai samredai deleted the migration_docs branch May 5, 2023 15:32
youngman-droid pushed a commit to youngman-droid/dj that referenced this pull request Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DB migration docs

2 participants