`Hello Stack Overflow community,
I am working on synchronizing data between a local MySQL database and a remote server database. Both databases have the same tables and table structures, including tables with generated columns. Here’s the table structure for one of the tables:
I am using the SriLibs.DataSync.MySQL package for synchronization. My connection strings are working fine, and I am able to establish connections to both databases. However, when I try to synchronize data from the local database to the server, I encounter the following error:
MySql.Data.MySqlClient.MySqlException: ‘The value specified for generated column ‘RemainingDebt’ in table ‘debtors’ is not allowed.’
Here is the code snippet I am using for synchronization:
I suspect that the issue might be related to the generated column (RemainingDebt) which is calculated based on other columns (TotalDue and AmountPaid). The error suggests that the value for the generated column is not allowed, which might be due to the synchronization process trying to insert or update values in this column directly.
Questions:
Is it possible that the generated column is causing the synchronization error?
How can I resolve this issue while synchronizing tables with generated columns?
Are there any specific configurations or settings required for handling generated columns during synchronization?
Any assistance or suggestions would be greatly appreciated!
Thank you`