Reputation: 1
Simple configuration with mysql, 1 corporate node, 1 store node. I have a table "customers" that is bidirectional, with relevant symmetric ds configuration set up.
I drop it from the corporate DB. Can I propagate this schema change to the store DB?
Both send-schema
and send-sql
do not seem to work. No error messages, and no deleted table. I've made sure to delete the trigger first, and run sync-triggers
. I've tried "DROP TABLE customers" with send-sql
- no luck there either.
I've looked at the docs - not much in terms of how it's done. This was the closest I could find: https://symmetricds.org/docs/how-to/sync-schema-ddl-changes/
Does anyone know how this is done, or if it's even possible?
Upvotes: 0
Views: 136
Reputation: 116
Send sql is the way to go for this, because SymmetricDS does not capture DDL changes for MySQL.
If you used the table name that you dropped from the corporate DB in the sym_data source_table_name value (from the sym_trigger_hist), an active sym_trigger_hist record for that table will not exist because the table does not exist anymore.
You will need to use some table that exists, like sym_node, as the value of the source_table_name so that an active trigger history record from sym_trigger_hist will be found.
Using the example Send Sql statement from the documentation, located here: https://symmetricds.sourceforge.net/doc/3.15/html/user-guide.html#_send
and using your values (you will need to provide a valid target node_id value for the node_list)
insert into sym_data (node_list, table_name, event_type, row_data, trigger_hist_id, channel_id, create_time) select 'storenode', source_table_name, 'S', '"drop table customers;"', trigger_hist_id, 'reload', current_timestamp from sym_trigger_hist where source_table_name = 'sym_node' and inactive_time is null;
Upvotes: 1