As suggested by the code comment in indexes_equal(), the string comparison isn't quite enough. If one column being compared has a comment and the other one doesn't (or the comments are different), the comparison will fail:
|
def indexes_equal(a: Index, b: Index) -> bool: |
This might be quite hard to fix properly. You would need to compare the list of expressions on each index. Or you could argue that the indexes should not be considered equal if they have different comments.
See ucam-department-of-psychiatry/crate#243
The workaround is to ensure that the columns referenced by the indexes have identical comments.
As suggested by the code comment in
indexes_equal(), the string comparison isn't quite enough. If one column being compared has a comment and the other one doesn't (or the comments are different), the comparison will fail:pythonlib/cardinal_pythonlib/sqlalchemy/schema.py
Line 1354 in 537f8b0
This might be quite hard to fix properly. You would need to compare the list of expressions on each index. Or you could argue that the indexes should not be considered equal if they have different comments.
See ucam-department-of-psychiatry/crate#243
The workaround is to ensure that the columns referenced by the indexes have identical comments.