Bring Idea into Life with No Limits
Easily build modern web applications with highly flexible Visual Tools
Database Synchronization tool will help you to synchronize changes in metamodel with database state. You are also able to create all tables if the database is empty and to review all updates executed on a particular database.
Database Synchronization tool works with any number of connections that can be of different types of database:
From the image above you can see that system is not connected to the MS SQL Server database as the connection icon is grayed out:
The connected database is with connection icon in green color:
Connected database that is used as a current connection (this) for Codeless Platform:
Finally example of Master connection:
Master connection is a development connection that should always be in sync with metamodel. Other connections could be updated with the changes from development when you decide to update changes. Database Synchronization is tracking the changes for each connection individually. All updates executed on all connections are written in the master connection.
Note: You will be able to use Database Synchronization tools to update changes on some connections only if the Platform is currently connected to the Master database. If that is not the case then you will be able only to review the history of changes.
For each connection the tool is tracking the current state and offers exactly the actions you need in order to synchronize connection with the current state of the Models.
If the database is empty (the database does not have any tables) you can generate and execute DDL create statements for the selected type of database.
Creating tables for an empty database
When you select an empty database, the Platform will show you the following screen:
When you click the button “Generate script” the tool will be generated create DDL statements for this connection:
Note: Hibernate is not used for generating DDL statements. It is done by the Platform because it’s more reliable and controllable than Hibernate. You can write your version of the templates used for this purpose. It's pretty straightforward to change or extend it with some new database dialect.
If the database connection is not empty and new changes on metamodels are detected, for each change, DDL statement of the selected database type will be ready to execute. DDL statements are generated on the fly for a selected type of database. You can review each change and proposed update statement and decide if you want to execute the update or skip and do it manually.
If anything goes wrong you will have an option to edit the change or skip that change:
History of updates
If the database connection is synchronized you can view the history of each change executed per connection.
Note that the Database Synchronization tool is optional, you do not have to use it, you can use liquibase, flyway or anything else instead.