Closed dthomas26 closed 3 years ago
That is correct. The persistence component doesn't have logic to analyze statements and decide which one shall be executed or how it shall be altered. It simply uses the presence of the table as an indicator to create an initial set of objects. Altering an existing database is a whole different story. It is a non-trivial task and sometimes it may take hours to convert objects in a large production database. So, the recommended way is to deal with altering the database separately and before launching a microservice.
I am noticing if I create a table using something like this
and now if I start the service table get's created. Now, I am adding an additional constraint or index to the table using EnsureSchema and re-run the microservice it never get's executed. Is this behaviour expected? Any changes to the table schema wrt to constraint/index's can-not be added after the first execution?