Project-to-DB Synchronization tool issue
Posted: Wed 27 Apr 2016 18:29
When using the Schema Synchronization tool to sync changes made to a project out to a database, I've run across a couple of issues:
Firstly, If I declare a table column with a datatype datetime(6) with a default CURRENT_TIMESTAMP(6), the synchronization will be confused by this definition.
For example, consider:
Both the source project and the target database have identical definitions, but the schema sync shows that there are differences: in particular the source definition for the createddate line looks like this:
Note the missing CURRENT_TIMESTAMP(6 piece. Again, the source project sql file has the correct definition.
Secondly, I have a column that leverages the new 5.7 features of JSON support and stored generated columns.
Consider the following snippet:
In this case the sync tool does not include the the generated column definition at all on the source side.
Of course, following through with the synchronization would cause issues so in my mind the sync tool is effectively broken.
Firstly, If I declare a table column with a datatype datetime(6) with a default CURRENT_TIMESTAMP(6), the synchronization will be confused by this definition.
For example, consider:
Code: Select all
CREATE TABLE mytable (
id bigint(20) NOT NULL AUTO_INCREMENT,
createddate datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
lastmodifieddate datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
PRIMARY KEY (id)
)
Code: Select all
createddate DATETIME(6) NOT NULL DEFAULT )
Secondly, I have a column that leverages the new 5.7 features of JSON support and stored generated columns.
Consider the following snippet:
Code: Select all
CREATE TABLE mytable (
id bigint(20) NOT NULL AUTO_INCREMENT,
logdata JSON DEFAULT NULL,
someid VARCHAR(50) AS (json_unquote(json_extract(`logdata`,'$.SomeId'))) STORED NOT NULL
PRIMARY KEY (id)
)
Of course, following through with the synchronization would cause issues so in my mind the sync tool is effectively broken.