Add validation triggers and grants to auto partitioning code