Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: ADR for alembic migrations #56

Merged
merged 1 commit into from
Jul 5, 2023
Merged

docs: ADR for alembic migrations #56

merged 1 commit into from
Jul 5, 2023

Conversation

Ian2012
Copy link
Contributor

@Ian2012 Ian2012 commented Jul 5, 2023

Description

This PR adds documentation about the alembic migrations tool

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jul 5, 2023
@openedx-webhooks
Copy link

Thanks for the pull request, @Ian2012! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@Ian2012 Ian2012 force-pushed the cag/alembic-migrations branch 3 times, most recently from fb15024 to 78a3462 Compare July 5, 2023 13:15
Context
*******

Alembic is a migration tool for SQLAlchemy. It is used to manage the clickhouse database
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: ClickHouse

Alembic is a migration tool for SQLAlchemy. It is used to manage the clickhouse database
schema for the Aspects project.

Alembic has support for branching migrations and multiple databases, it creates a migrations
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add that it supports migration rollbacks too?

the order in which migrations were created and executed.
#. Migrations cannot be modified once they are released to production. If a migration
needs to be modified, a new migration should be created with a new sequential ID.
#. The alembic migrations table is highly couple with the xAPI database, for this the
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about adding different Alembic project for other databases (with their own co-located migrations table) like the event sink and vector?

nit: "highly couple" -> "highly coupled"
nit: "for this the" -> "for this reason the"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like it, it's better than my approach and would reflect the project's progress better

************

* Users should not run migrations manually. They should be run automatically by Tutor
when the LMS is started.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Maybe "when init is run, and at upgrade time"?

Rejected Alternatives
*********************

**Clickhouse SQL Alchemy Models**
Copy link
Contributor

Choose a reason for hiding this comment

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

We also rejected Django for this

@Ian2012
Copy link
Contributor Author

Ian2012 commented Jul 5, 2023

@bmtcril ready

Copy link
Contributor

@bmtcril bmtcril left a comment

Choose a reason for hiding this comment

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

Thanks!

@Ian2012 Ian2012 merged commit 4f3ab28 into main Jul 5, 2023
1 check passed
@Ian2012 Ian2012 deleted the cag/alembic-migrations branch July 5, 2023 14:50
@openedx-webhooks
Copy link

@Ian2012 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants