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

Make compared tables order idempotent #954

Merged
merged 1 commit into from
Apr 2, 2020
Merged

Conversation

julienfalque
Copy link
Contributor

Q A
Type improvement
BC Break no
Fixed issues -

This PR makes sure the schema generated from mapping (to be compared with the actual database) is always provided tables data in the same order.

This helps when you want to have only one migration per deployment: instead of creating several small migration versions, you create a single one that you remove and recreate each time you change the mapping. For some reasons I couldn't figure out, it happens that the order in which tables data are loaded can vary. In my case it was different from one developper setup to another (despite all using the same Docker setup). In such case, even adding a simple column can generate a completely different migration, which makes it hard to read in VCS history and code reviews.

@goetas goetas added this to the 2.3.0 milestone Apr 2, 2020
@goetas goetas changed the base branch from 2.2.x to 2.3.x April 2, 2020 08:11
@goetas goetas self-assigned this Apr 2, 2020
@goetas
Copy link
Member

goetas commented Apr 2, 2020

Travis build was successful (see https://travis-ci.org/github/doctrine/migrations/builds/669306030).

@goetas
Copy link
Member

goetas commented Apr 2, 2020

@julienfalque can you please rebase ? (to trigger a new build... i think that travis had some issues...)

@julienfalque
Copy link
Contributor Author

Sure :)

@goetas goetas merged commit fb8340f into doctrine:2.3.x Apr 2, 2020
@goetas
Copy link
Member

goetas commented Apr 2, 2020

Thank you!

@julienfalque
Copy link
Contributor Author

Thank you @goetas, @greg0ire and @alcaeus!

@julienfalque julienfalque deleted the sort branch April 2, 2020 13:40
goetas added a commit that referenced this pull request Nov 22, 2020
- Total issues resolved: **0**
- Total pull requests resolved: **6**
- Total contributors: **6**

 - [1032: Let composer decide the best version](#1032) thanks to @PowerKiKi

 - [1020: Add badges into README about license and packagist](#1020) thanks to @matks
 - [999: Allow using on PHP 7.1 with Composer 2](#999) thanks to @nicolas-grekas

 - [981: Add "from-empty-schema" option for "diff" command](#981) thanks to @guilliamxavier
 - [954: Make compared tables order idempotent](#954) thanks to @julienfalque

 - [888: Use executeUpdate instead of executeQuery for write operation](#888) thanks to @goetas
goetas added a commit that referenced this pull request Nov 22, 2020
- Total issues resolved: **0**
- Total pull requests resolved: **6**
- Total contributors: **6**

 - [1032: Let composer decide the best version](#1032) thanks to @PowerKiKi

 - [1020: Add badges into README about license and packagist](#1020) thanks to @matks
 - [999: Allow using on PHP 7.1 with Composer 2](#999) thanks to @nicolas-grekas

 - [981: Add "from-empty-schema" option for "diff" command](#981) thanks to @guilliamxavier
 - [954: Make compared tables order idempotent](#954) thanks to @julienfalque

 - [888: Use executeUpdate instead of executeQuery for write operation](#888) thanks to @goetas
goetas added a commit that referenced this pull request Nov 22, 2020
- Total issues resolved: **0**
- Total pull requests resolved: **6**
- Total contributors: **6**

 - [1032: Let composer decide the best version](#1032) thanks to @PowerKiKi

 - [1020: Add badges into README about license and packagist](#1020) thanks to @matks
 - [999: Allow using on PHP 7.1 with Composer 2](#999) thanks to @nicolas-grekas

 - [981: Add "from-empty-schema" option for "diff" command](#981) thanks to @guilliamxavier
 - [954: Make compared tables order idempotent](#954) thanks to @julienfalque

 - [888: Use executeUpdate instead of executeQuery for write operation](#888) thanks to @goetas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants