DataMigration didn't work

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 years ago
I'm doing an upgrade from 4.40.0 to 4.40.3. For the first 2 versions, I've run the SQL scripts in the correct order as the changes from 4.40 to 4.40.2 get accomplished by the migrations now.

Although when starting the application I'm getting the internal error text and the following log:

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
      System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'ManuallyPriceRange'.
      Invalid column name 'PriceTo'.
      Invalid column name 'PriceFrom'.
      Invalid column name 'PriceRangeFiltering'.


I've found out that these columns get added in the last upgrade from 4.40.2 to 4.40.3 in the DataMigrations. How can I force the migration to run (again) or solve the problem that I don't have the last columns in my DB?
2 years ago
There are no migrations from 4.40 through to 4.40.3, only from 4.30 > 4.40.x

Also, not sure what you mean by ‘I ran the scripts’ as there are no upgrade scripts anymore for 4.30 > 4.40.x (or 4.40 > 4.40.x)?

If you’ve got access to the database, you could manually add those to the required tables.
2 years ago
My bad, I'm upgrading up to 4.4.40. I'll update my initial post!
Yes I've access, so I can add them myself. But did I do something wrong that these columns are missing?
2 years ago
What version  did you start with?  If prior to 4.30, then you need to run the SQL scripts up to 4.30.  After that, the migrations get applied.
2 years ago
I've started with 4.40.0. I did the upgrade scripts, and they went fine. The columns that I'm missing are added in the migrations, I've found them there in the code. So I'm searching how it comes that it didn't run or didn't run successful.
But if I don't find anything, I'll just make an SQL script myself with all the things that should happen with the migrations, since now I'm not sure what was executed and what did not.
2 years ago
confirm.
in my case
1 there was 4.4 (develop)
2 try to update up to current

Exception:
System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'ManuallyPriceRange'.
Invalid column name 'PriceTo'.
Invalid column name 'PriceFrom'.
Invalid column name 'PriceRangeFiltering'.
   at System.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__126_0(Task`1 result)
.....
2 years ago
it should help
1 look at table MigrationVersionInfo
https://pasteboard.co/JZKsaZA.png

2 stop site in IIS
3 delete all nopCommerce 4.40.4 and below
4 restart site
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.