Skip to content

Commit

Permalink
Fix migration errors
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudroy97 committed Jan 5, 2022
1 parent 43d0993 commit 20f9401
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
9 changes: 1 addition & 8 deletions src/Apps/StatCan.OrchardCore.Candev/Indexes/Migrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public int Create()
CreateCandevUsersIndex();
CreateHackathonAvgScoresIndex();

return 3;
return 2;
}

private void CreateCandevItemsIndex()
Expand Down Expand Up @@ -107,12 +107,5 @@ public int UpdateFrom1()

return 2;
}

public int UpdateFrom2()
{
CreateHackathonAvgScoresIndex();

return 3;
}
}
}
22 changes: 2 additions & 20 deletions src/Apps/StatCan.OrchardCore.Candev/Migrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public async Task<int> CreateAsync()
await _recipeMigrator.ExecuteAsync("roles.recipe.json", this);
await _recipeMigrator.ExecuteAsync("role-judge.recipe.json", this);

return 3;
return 2;
}

private void CreateHackathonCustomSetings()
Expand Down Expand Up @@ -602,24 +602,6 @@ public int UpdateFrom1()
)
);

_contentDefinitionManager.AlterPartDefinition("TeamCustomSettings", part => part
.WithField("IsFinalRound", field => field
.OfType("BooleanField")
.WithDisplayName("Is final round")
.WithEditor("Switch")
.WithPosition("0")
.WithSettings(new BooleanFieldSettings
{
Label = "True when it's the final round of judging",
})
)
);

return 2;
}

public int UpdateFrom3()
{
_contentDefinitionManager.AlterPartDefinition("JudgingCustomSettings", part => part
.WithField("IsFinalRound", field => field
.OfType("BooleanField")
Expand All @@ -633,7 +615,7 @@ public int UpdateFrom3()
)
);

return 4;
return 2;
}
}
}

0 comments on commit 20f9401

Please sign in to comment.