def generate_extra(self, block: dbops.PLBlock) -> None: comments = [] exprs = self.new_constraint.constraint_code(block) constr_name = self.new_constraint.raw_constraint_name() if isinstance(exprs, list) and len(exprs) > 1: for i, _expr in enumerate(exprs): constraint = MultiConstraintItem(self.new_constraint, i) comment = dbops.Comment(constraint, constr_name) comments.append(comment) else: comment = dbops.Comment(self.new_constraint, constr_name) comments.append(comment) for comment in comments: comment.generate(block)
def generate_extra(self, block): text = self.raw_constraint_name() cmd = dbops.Comment(object=self, text=text) cmd.generate(block)