Page 1 of 1

Update Database from Model not working

Posted: Mon 14 Aug 2017 15:51
by ryanmvsg
I'm having some issues trying to get the database updated based on the model file. It successfully detects that a bunch of views need to be added to a schema, but then I click next and it says that no changes need to be made... can anyone help me out with this?

Currently the model validates with no warnings or errors if that provides any useful information. I'm having issues with the "Update To Database Wizard" and "Generate Database Script Wizard".

Re: Update Database from Model not working

Posted: Mon 14 Aug 2017 18:54
by ryanmvsg
One other note, it seems to only be adding the tables, but it ignores all of the views that were supposed to be added (that the previous screen in the wizard detected as missing, so I don't know why the very next screen would say no changes need to be made).

Re: Update Database from Model not working

Posted: Wed 16 Aug 2017 15:52
by Shalex
That is a designed behavior for storage entity with Type=View because that is a readonly model object with unknown database objects referenced by the database VIEW in its SELECT.

* In case of Type=Table, Entity Developer reads metadata of the table from system tables in database, so the tool knows types of table columns, existing constraints.

* In case of Type=View, Entity Developer constructs entity basing on the result set returned by a database view, and the tool shouldn't modify the database view if the corresponding entity in the model is changed. For example: you changed the column type in the SSDL entity with Type=View in your model, what has Entity Developer to do with a database view via Update To Database (or Generate Database Script) wizards?