Created two databases. One of them is debug, in it I create a table structure, write stored procedures and views, and also debug client applications on it. The second base is working. She works with ready-made client applications. Suppose I developed some new functionality: I wrote several stored procedures and made changes to the client application. How to transfer all DDL changes to the working base? Are there any automatic tools for this purpose? And in general, is such architecture correct in principle?

Used DBMS - PostgreSQL.

  • Is the database shared with some application or has several application clients? Usually use the mechanism of migrations, which allows you to reproduce the structure of the database at any time. - cheops
  • @cheops, there are several client applications. I read about migration now. - maestro

1 answer 1

One of the options for automating the process of transferring the database structure and storage is to use a version control system. There are specialized systems for databases like liquibase .

Similar issues have already been discussed, for example, here: dba.se , so

  • Unfortunately, liquibase does not unload functions. Now still try flyway. - maestro
  • It seems that I did not immediately understand the principle of such systems. It turns out that they cannot generate a script that translates a database from a previous state into a new one. It is required to independently write a sequence of such commit commits and impose them on the base using these systems. - maestro