- args:
    cascade: true
    sql: "CREATE OR REPLACE FUNCTION assign_ro_number()\r\n RETURNS trigger\r\n LANGUAGE
      plpgsql\r\nAS $function$\r\n      begin\r\n        IF NEW.converted = true and
      new.ro_number is null THEN\r\n           UPDATE counters\r\n\tSET count = count
      + 1 where shopid=new.shopid\r\n\tRETURNING CONCAT(prefix,count) into new.ro_number;\r\n\r\n
      \       END IF;\r\n        RETURN NEW;\r\n      END;\r\n  $function$\r\n;\r\n"
  type: run_sql
