denodb icon indicating copy to clipboard operation
denodb copied to clipboard

Duplicate key on write or update prevents other tables from syncing

Open sntg-p opened this issue 5 years ago • 1 comments

Am I the only one having this problem? It seems that when syncing the tables to the database, when the constraint already exists it throws this error and just stops syncing all tables.

I'm using MariaDB so I think this could be fixed by adding the constraint if it doesn't exist like this:

ALTER TABLE `rabbits`
ADD CONSTRAINT `fk_rabbits_main_page` FOREIGN KEY IF NOT EXISTS
(`main_page_id`) REFERENCES `rabbit_pages` (`id`);

After some investigation I realised that denjucks/dex is being used for the actual query generation, maybe I should go bother there?

sntg-p avatar Nov 13 '20 20:11 sntg-p

I always have that problem when I use the drop property in the sync function. I just delete the database and I create it again. I think is more a Maria DB issue than a dex issue. :/

jrdx0 avatar Nov 14 '20 18:11 jrdx0