我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用alembic.op.to_diff_tuple()。
def to_diff_tuple(self): return ("add_constraint", self.to_constraint())
def to_diff_tuple(self): if self.constraint_type == "foreignkey": return ("remove_fk", self.to_constraint()) else: return ("remove_constraint", self.to_constraint())
def to_diff_tuple(self): return ("add_fk", self.to_constraint())
def to_diff_tuple(self): return ("add_index", self.to_index())
def to_diff_tuple(self): return ("remove_index", self.to_index())
def to_diff_tuple(self): return ("remove_table", self.to_table())
def to_diff_tuple(self): col_diff = [] schema, tname, cname = self.schema, self.table_name, self.column_name if self.modify_type is not None: col_diff.append( ("modify_type", schema, tname, cname, { "existing_nullable": self.existing_nullable, "existing_server_default": self.existing_server_default, }, self.existing_type, self.modify_type) ) if self.modify_nullable is not None: col_diff.append( ("modify_nullable", schema, tname, cname, { "existing_type": self.existing_type, "existing_server_default": self.existing_server_default }, self.existing_nullable, self.modify_nullable) ) if self.modify_server_default is not False: col_diff.append( ("modify_default", schema, tname, cname, { "existing_nullable": self.existing_nullable, "existing_type": self.existing_type }, self.existing_server_default, self.modify_server_default) ) return col_diff
def to_diff_tuple(self): return ("add_column", self.schema, self.table_name, self.column)
def to_diff_tuple(self): return ( "remove_column", self.schema, self.table_name, self.to_column())
def _ops_as_diffs(cls, migrations): for op in migrations.ops: if hasattr(op, 'ops'): for sub_op in cls._ops_as_diffs(op): yield sub_op else: yield op.to_diff_tuple()