[copr] master: Make legal flag a separate db entity (147f3c8)