-
Notifications
You must be signed in to change notification settings - Fork 133
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
Replace legacy custom db migration system with alembic #639
base: master
Are you sure you want to change the base?
Conversation
app/settings.py
Outdated
@@ -18,7 +18,7 @@ | |||
DB_USER = os.environ["DB_USER"] | |||
DB_PASS = os.environ["DB_PASS"] | |||
DB_NAME = os.environ["DB_NAME"] | |||
DB_DSN = f"mysql://{DB_USER}:{DB_PASS}@{DB_HOST}:{DB_PORT}/{DB_NAME}" | |||
DB_DSN = f"mysql+pymysql://{DB_USER}:{DB_PASS}@{DB_HOST}:{DB_PORT}/{DB_NAME}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to undo this/move it to be alembic-specific; we want aiomysql at runtime
Diffs observed from generating the base schema
(This is basically the todo list for this pr) |
170f206
to
bf91e78
Compare
|
||
[formatter_generic] | ||
format = %(levelname)-5.5s [%(name)s] %(message)s | ||
datefmt = %H:%M:%S |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can set this up to just defer to logging.yaml
# hooks = black | ||
# black.type = console_scripts | ||
# black.entrypoint = black | ||
# black.options = -l 79 REVISION_SCRIPT_FILENAME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we could use pre-commit hooks here? We could probably call into quite a few of them directly if we really had to. Maybe we'll find it's not worth using this & pre-commit after the fact is ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: this is still missing the existing seed data, as well as a couple of the tables that already exist (we should really have a 1:1 representation of the existing db in this PR, so that it gives us the ability to use alembic to remove those existing parts of the schema in future PRs -- otherwise we'll have a desync between user's db states & where alembic thinks they are).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also now missing index from #642
a044f62
to
1bca9ce
Compare
this would be epic to get in |
Describe your changes
Related Issues / Projects
Checklist