I create new Entity, then start Application. On start Jmix detects that there is no table in database for my new Entity and generate xml Liquibase changeset for creating it. But in this generated xml there are wrong datatypes. For example, I want to use NVARCHAR instead of VARCHAR or DATETIME2 instead of DATETIME in MSSQL database.
For now I need to review and manually replace generated types before starting Application.
Is there any opportunity to configure Jmix datatype generation mapping for different databases (defined by Liquibase’s “dbms” attribute)?
Liquibase itself has some functionality for this purpose
but it seems JMIX must generate types like ${datatype_property_name} for using it.
There is no such option to change generation mapping project-wide.
You can use columnDefinition attribute of the @Column annotation to specify custom SQL type where it is needed. (Column definition field in entity designer). E.g.:
Another option is to create custom datatype and use it instead of basic datatype provided by Jmix Framework.
E.g. you create custom foo_string datatype and specify desired SQL type in @Ddl annotation. You can have several @Ddl annotations for each dbms type: