-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fixes #69 - Create migration scripts for DB [WIP] #130
base: master
Are you sure you want to change the base?
Conversation
Ooops. Right, tests are failing because I didn't update |
we should try to make things consistent indeed. Then we could block the export to heroku (so dev configs/env are only locals).
for the best of my knowledge this is not possible. There is no filesystem on heroku. The migrations always happen locally on the person computer doing the DB update. Then the modifications are committed and deployed on heroku.
flask db init # locally
flask db migrate # locally
# Commit the results in the github repo
heroku run flask db upgrade Which ever we do, part of this pull request should contain a thorough documentation of the step by step instructions to migrate the DB. 🙏 Thanks a lot for everything you do/have done to make this project a breeze. |
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.
So this is a simple comment, no merge :)
app.register_blueprint(web_blueprint) | ||
# Views for API clients | ||
from ochazuke.api import api_blueprint | ||
app.register_blueprint(api_blueprint, url_prefix='/data') | ||
|
||
app.register_blueprint(api_blueprint, url_prefix="/data") |
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.
The spaces on the 7 lines above seems to be not logical now.
What about?
# Web views for humans
from ochazuke.web import web_blueprint
app.register_blueprint(web_blueprint)
# Views for API clients
from ochazuke.api import api_blueprint
app.register_blueprint(api_blueprint, url_prefix='/data')
or was it the result of black?
then maybe.
from ochazuke.web import web_blueprint
from ochazuke.api import api_blueprint
# Web views for humans
app.register_blueprint(web_blueprint)
# Views for API clients
app.register_blueprint(api_blueprint, url_prefix='/data')
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.
That is weird. I hadn't noticed, but I think that is indeed some strange Black formatting, yes. I'll see what I can do to make it happy without the extra weirdness.
Yes, the modifications are done locally, but the files generated in the |
I will look into |
This works locally to generate scripts, but I need to change the "development" config before we merge and I run everything again locally and then on Heroku to add the
migrations
dir, so we either need this to:FLASK_ENV
(or whatever we want to call this)or
Which brings me to a question about the current
config.py
file and how it's being used, because it seems inconsistent to me. This could be me missing something, but it looks like:we're using exporting
FLASK_ENV
for dev setup:webcompat-metrics-server/config.py
Line 24 in 6364805
hardcoding a
production
config for Heroku:webcompat-metrics-server/Procfile
Line 1 in 6364805
hardcoding a
production
config for the Scheduler scripts:webcompat-metrics-server/bin/daily_total.py
Line 71 in 6364805
setting a
FLASK_CONFIG
totesting
on CircleCI:webcompat-metrics-server/.circleci/config.yml
Line 13 in 6364805
Should we consider using
FLASK_ENV
orFLASK_CONFIG
consistently across all these instances, @karlcow? Or is there a reason this is safer/better/necessary?