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

disable migrations config #14593

Merged
merged 2 commits into from Dec 28, 2022
Merged

disable migrations config #14593

merged 2 commits into from Dec 28, 2022

Conversation

gary-alway
Copy link
Contributor

@gary-alway gary-alway commented Oct 10, 2022

What does it do?

  • Disable migrations given the runMigrations settings key
  • Defaults to true if not present

Why is it needed?

Model migrations mean that old migrations might not be compatible with the current schema which makes local development fail for fresh dbs.

How to test it?

Passing runMigrations = false will prevent any migration scripts from running, by default migrations remain enabled.

Related issue(s)/PR(s)

strapi/documentation#1353

@strapi-cla
Copy link

strapi-cla commented Oct 10, 2022

CLA assistant check
All committers have signed the CLA.

@Convly Convly added source: core:database Source is core/database package pr: enhancement This PR adds or updates some part of the codebase or features labels Oct 17, 2022
@gary-alway
Copy link
Contributor Author

@alexandrebodin any news on this PR please ?

@alexandrebodin
Copy link
Member

I wasn't added as reviewer so didn't see this PR.

@codecov
Copy link

codecov bot commented Dec 12, 2022

Codecov Report

Base: 60.49% // Head: 60.49% // No change to project coverage 👍

Coverage data is based on head (e912c0a) compared to base (3446db4).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #14593   +/-   ##
=======================================
  Coverage   60.49%   60.49%           
=======================================
  Files        1352     1352           
  Lines       33179    33179           
  Branches     6339     6340    +1     
=======================================
  Hits        20070    20070           
+ Misses      11274    11273    -1     
- Partials     1835     1836    +1     
Flag Coverage Δ
back 50.33% <0.00%> (ø)
front 65.05% <ø> (ø)
unit_back 50.33% <0.00%> (ø)
unit_front 65.05% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/core/database/lib/index.js 29.26% <ø> (ø)
packages/core/database/lib/migrations/index.js 30.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@alexandrebodin alexandrebodin left a comment

Choose a reason for hiding this comment

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

Ok so general thought about the config name. we like to make the naming more declarative instead of enableX disableX, what do you think of runMigrations: true|false ?

@alexandrebodin
Copy link
Member

Hey I'm seeing the CLA-sign not very happy probably because you used 2 different users to commit can you check that please :)

@alexandrebodin alexandrebodin added the flag: documentation This PR requires a documentation update label Dec 13, 2022
@pwizla
Copy link
Contributor

pwizla commented Dec 16, 2022

Hi! I'm Pierre, a technical writer at Strapi. Thank you for the contribution, @gary-alway!
This PR would require a small documentation update, thus creating a PR for Strapi's documentation repo. If I understand correctly, we'd need to add a line to the table in this section to describe the runMigration parameter.

Would you like to do it yourself, or would you rather have me handle it? 🙂

@gary-alway
Copy link
Contributor Author

gary-alway commented Dec 16, 2022

thanks @pwizla, I will have a go at updating the docs

@pwizla
Copy link
Contributor

pwizla commented Dec 20, 2022

Hi! The related documentation PR is approved. Just waiting for this PR to be merged in strapi/strapi before merging the docs one :)

@gary-alway
Copy link
Contributor Author

thanks @pwizla, @alexandrebodin 🚀
keep up the great work on Strapi, its a pleasure to work with

@Convly Convly removed the flag: documentation This PR requires a documentation update label Dec 28, 2022
@Convly Convly merged commit 29e6833 into strapi:main Dec 28, 2022
@Convly Convly added this to the 4.5.5 milestone Dec 28, 2022
@gary-alway gary-alway deleted the disable-migrations-config branch December 29, 2022 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: enhancement This PR adds or updates some part of the codebase or features source: core:database Source is core/database package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants