I am facing an issue while running a database migration command in Odoo version 16 with my custom module. The error message I am encountering is as follows:
bad query: ALTER TABLE "stock_route_warehouse" ADD FOREIGN KEY ("route_id") REFERENCES "stock_route"("id") ON DELETE cascade ERROR: insert or update on table "stock_route_warehouse" violates foreign key constraint "stock_route_warehouse_route_id_fkey" DETAIL: Key (route_id)=(2) is not present in table "stock_route".