you oughtta have an order by clause in that sql change you made for portent if you're relying on getting the alphabetically-first matching result. order of sql results is undefined without an order by clause. many databases give you ordering based on the pk 99% of the time and then arbitrarily change the order based on weird runtime database engine decisions
unless your database goes beyond the sql standard and guarantees this, and you're not interested in writing standard sql that could be moved to a different db
you oughtta have an order by clause in that sql change you made for portent if you're relying on getting the alphabetically-first matching result. order of sql results is undefined without an order by clause. many databases give you ordering based on the pk 99% of the time and then arbitrarily change the order based on weird runtime database engine decisions
unless your database goes beyond the sql standard and guarantees this, and you're not interested in writing standard sql that could be moved to a different db