Repository navigation
Add Metadata to more models - #4898
Conversation
Extend for PO, SO
|
I'm not sure if the 0.11.3 milestone is correct here as this is getting merged in master? Also it probably makes sense to not backport this change as this is no bugfix. |
|
There is a small bugfix in there - and the rest is not really new, just an extension of existing functionality to more models |
|
Update: this test runs without problems if I run only the Class on it's own.. |
|
An explanation: I have changed the failing tests to get the first/last contact item from the database, then use that PK in the API tests. Now it works (at least on my dev machine). |
OK, see: #4947 Assuming the test passes, this is ready for review/merge. |
|
@miggland there was a new migration upstream |
|
@miggland thanks for the additions :) |
|
@miggland OK I can see what happened here:
In systems where old 0012 had already been run, the new fields had been applied to the partparameter model. Basically, if you have to mess around with the order of migrations, you should never change one which has already been run! I should have checked this more carefully before merging in. The CI checks passed because they operate on a clean database, and the tables here had not already been created. I'll make a PR to address this. |
- Order of migrations had been changed - Resulted in conflicting database state - Never ever do this! - Ref: inventree#4898
|
Bottom line, we should never adjust the ordering of previously applied migrations - any new migrations should be applied after old ones. If there are ever conflicts of migrations this needs to be carefully checked (I dropped the ball on this one!) |
|
I also didn't notice. Is this something we could check for in CI? |
|
Sorry about that. I have no problem with your explanation, and that wasn't what I intended to do either, but I must have messed up and moved the wrong one. Classical case of wanting to get things finished and not checking properly. Being more aware of the problem helps though - I'll be more careful in future. |
|
@matmair unsure. The issue is subtle:
To test this in CI, maybe we maintain an active database, separate from the repo (or in a separate branch), and the data migrations have to successfully apply to that database, in addition to an empty database (which is the current check).
This is probably the closest we can replicate an "active" database in CI |
- Order of migrations had been changed - Resulted in conflicting database state - Never ever do this! - Ref: #4898


Closes #4202
Adds metadata to:
Contains one bug fix
Todo: