Applying seed throws errors on reference database fields

I am trying to import the Postgresql data from my remote docker target to the local docker target with seeds. This throws errors when the db tables contain reference fields, like this one:

"insert or update on table “products” violates key constraint
“products_product_category_foreign”.

How can this be solved?

How did you generated the changes and seeds? All with the Wappler UI?

Obviously the tables should be created first before you can apply the seeds

The db schema and tables were built on development docker target and then on first deployment on the remote target I copied the db_init file to the target.
Then, on the remote docker target data were added which I want to use on the development version now too, so I created seeds from the remote docker target database and tried to import those on the local docker target. This works for some of the tables (without reference fields), however errors are thrown for seeds of tables with reference fields.

Any idea how these errors can be avoided @George?

The db schema is identical on all target, the seeds only work for tables that don’t contain reference fields.

Thanks for any help in advance.

This has been fixed in Wappler 4.7.2

1 Like

This topic was automatically closed after 42 hours. New replies are no longer allowed.