Skip to main content

MySQL Schema Change Sync

Starting in VeloDB Cloud Core 26.1.2, Auto Table Creation Sync can apply MySQL column additions and removals to the target table during replication. The warehouse SQL user running the job needs ALTER_PRIV on the affected table. For SQL Mapping Sync, maintain the target schema and column expressions yourself.

Supported schema changes​

MySQL operationEffect on the target table
ADD COLUMNAppends a nullable column with the mapped type and source column comment. Existing rows are not backfilled. Subsequent changes carry the values recorded in the binary log.
DROP COLUMNDrops the corresponding target column.

Added columns are appended even when the MySQL statement specifies FIRST or AFTER. The job does not copy column defaults or NOT NULL constraints. Retrying an add for an existing column or a drop for an absent column skips the operation.

A column added after replication begins is mapped from the binary log schema. For example, an added MySQL JSON column becomes JSON in the warehouse, and an added MEDIUMINT UNSIGNED becomes BIGINT. At initial table creation, the corresponding types are STRING and INT. See MySQL data type mapping.

Manage other schema changes​

Coordinate schema changes such as renaming a column, changing its type, or changing the primary key with the warehouse table owner. These changes cannot be applied automatically and can pause the job. Inspect the job error, reconcile the source and target schemas, and verify a test change when restarting synchronization. The job does not replicate indexes, partition definitions, or table renames.

In Core 26.1.4 and later, the schema_change_behavior source property controls automatic changes. The default, evolve, applies supported changes. Set it to ignore to keep the existing target schema and manage changes yourself. Subsequent rows still need to fit that schema.

PAUSE JOB WHERE jobname = 'mysql_orders_sync';
ALTER JOB mysql_orders_sync
FROM MYSQL ("schema_change_behavior" = "ignore")
TO DATABASE analytics;
RESUME JOB WHERE jobname = 'mysql_orders_sync';

See also​

Enter to send · Shift+Enter for a new line