Schema update for Azure: column name does not exist

I have two databases: one on the local database and the same, but published on Azure.

For the local database, I made several changes: one, many relationships were added . Models are Device and DigitalSystem

 public class Device { [Key] public int DeviceID { get; set; } //FK public int DigitalSystemID { get; set; } [ForeignKey("DigitalSystemID")] public DigitalSystem DigitalSystems { get; set; } } public class DigitalSystem { [Key] public int DigitalSystemID { get; set; } public virtual ICollection<Device> Devices { get; set; } } 

In this case, the table inside the local database is updated and includes the DigitalSystemID field.

enter image description here

However, when I create a script and try to deploy the circuit, this error appears:

Error message:

enter image description here

Question:

I do not understand this error, since I believe that this column is declared. Can someone help me figure this out? How can I deploy this schema update to my Azure database?

Thanks in advance.

Update:

This is the structure of the Device table in Azure.

enter image description here

It does not have a DigitalSystemID column, but that is what I am trying to achieve by synchronizing Azure to look like localDB. Is this not done by updating the circuit?

This is the result of the Data Migration Assistant when I try to deploy the schema [Pay attention to 5 errors (I described one of them here)]:

enter image description here

Comparing the schema with Visual Studio:

I tried to compare the circuits to detect the differences. However, the comparison result shows that there are no differences , which does not make sense:

enter image description here

No differences found.

+5
source share
1 answer

Azure PaaS SQL DB has a certain limitation Use the Sql Migration Wizard to move tables with a schema. This tool will notify you if there are compatibility issues.

0
source

Source: https://habr.com/ru/post/1274042/


All Articles