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

Unable to modify store entity due to dependency on store entity prior to migration #5035

Closed
DanCRichards opened this issue Sep 15, 2020 · 1 comment

Comments

@DanCRichards
Copy link

DanCRichards commented Sep 15, 2020

More detailed explanation

During startup, the configuration requires access to the store entity.
If a user were to adjust the store entity a SQL Column not found error will be thrown. This occurs prior to the UpMigration specified within the StartEngine() method.

nopCommerce version:

4.3

Steps to reproduce the problem:

Using the update-existing-entity tutorial to update the store entity.

  1. Update nop.Core domain
  2. Update nop.Data builder
  3. Add nop.Data migration
  4. Add IMigrationManager.ApplyUpMigration code to ApplicationBuilderExtensions.StartEngine();

Within the DependencyRegistrar.BuildRegistration() there is a call to the store entity. Because the user is updating the store entity the system requires the column which is yet to be updated and a SQL error occurs.

How to solve:

  1. Change the tutorial so that the migration is done prior to store access.
  2. Add some form of checking to see if the store needs migration and do so.
  3. For users, add the lines required on StartEngine() to the BuildRegistration() method and incorporate the namespace as per Visual Studio.

For the future:

Are other entities accessed prior to the migration? - I see a lot of users having issues with not being able to update their entities.

@DanCRichards DanCRichards changed the title Unable to modify store entity as configuration prior to migration requires access to store entity. Throws SQL column missing error. Unable to modify store entity as per tutorial. Sep 15, 2020
@DanCRichards DanCRichards changed the title Unable to modify store entity as per tutorial. Unable to modify store entity due to dependency on store entity prior to migration Sep 15, 2020
@AndreiMaz AndreiMaz added this to the Version 4.40 milestone Oct 5, 2020
@RomanovM RomanovM assigned exileDev and unassigned skoshelev Nov 5, 2020
@AndreiMaz AndreiMaz modified the milestones: Version 4.40, Version 4.50 Feb 19, 2021
@RomanovM RomanovM modified the milestones: Version 4.50, Version 4.60 Oct 8, 2021
@AndreiMaz AndreiMaz modified the milestone: Version 4.60 Nov 12, 2021
exileDev added a commit that referenced this issue Aug 26, 2022
@exileDev
Copy link
Contributor

Closed #5035

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants