You will have 3 kinds of things in your database that you need to worry about.
1) A schema that can be defined in DDL. 2) Static or search data that can be defined in DML. 3) Dynamic (or user) data that can also be defined in DML.
Typically, the changes in (1) and (2) should simply be suitable for production with code on which they are mutually dependent. (3) it should never increase, but can be copied to the development environment if they are synchronized with the production environments of that time.
Of course, this is much more complicated. To get (1) up, you may need to convert exsiting schema / DDL to specific alter statements, and it may also require data processing if the data types or locations change. To get (2) up, synchronization with code assembly is required, which can be complicated in complex environments.
There are many tools, and if you need automation, you probably need advice from someone familiar with them.
I use a very simple schema, where all changes to the schema are reflected in the SQL build script, and also added to the SQL script changes, which include all the SQL needed to perform any necessary transformations. This works well for me, but my script is very simple (1 person, 1 server) and therefore is atypical.
However, the key to success is identifying the work required for change at the time the change is made. The naive way to simply change the development database and then perform the fix during deployment is a disaster.
source share