def try_diff4(): schema = DBSchema('First') table2 = DBTable('table2') table2.fields.append(DBField('abc')) table2.get_field('abc').unique = False schema.tables.append(table2) schema2 = DBSchema('Second') table3 = DBTable('table3', aka='table2') table3.fields.append(DBField('abc')) table3.get_field('abc').unique = True schema2.tables.append(table3) print unicode(schema) print unicode(schema2) print unicode(TreeDiff(schema, schema2))
def try_diff3(): schema = DBSchema('First') table1 = DBTable('table1') table1.fields = [DBField('id', primary_key=True)] table2 = DBTable('table2') table2.fields = [DBField('id'), DBField('name')] schema.tables = [table1, table2] schema2 = DBSchema('Second') table3 = DBTable('table3', aka='table2') table3.fields = [DBField('xxx', aka='name'), DBField('yyy', aka='')] schema2.tables = [table1, table3] print unicode(TreeDiff(schema, schema2))