You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Init migrations on new environments called environment1 and environment2 using content storage as a method to track migrations. You can use a source environment to duplicate from for both of the environments if you want.
Create a migration and apply it to environment1.
Run npx migrations content --verbose --diff --source-environment-id environment1 --dest-environment-id environment2
You should see an error like this one: Different migration states detected. environment1 (1682093148544) !== environment2 (-Infinity)
Explanation of the issue
While the ID of the migration in environment1 is accurate (1682093148544), the ID of the migration in environment2 isn't (-Infinity) and is the outcome of this line of code:
Since environment2 doesn't have any migration, doing Math.max() on it results in -Infinity. The command then compares -Infinity to 1682093148544, which doesn't make much sense.
Suggestions on how to solve the issue
If no migration is found in one of the environments, relay that information to the user and abort the process. The upside is that it helps make sense of the issue to the user. I'm not sure if there is a downside to this.
The text was updated successfully, but these errors were encountered:
Hey @yvesgurcan, i think it's a great idea to check if there are any versions available before doing Math.max(...) and show a more appropriate error message to the user :)
This issue is fairly similar to #52.
How to reproduce the bug
environment1
andenvironment2
using content storage as a method to track migrations. You can use a source environment to duplicate from for both of the environments if you want.environment1
.npx migrations content --verbose --diff --source-environment-id environment1 --dest-environment-id environment2
Different migration states detected. environment1 (1682093148544) !== environment2 (-Infinity)
Explanation of the issue
While the ID of the migration in
environment1
is accurate (1682093148544
), the ID of the migration inenvironment2
isn't (-Infinity
) and is the outcome of this line of code:contentful-migrations/lib/backend.js
Line 347 in bfdca95
Since
environment2
doesn't have any migration, doingMath.max()
on it results in-Infinity
. The command then compares-Infinity
to1682093148544
, which doesn't make much sense.Suggestions on how to solve the issue
The text was updated successfully, but these errors were encountered: