Skip to content

fix: DB Migrations #6590

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

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

iamareebjamal
Copy link
Member

Fixes #6516

Many migrations were re-added maybe due to not being applied to production DB. This should never have been done. This creates a problem for new DB migrations as they fail. This creates a schema difference in production and development DB. This PR fixes old migrations. This is one way to deal with the discrepancy.

To be discussed if this is the best way

@codecov
Copy link

codecov bot commented Nov 12, 2019

Codecov Report

Merging #6590 into development will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##           development    #6590   +/-   ##
============================================
  Coverage        65.02%   65.02%           
============================================
  Files              296      296           
  Lines            15247    15247           
============================================
  Hits              9915     9915           
  Misses            5332     5332

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f48b2bc...5442295. Read the comment docs.

@prateekj117
Copy link
Member

@iamareebjamal WOW !!! I can only think about the amount of debugging required here. All the best !!!

@prateekj117
Copy link
Member

@iamareebjamal Just a thought. How about we write an automated script which arranges the revision and down_revision of every migration according to the time they were committed on GitHub.

@iamareebjamal
Copy link
Member Author

Good idea, but it'll also ruin the git blame. We can do that using the dates written inside the migration files as well, to see when were they created, however it won't be accurate depiction of in what order they were applied in, but still help

@prateekj117
Copy link
Member

@iamareebjamal Will start working on the script.

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.

Discrepancy between migrations and production DB
2 participants