-
Notifications
You must be signed in to change notification settings - Fork 449
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
Dev: Add initial migration and Running migration instruction to README #1133
base: develop
Are you sure you want to change the base?
Conversation
21ec10c
to
0906f8c
Compare
Codecov Report
@@ Coverage Diff @@
## develop #1133 +/- ##
========================================
Coverage 92.95% 92.95%
========================================
Files 38 38
Lines 2073 2073
========================================
Hits 1927 1927
Misses 146 146
|
Update README update readme apply black fix typo include altering existing column
@isabelcosta, @epicadk, @vj-codes, this PR is now ready for a review. Look forward to your feedback 😉. |
``` | ||
where `<message>` is a clear message what the change was about. This will be your alembic version title. | ||
You should see the new version inside the `versions` folder | ||
3. run the following command to apply the update to your local db |
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.
3. run the following command to apply the update to your local db | |
4. run the following command to apply the update to your local db |
careful with spaces between lines, not sure this will render the way you are thinking. I viewed the source and this number does not show up
@@ -25,7 +25,7 @@ | |||
|
|||
config.set_main_option( | |||
"sqlalchemy.url", | |||
current_app.config.get("SQLALCHEMY_DATABASE_URI").replace("%", "%%"), | |||
str(current_app.extensions["migrate"].db.engine.url).replace("%", "%%"), |
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.
why this change @mtreacy002 ? just asking because at the moment this came to the project, I thought it was kind of auto-generated code 🤔 but i am not sure
Description
Initiate migration script and add running migration script to README
Fixes #996
Type of Change:
Code/Quality Assurance Only
How Has This Been Tested?
Confirmed that alembic version was added to the local db and the initial version was created under
migrations > versions
folderbefore running initial migration
after running initial migration
The local db will be updated one version at a time accordingly
from initial to second revision
from second to third revision
Example case: User table
Changes:
name
tofull_name
IMPORTANT Noticed that the auto-generated alembic script IS NOT CORRECT!!.
You MUST MODIFY the script to reflect the intended schema changes. Once you're done, you can run
flask db upgrade
before alteration
After alteration (with data successfully preserved)
Checklist:
Code/Quality Assurance Only
ADDITIONAL NOTE
NA