Hi all.
I have a database with Odoo 11 Enterprise On-premises. This database has lost primary key constraint in all tables. I have no idea how this is possible.
The error is this:
psycopg2.errors.InvalidForeignKey: there is no unique constraint matching given keys for referenced table "res_groups"
This is not only for res_groups, but for every table. If I go to the database and look for description of any table (for example: \d res_users), I can see that constraints are not present.
I saw a way to re-create primary keys but this doesn't solve the issue, because every foreign key refference has been lost too.
Does anyone have an idea of what could being happening and how to solve it?
Thank you in advance.
you need to back your last backup as soon as possible
Thank you Usman Farzand. I made backups already, but that doesn't solve the problem.
Any idea of what (or How) could that been caused?