Added constraints for Post class.