Repository: edgedb/edgedb

Issue:
Migration wants to drop & recreate constraints. No schema changes.
Just created a migration for a schema change. Now it thinks there are changes, and it cannot resolve them.

https://github.com/SeedCompany/cord-api-v3/tree/develop/dbschema

```
================================================================================
DESCRIBE CURRENT MIGRATION AS JSON delta
================================================================================
<DeltaRoot at 0x1083b2e10> (
    <AlterObjectType canonical=True, classname=Scripture::Verse, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.objtypes.AlterObjectType'>}, orig_cmd_type=<class 'edb.schema.objtypes.AlterObjectType'> at 0x10ecc66d0> (
        <AlterProperty canonical=True, classname=Scripture::__|chapter@Scripture|Verse, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.properties.AlterProperty'>}, aux_object_data={'from_alias': None}, orig_cmd_type=<class 'edb.schema.properties.AlterProperty'> at 0x10ef624d0> (
            <DeleteConstraint canonical=True, classname=Scripture::std|min_value@Scripture|__||chapter&Scripture||Verse@356a192b7913b04c54574d18c28d46e6395428ab, ddl_identity={'args': edb.schema.expr.ExpressionList([<Expression text='1', refs={}, origin=<edb.common.struct.Field object at 0x1059598f0> at 0x10863ebd0>])}, annotations={'orig_cmdclass': <class 'edb.schema.constraints.DeleteConstraint'>, 'confidence': 0.4} at 0x10ef6f810> (
                abstract         = False | None,
                ancestors        = <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value, std::constraint) at 0x10ef67c10> | None,
                args             = edb.schema.expr.ExpressionList([<Expression text='1', refs={}, origin=<edb.common.struct.Field object at 0x1059598f0> at 0x10863ebd0>]) | None,
                bases            = <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value) at 0x10ef67450> | None,
                builtin          = False | None,
                errmessage       = 'Minimum allowed value for {__subject__} is {min}.' | None # inherited,
                expr             = <ExpressionShell (__subject__ >= min) refs=(<ObjectShell Operator(<QualName std::std|>=@anytype@anytype@Infix>) at 0x10ef65a50>)> | None # inherited,
                finalexpr        = <ExpressionShell select (__subject__ >= 1) refs=(<ObjectShell Operator(<QualName std::std|>=@std|int16@std|int64@Infix>) at 0x10ef64b90>, <TypeShell ScalarType(<QualName std::int64>) at 0x10ec28b10>)> | None,
                inherited_fields = edb.common.checked.FrozenCheckedSet[str]({'params', 'errmessage', 'return_typemod', 'return_type', 'expr'}) | None,
                internal         = False | None,
                name             = <QualName Scripture::std|min_value@Scripture|__||chapter&Scripture||Verse@356a192b7913b04c54574d18c28d46e6395428ab> | None,
                owned            = True | None,
                params           = <ObjectCollectionShell FuncParameterList(std::min@std|min_value, std::__subject__@std|min_value) at 0x10ec2ac90> | None # inherited,
                return_type      = <TypeShell ScalarType(<QualName std::bool>) at 0x10ec2a3d0> | None # inherited,
                return_typemod   = <TypeModifier.SingletonType: 'SingletonType'> | None # inherited,
                subject          = <ObjectShell Property(<QualName Scripture::__|chapter@Scripture|Verse>) at 0x10ec2a250> | None
            )
        )
    ),
    <AlterObjectType canonical=True, classname=Scripture::Verse, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.objtypes.AlterObjectType'>}, orig_cmd_type=<class 'edb.schema.objtypes.AlterObjectType'> at 0x10ec74210> (
        <AlterProperty canonical=True, classname=Scripture::__|chapter@Scripture|Verse, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.properties.AlterProperty'>}, aux_object_data={'from_alias': None}, orig_cmd_type=<class 'edb.schema.properties.AlterProperty'> at 0x10ecc7690> (
            <CreateConstraint canonical=True, classname=Scripture::std|min_value@Scripture|__||chapter&Scripture||Verse@356a192b7913b04c54574d18c28d46e6395428ab, ddl_identity={'args': edb.schema.expr.ExpressionList([<Expression text='1', refs=None, origin=None at 0x10ec3fdd0>])}, annotations={'orig_cmdclass': <class 'edb.schema.constraints.CreateConstraint'>, 'confidence': 0.4} at 0x10ec533d0> (
                abstract         = None | False,
                ancestors        = None | <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value, std::constraint) at 0x10ec53190>,
                args             = None | edb.schema.expr.ExpressionList([<Expression text='1', refs=None, origin=None at 0x10ec3fdd0>]),
                bases            = None | <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value) at 0x10f05f510>,
                builtin          = None | False,
                errmessage       = None | 'Minimum allowed value for {__subject__} is {min}.' # inherited,
                expr             = None | <ExpressionShell (__subject__ >= min) refs=(<ObjectShell Operator(<QualName std::std|>=@anytype@anytype@Infix>) at 0x10eba1310>)> # inherited,
                finalexpr        = None | <ExpressionShell select (__subject__ >= 1) refs=(<ObjectShell Operator(<QualName std::std|>=@std|int16@std|int64@Infix>) at 0x10ef6c950>, <TypeShell ScalarType(<QualName std::int64>) at 0x10ef6ce90>)>,
                inherited_fields = None | edb.common.checked.FrozenCheckedSet[str]({'params', 'errmessage', 'return_typemod', 'return_type', 'expr'}),
                internal         = None | False,
                name             = None | <QualName Scripture::std|min_value@Scripture|__||chapter&Scripture||Verse@356a192b7913b04c54574d18c28d46e6395428ab>,
                owned            = None | True,
                params           = None | <ObjectCollectionShell FuncParameterList(std::__subject__@std|min_value, std::min@std|min_value) at 0x10ef6ee90> # inherited,
                return_type      = None | <TypeShell ScalarType(<QualName std::bool>) at 0x10ef6e6d0> # inherited,
                return_typemod   = None | <TypeModifier.SingletonType: 'SingletonType'> # inherited,
                subject          = None | <ObjectShell Property(<QualName Scripture::__|chapter@Scripture|Verse>) at 0x10ef6c210>
            )
        )
    ),
    <AlterObjectType canonical=True, classname=Scripture::Verse, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.objtypes.AlterObjectType'>}, orig_cmd_type=<class 'edb.schema.objtypes.AlterObjectType'> at 0x10ef61710> (
        <AlterProperty canonical=True, classname=Scripture::__|verse@Scripture|Verse, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.properties.AlterProperty'>}, aux_object_data={'from_alias': None}, orig_cmd_type=<class 'edb.schema.properties.AlterProperty'> at 0x10ef60f50> (
            <DeleteConstraint canonical=True, classname=Scripture::std|min_value@Scripture|__||verse&Scripture||Verse@356a192b7913b04c54574d18c28d46e6395428ab, ddl_identity={'args': edb.schema.expr.ExpressionList([<Expression text='1', refs={}, origin=<edb.common.struct.Field object at 0x1059598f0> at 0x10b064050>])}, annotations={'orig_cmdclass': <class 'edb.schema.constraints.DeleteConstraint'>, 'confidence': 0.4} at 0x10ec3b810> (
                abstract         = False | None,
                ancestors        = <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value, std::constraint) at 0x10f05f690> | None,
                args             = edb.schema.expr.ExpressionList([<Expression text='1', refs={}, origin=<edb.common.struct.Field object at 0x1059598f0> at 0x10b064050>]) | None,
                bases            = <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value) at 0x10f05f590> | None,
                builtin          = False | None,
                errmessage       = 'Minimum allowed value for {__subject__} is {min}.' | None # inherited,
                expr             = <ExpressionShell (__subject__ >= min) refs=(<ObjectShell Operator(<QualName std::std|>=@anytype@anytype@Infix>) at 0x10ef64b50>)> | None # inherited,
                finalexpr        = <ExpressionShell select (__subject__ >= 1) refs=(<ObjectShell Operator(<QualName std::std|>=@std|int16@std|int64@Infix>) at 0x10ea2a290>, <TypeShell ScalarType(<QualName std::int64>) at 0x10ea2b990>)> | None,
                inherited_fields = edb.common.checked.FrozenCheckedSet[str]({'params', 'errmessage', 'return_typemod', 'return_type', 'expr'}) | None,
                internal         = False | None,
                name             = <QualName Scripture::std|min_value@Scripture|__||verse&Scripture||Verse@356a192b7913b04c54574d18c28d46e6395428ab> | None,
                owned            = True | None,
                params           = <ObjectCollectionShell FuncParameterList(std::min@std|min_value, std::__subject__@std|min_value) at 0x10ec28d90> | None # inherited,
                return_type      = <TypeShell ScalarType(<QualName std::bool>) at 0x10ec28a50> | None # inherited,
                return_typemod   = <TypeModifier.SingletonType: 'SingletonType'> | None # inherited,
                subject          = <ObjectShell Property(<QualName Scripture::__|verse@Scripture|Verse>) at 0x10ec29190> | None
            )
        )
    ),
    <AlterObjectType canonical=True, classname=Scripture::Verse, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.objtypes.AlterObjectType'>}, orig_cmd_type=<class 'edb.schema.objtypes.AlterObjectType'> at 0x10ef632d0> (
        <AlterProperty canonical=True, classname=Scripture::__|verse@Scripture|Verse, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.properties.AlterProperty'>}, aux_object_data={'from_alias': None}, orig_cmd_type=<class 'edb.schema.properties.AlterProperty'> at 0x10ef626d0> (
            <CreateConstraint canonical=True, classname=Scripture::std|min_value@Scripture|__||verse&Scripture||Verse@356a192b7913b04c54574d18c28d46e6395428ab, ddl_identity={'args': edb.schema.expr.ExpressionList([<Expression text='1', refs=None, origin=None at 0x10ec626d0>])}, annotations={'orig_cmdclass': <class 'edb.schema.constraints.CreateConstraint'>, 'confidence': 0.4} at 0x10ec3a6d0> (
                abstract         = None | False,
                ancestors        = None | <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value, std::constraint) at 0x10ec3b050>,
                args             = None | edb.schema.expr.ExpressionList([<Expression text='1', refs=None, origin=None at 0x10ec626d0>]),
                bases            = None | <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value) at 0x10ec3b110>,
                builtin          = None | False,
                errmessage       = None | 'Minimum allowed value for {__subject__} is {min}.' # inherited,
                expr             = None | <ExpressionShell (__subject__ >= min) refs=(<ObjectShell Operator(<QualName std::std|>=@anytype@anytype@Infix>) at 0x10ec3bdd0>)> # inherited,
                finalexpr        = None | <ExpressionShell select (__subject__ >= 1) refs=(<ObjectShell Operator(<QualName std::std|>=@std|int16@std|int64@Infix>) at 0x10ec38410>, <TypeShell ScalarType(<QualName std::int64>) at 0x10ec382d0>)>,
                inherited_fields = None | edb.common.checked.FrozenCheckedSet[str]({'params', 'errmessage', 'return_typemod', 'return_type', 'expr'}),
                internal         = None | False,
                name             = None | <QualName Scripture::std|min_value@Scripture|__||verse&Scripture||Verse@356a192b7913b04c54574d18c28d46e6395428ab>,
                owned            = None | True,
                params           = None | <ObjectCollectionShell FuncParameterList(std::__subject__@std|min_value, std::min@std|min_value) at 0x10ec39150> # inherited,
                return_type      = None | <TypeShell ScalarType(<QualName std::bool>) at 0x10ec391d0> # inherited,
                return_typemod   = None | <TypeModifier.SingletonType: 'SingletonType'> # inherited,
                subject          = None | <ObjectShell Property(<QualName Scripture::__|verse@Scripture|Verse>) at 0x10ec39590>
            )
        )
    ),
    <AlterObjectType canonical=True, classname=Scripture::Verse, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.objtypes.AlterObjectType'>}, orig_cmd_type=<class 'edb.schema.objtypes.AlterObjectType'> at 0x10eae3f10> (
        <AlterProperty canonical=True, classname=Scripture::__|verseId@Scripture|Verse, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.properties.AlterProperty'>}, aux_object_data={'from_alias': None}, orig_cmd_type=<class 'edb.schema.properties.AlterProperty'> at 0x10eae2ad0> (
            <DeleteConstraint canonical=True, classname=Scripture::std|min_value@Scripture|__||verseId&Scripture||Verse@b6589fc6ab0dc82cf12099d1c2d40ab994e8410c, ddl_identity={'args': edb.schema.expr.ExpressionList([<Expression text='0', refs={}, origin=<edb.common.struct.Field object at 0x1059598f0> at 0x108530510>])}, annotations={'orig_cmdclass': <class 'edb.schema.constraints.DeleteConstraint'>, 'confidence': 0.4} at 0x10ec19b50> (
                abstract         = False | None,
                ancestors        = <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value, std::constraint) at 0x10ec30190> | None,
                args             = edb.schema.expr.ExpressionList([<Expression text='0', refs={}, origin=<edb.common.struct.Field object at 0x1059598f0> at 0x108530510>]) | None,
                bases            = <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value) at 0x10ec30050> | None,
                builtin          = False | None,
                errmessage       = 'Minimum allowed value for {__subject__} is {min}.' | None # inherited,
                expr             = <ExpressionShell (__subject__ >= min) refs=(<ObjectShell Operator(<QualName std::std|>=@anytype@anytype@Infix>) at 0x10ec338d0>)> | None # inherited,
                finalexpr        = <ExpressionShell select (__subject__ >= 0) refs=(<ObjectShell Operator(<QualName std::std|>=@std|int16@std|int64@Infix>) at 0x10ec33850>, <TypeShell ScalarType(<QualName std::int64>) at 0x10f05c5d0>)> | None,
                inherited_fields = edb.common.checked.FrozenCheckedSet[str]({'params', 'errmessage', 'return_typemod', 'return_type', 'expr'}) | None,
                internal         = False | None,
                name             = <QualName Scripture::std|min_value@Scripture|__||verseId&Scripture||Verse@b6589fc6ab0dc82cf12099d1c2d40ab994e8410c> | None,
                owned            = True | None,
                params           = <ObjectCollectionShell FuncParameterList(std::min@std|min_value, std::__subject__@std|min_value) at 0x10f05e350> | None # inherited,
                return_type      = <TypeShell ScalarType(<QualName std::bool>) at 0x10f05dcd0> | None # inherited,
                return_typemod   = <TypeModifier.SingletonType: 'SingletonType'> | None # inherited,
                subject          = <ObjectShell Property(<QualName Scripture::__|verseId@Scripture|Verse>) at 0x10f05db50> | None
            )
        )
    ),
    <AlterObjectType canonical=True, classname=Scripture::Verse, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.objtypes.AlterObjectType'>}, orig_cmd_type=<class 'edb.schema.objtypes.AlterObjectType'> at 0x10eae0b50> (
        <AlterProperty canonical=True, classname=Scripture::__|verseId@Scripture|Verse, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.properties.AlterProperty'>}, aux_object_data={'from_alias': None}, orig_cmd_type=<class 'edb.schema.properties.AlterProperty'> at 0x10eae3e90> (
            <CreateConstraint canonical=True, classname=Scripture::std|min_value@Scripture|__||verseId&Scripture||Verse@b6589fc6ab0dc82cf12099d1c2d40ab994e8410c, ddl_identity={'args': edb.schema.expr.ExpressionList([<Expression text='0', refs=None, origin=None at 0x10ebb8110>])}, annotations={'orig_cmdclass': <class 'edb.schema.constraints.CreateConstraint'>, 'confidence': 0.4} at 0x10ec2be90> (
                abstract         = None | False,
                ancestors        = None | <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value, std::constraint) at 0x10ecc6290>,
                args             = None | edb.schema.expr.ExpressionList([<Expression text='0', refs=None, origin=None at 0x10ebb8110>]),
                bases            = None | <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value) at 0x10ecc57d0>,
                builtin          = None | False,
                errmessage       = None | 'Minimum allowed value for {__subject__} is {min}.' # inherited,
                expr             = None | <ExpressionShell (__subject__ >= min) refs=(<ObjectShell Operator(<QualName std::std|>=@anytype@anytype@Infix>) at 0x10eabb910>)> # inherited,
                finalexpr        = None | <ExpressionShell select (__subject__ >= 0) refs=(<ObjectShell Operator(<QualName std::std|>=@std|int16@std|int64@Infix>) at 0x10ef63d50>, <TypeShell ScalarType(<QualName std::int64>) at 0x10ef605d0>)>,
                inherited_fields = None | edb.common.checked.FrozenCheckedSet[str]({'params', 'errmessage', 'return_typemod', 'return_type', 'expr'}),
                internal         = None | False,
                name             = None | <QualName Scripture::std|min_value@Scripture|__||verseId&Scripture||Verse@b6589fc6ab0dc82cf12099d1c2d40ab994e8410c>,
                owned            = None | True,
                params           = None | <ObjectCollectionShell FuncParameterList(std::__subject__@std|min_value, std::min@std|min_value) at 0x10ec39a50> # inherited,
                return_type      = None | <TypeShell ScalarType(<QualName std::bool>) at 0x10ec38550> # inherited,
                return_typemod   = None | <TypeModifier.SingletonType: 'SingletonType'> # inherited,
                subject          = None | <ObjectShell Property(<QualName Scripture::__|verseId@Scripture|Verse>) at 0x10ec3a650>
            )
        )
    ),
    <AlterObjectType canonical=True, classname=default::FundingAccount, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.objtypes.AlterObjectType'>}, orig_cmd_type=<class 'edb.schema.objtypes.AlterObjectType'> at 0x10ec2aed0> (
        <AlterProperty canonical=True, classname=default::__|accountNumber@default|FundingAccount, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.properties.AlterProperty'>}, aux_object_data={'from_alias': None}, orig_cmd_type=<class 'edb.schema.properties.AlterProperty'> at 0x10ec2a350> (
            <DeleteConstraint canonical=True, classname=default::std|min_value@default|__||accountNumber&default||FundingAccount@b6589fc6ab0dc82cf12099d1c2d40ab994e8410c, ddl_identity={'args': edb.schema.expr.ExpressionList([<Expression text='0', refs={}, origin=<edb.common.struct.Field object at 0x1059598f0> at 0x10a7dcf50>])}, annotations={'orig_cmdclass': <class 'edb.schema.constraints.DeleteConstraint'>, 'confidence': 0.4} at 0x10ec33550> (
                abstract         = False | None,
                ancestors        = <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value, std::constraint) at 0x10ec283d0> | None,
                args             = edb.schema.expr.ExpressionList([<Expression text='0', refs={}, origin=<edb.common.struct.Field object at 0x1059598f0> at 0x10a7dcf50>]) | None,
                bases            = <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value) at 0x10ec28590> | None,
                builtin          = False | None,
                errmessage       = 'Minimum allowed value for {__subject__} is {min}.' | None # inherited,
                expr             = <ExpressionShell (__subject__ >= min) refs=(<ObjectShell Operator(<QualName std::std|>=@anytype@anytype@Infix>) at 0x10ef63990>)> | None # inherited,
                finalexpr        = <ExpressionShell select (__subject__ >= 0) refs=(<ObjectShell Operator(<QualName std::std|>=@std|int16@std|int64@Infix>) at 0x10ef63a50>, <TypeShell ScalarType(<QualName std::int64>) at 0x10ef63b90>)> | None,
                inherited_fields = edb.common.checked.FrozenCheckedSet[str]({'params', 'errmessage', 'return_typemod', 'return_type', 'expr'}) | None,
                internal         = False | None,
                name             = <QualName default::std|min_value@default|__||accountNumber&default||FundingAccount@b6589fc6ab0dc82cf12099d1c2d40ab994e8410c> | None,
                owned            = True | None,
                params           = <ObjectCollectionShell FuncParameterList(std::min@std|min_value, std::__subject__@std|min_value) at 0x10ef62a10> | None # inherited,
                return_type      = <TypeShell ScalarType(<QualName std::bool>) at 0x10ef61f10> | None # inherited,
                return_typemod   = <TypeModifier.SingletonType: 'SingletonType'> | None # inherited,
                subject          = <ObjectShell Property(<QualName default::__|accountNumber@default|FundingAccount>) at 0x10ef62f50> | None
            )
        )
    ),
    <AlterObjectType canonical=True, classname=default::FundingAccount, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.objtypes.AlterObjectType'>}, orig_cmd_type=<class 'edb.schema.objtypes.AlterObjectType'> at 0x10ec29d90> (
        <AlterProperty canonical=True, classname=default::__|accountNumber@default|FundingAccount, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.properties.AlterProperty'>}, aux_object_data={'from_alias': None}, orig_cmd_type=<class 'edb.schema.properties.AlterProperty'> at 0x10ec29c10> (
            <CreateConstraint canonical=True, classname=default::std|min_value@default|__||accountNumber&default||FundingAccount@b6589fc6ab0dc82cf12099d1c2d40ab994e8410c, ddl_identity={'args': edb.schema.expr.ExpressionList([<Expression text='0', refs=None, origin=None at 0x10b956650>])}, annotations={'orig_cmdclass': <class 'edb.schema.constraints.CreateConstraint'>, 'confidence': 0.4} at 0x10ef6d590> (
                abstract         = None | False,
                ancestors        = None | <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value, std::constraint) at 0x10ef6ddd0>,
                args             = None | edb.schema.expr.ExpressionList([<Expression text='0', refs=None, origin=None at 0x10b956650>]),
                bases            = None | <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value) at 0x10ef6e490>,
                builtin          = None | False,
                errmessage       = None | 'Minimum allowed value for {__subject__} is {min}.' # inherited,
                expr             = None | <ExpressionShell (__subject__ >= min) refs=(<ObjectShell Operator(<QualName std::std|>=@anytype@anytype@Infix>) at 0x10ef6f010>)> # inherited,
                finalexpr        = None | <ExpressionShell select (__subject__ >= 0) refs=(<ObjectShell Operator(<QualName std::std|>=@std|int16@std|int64@Infix>) at 0x10ef6f410>, <TypeShell ScalarType(<QualName std::int64>) at 0x10ef6f590>)>,
                inherited_fields = None | edb.common.checked.FrozenCheckedSet[str]({'params', 'errmessage', 'return_typemod', 'return_type', 'expr'}),
                internal         = None | False,
                name             = None | <QualName default::std|min_value@default|__||accountNumber&default||FundingAccount@b6589fc6ab0dc82cf12099d1c2d40ab994e8410c>,
                owned            = None | True,
                params           = None | <ObjectCollectionShell FuncParameterList(std::__subject__@std|min_value, std::min@std|min_value) at 0x10ec322d0> # inherited,
                return_type      = None | <TypeShell ScalarType(<QualName std::bool>) at 0x10ec31a90> # inherited,
                return_typemod   = None | <TypeModifier.SingletonType: 'SingletonType'> # inherited,
                subject          = None | <ObjectShell Property(<QualName default::__|accountNumber@default|FundingAccount>) at 0x10ec333d0>
            )
        )
    ),
    <AlterObjectType canonical=True, classname=default::Project, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.objtypes.AlterObjectType'>}, orig_cmd_type=<class 'edb.schema.objtypes.AlterObjectType'> at 0x10f0a9190> (
        <AlterProperty canonical=True, classname=default::__|departmentId@default|Project, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.properties.AlterProperty'>}, aux_object_data={'from_alias': None}, orig_cmd_type=<class 'edb.schema.properties.AlterProperty'> at 0x10f0a8bd0> (
            <DeleteConstraint canonical=True, classname=default::std|min_value@default|__||departmentId&default||Project@8a12a315082a345f1a9d3ad14b214cd36d310cf8, ddl_identity={'args': edb.schema.expr.ExpressionList([<Expression text='10000', refs={}, origin=<edb.common.struct.Field object at 0x1059598f0> at 0x10a7d9790>])}, annotations={'orig_cmdclass': <class 'edb.schema.constraints.DeleteConstraint'>, 'confidence': 0.4} at 0x106e48e90> (
                main ,
                abstract         = False | None,
                ancestors        = <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value, std::constraint) at 0x10f0aa950> | None,
                args             = edb.schema.expr.ExpressionList([<Expression text='10000', refs={}, origin=<edb.common.struct.Field object at 0x1059598f0> at 0x10a7d9790>]) | None,
                bases            = <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value) at 0x10f0aae50> | None,
                builtin          = False | None,
                errmessage       = 'Minimum allowed value for {__subject__} is {min}.' | None # inherited,
                expr             = <ExpressionShell (__subject__ >= min) refs=(<ObjectShell Operator(<QualName std::std|>=@anytype@anytype@Infix>) at 0x10f0aa0d0>)> | None # inherited,
                finalexpr        = <ExpressionShell select (__subject__ >= 10000) refs=(<ObjectShell Operator(<QualName std::std|>=@std|int32@std|int64@Infix>) at 0x10f0aac90>, <TypeShell ScalarType(<QualName std::int64>) at 0x10f0aba90>)> | None,
                inherited_fields = edb.common.checked.FrozenCheckedSet[str]({'params', 'errmessage', 'return_typemod', 'return_type', 'expr'}) | None,
                internal         = False | None,
                name             = <QualName default::std|min_value@default|__||departmentId&default||Project@8a12a315082a345f1a9d3ad14b214cd36d310cf8> | None,
                owned            = True | None,
                params           = <ObjectCollectionShell FuncParameterList(std::min@std|min_value, std::__subject__@std|min_value) at 0x10ec50e50> | None # inherited,
                return_type      = <TypeShell ScalarType(<QualName std::bool>) at 0x10ec53f10> | None # inherited,
                return_typemod   = <TypeModifier.SingletonType: 'SingletonType'> | None # inherited,
                subject          = <ObjectShell Property(<QualName default::__|departmentId@default|Project>) at 0x10ec53b50> | None,
                caused ,
                <AlterObjectType canonical=True, classname=default::InternshipProject, annotations={'confidence': 0.0, 'orig_cmdclass': <class 'edb.schema.objtypes.AlterObjectType'>}, orig_cmd_type=<class 'edb.schema.objtypes.AlterObjectType'> at 0x10ed15890> (
                    <AlterProperty canonical=True, classname=default::__|departmentId@default|InternshipProject, annotations={'confidence': 0.0, 'orig_cmdclass': <class 'edb.schema.properties.AlterProperty'>}, aux_object_data={'from_alias': None}, orig_cmd_type=<class 'edb.schema.properties.AlterProperty'> at 0x10ebf4150> (
                        <DeleteConstraint canonical=True, classname=default::std|min_value@default|__||departmentId&default||InternshipProject@8a12a315082a345f1a9d3ad14b214cd36d310cf8, ddl_identity={'args': edb.schema.expr.ExpressionList([<Expression text='10000', refs={}, origin=<edb.common.struct.Field object at 0x1059598f0> at 0x1085c4910>])}, annotations={'orig_cmdclass': <class 'edb.schema.constraints.DeleteConstraint'>, 'confidence': 0.0} at 0x10ec334d0> (
                            ancestors        = <ObjectCollectionShell ObjectList['InheritingObject'](default::std|min_value@default|__||departmentId&default||Project@8a12a315082a345f1a9d3ad14b214cd36d310cf8, std::min_value, std::constraint) at 0x10f04c1d0> | None,
                            args             = edb.schema.expr.ExpressionList([<Expression text='10000', refs={}, origin=<edb.common.struct.Field object at 0x1059598f0> at 0x1085c4910>]) | None,
                            bases            = <ObjectCollectionShell ObjectList['InheritingObject'](default::std|min_value@default|__||departmentId&default||Project@8a12a315082a345f1a9d3ad14b214cd36d310cf8) at 0x10ebf6810> | None,
                            builtin          = False | None,
                            errmessage       = 'Minimum allowed value for {__subject__} is {min}.' | None # inherited,
                            expr             = <ExpressionShell (__subject__ >= min) refs=(<ObjectShell Operator(<QualName std::std|>=@anytype@anytype@Infix>) at 0x10eae13d0>)> | None # inherited,
                            finalexpr        = <ExpressionShell select (__subject__ >= 10000) refs=(<ObjectShell Operator(<QualName std::std|>=@std|int32@std|int64@Infix>) at 0x10eae12d0>, <TypeShell ScalarType(<QualName std::int64>) at 0x10eae0bd0>)> | None # inherited,
                            inherited_fields = edb.common.checked.FrozenCheckedSet[str]({'params', 'errmessage', 'return_typemod', 'finalexpr', 'return_type', 'expr'}) | None,
                            internal         = False | None,
                            name             = <QualName default::std|min_value@default|__||departmentId&default||InternshipProject@8a12a315082a345f1a9d3ad14b214cd36d310cf8> | None,
                            params           = <ObjectCollectionShell FuncParameterList(std::min@std|min_value, std::__subject__@std|min_value) at 0x10eae2450> | None # inherited,
                            return_type      = <TypeShell ScalarType(<QualName std::bool>) at 0x10eae07d0> | None # inherited,
                            return_typemod   = <TypeModifier.SingletonType: 'SingletonType'> | None # inherited,
                            subject          = <ObjectShell Property(<QualName default::__|departmentId@default|InternshipProject>) at 0x10eae3950> | None
                        )
                    )
                ),
                <AlterObjectType canonical=True, classname=default::TranslationProject, annotations={'confidence': 0.0, 'orig_cmdclass': <class 'edb.schema.objtypes.AlterObjectType'>}, orig_cmd_type=<class 'edb.schema.objtypes.AlterObjectType'> at 0x10ec19f90> (
                    <AlterProperty canonical=True, classname=default::__|departmentId@default|TranslationProject, annotations={'confidence': 0.0, 'orig_cmdclass': <class 'edb.schema.properties.AlterProperty'>}, aux_object_data={'from_alias': None}, orig_cmd_type=<class 'edb.schema.properties.AlterProperty'> at 0x10ec18b50> (
                        <DeleteConstraint canonical=True, classname=default::std|min_value@default|__||departmentId&default||TranslationProject@8a12a315082a345f1a9d3ad14b214cd36d310cf8, ddl_identity={'args': edb.schema.expr.ExpressionList([<Expression text='10000', refs={}, origin=<edb.common.struct.Field object at 0x1059598f0> at 0x10847d490>])}, annotations={'orig_cmdclass': <class 'edb.schema.constraints.DeleteConstraint'>, 'confidence': 0.0} at 0x10eba2110> (
                            ancestors        = <ObjectCollectionShell ObjectList['InheritingObject'](default::std|min_value@default|__||departmentId&default||Project@8a12a315082a345f1a9d3ad14b214cd36d310cf8, std::min_value, std::constraint) at 0x10f04c710> | None,
                            args             = edb.schema.expr.ExpressionList([<Expression text='10000', refs={}, origin=<edb.common.struct.Field object at 0x1059598f0> at 0x10847d490>]) | None,
                            bases            = <ObjectCollectionShell ObjectList['InheritingObject'](default::std|min_value@default|__||departmentId&default||Project@8a12a315082a345f1a9d3ad14b214cd36d310cf8) at 0x10f04f790> | None,
                            builtin          = False | None,
                            errmessage       = 'Minimum allowed value for {__subject__} is {min}.' | None # inherited,
                            expr             = <ExpressionShell (__subject__ >= min) refs=(<ObjectShell Operator(<QualName std::std|>=@anytype@anytype@Infix>) at 0x10f04d210>)> | None # inherited,
                            finalexpr        = <ExpressionShell select (__subject__ >= 10000) refs=(<ObjectShell Operator(<QualName std::std|>=@std|int32@std|int64@Infix>) at 0x10f04ded0>, <TypeShell ScalarType(<QualName std::int64>) at 0x10f04cf10>)> | None # inherited,
                            inherited_fields = edb.common.checked.FrozenCheckedSet[str]({'params', 'errmessage', 'return_typemod', 'finalexpr', 'return_type', 'expr'}) | None,
                            internal         = False | None,
                            name             = <QualName default::std|min_value@default|__||departmentId&default||TranslationProject@8a12a315082a345f1a9d3ad14b214cd36d310cf8> | None,
                            params           = <ObjectCollectionShell FuncParameterList(std::min@std|min_value, std::__subject__@std|min_value) at 0x10f04c550> | None # inherited,
                            return_type      = <TypeShell ScalarType(<QualName std::bool>) at 0x10f04dfd0> | None # inherited,
                            return_typemod   = <TypeModifier.SingletonType: 'SingletonType'> | None # inherited,
                            subject          = <ObjectShell Property(<QualName default::__|departmentId@default|TranslationProject>) at 0x10f04cb10> | None
                        )
                    )
                )
            )
        )
    ),
    <AlterObjectType canonical=True, classname=default::Project, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.objtypes.AlterObjectType'>}, orig_cmd_type=<class 'edb.schema.objtypes.AlterObjectType'> at 0x10f04d610> (
        <AlterProperty canonical=True, classname=default::__|departmentId@default|Project, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.properties.AlterProperty'>}, aux_object_data={'from_alias': None}, orig_cmd_type=<class 'edb.schema.properties.AlterProperty'> at 0x10f0a8c90> (
            <CreateConstraint canonical=True, classname=default::std|min_value@default|__||departmentId&default||Project@8a12a315082a345f1a9d3ad14b214cd36d310cf8, ddl_identity={'args': edb.schema.expr.ExpressionList([<Expression text='10000', refs=None, origin=None at 0x10b8af610>])}, annotations={'orig_cmdclass': <class 'edb.schema.constraints.CreateConstraint'>, 'confidence': 0.4} at 0x10ec29c50> (
                abstract         = None | False,
                ancestors        = None | <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value, std::constraint) at 0x10ec294d0>,
                args             = None | edb.schema.expr.ExpressionList([<Expression text='10000', refs=None, origin=None at 0x10b8af610>]),
                bases            = None | <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value) at 0x10ec2a950>,
                builtin          = None | False,
                errmessage       = None | 'Minimum allowed value for {__subject__} is {min}.' # inherited,
                expr             = None | <ExpressionShell (__subject__ >= min) refs=(<ObjectShell Operator(<QualName std::std|>=@anytype@anytype@Infix>) at 0x10ebf5e10>)> # inherited,
                finalexpr        = None | <ExpressionShell select (__subject__ >= 10000) refs=(<ObjectShell Operator(<QualName std::std|>=@std|int32@std|int64@Infix>) at 0x10ebf4190>, <TypeShell ScalarType(<QualName std::int64>) at 0x10ebf70d0>)>,
                inherited_fields = None | edb.common.checked.FrozenCheckedSet[str]({'params', 'errmessage', 'return_typemod', 'return_type', 'expr'}),
                internal         = None | False,
                name             = None | <QualName default::std|min_value@default|__||departmentId&default||Project@8a12a315082a345f1a9d3ad14b214cd36d310cf8>,
                owned            = None | True,
                params           = None | <ObjectCollectionShell FuncParameterList(std::__subject__@std|min_value, std::min@std|min_value) at 0x10ec62dd0> # inherited,
                return_type      = None | <TypeShell ScalarType(<QualName std::bool>) at 0x10ec602d0> # inherited,
                return_typemod   = None | <TypeModifier.SingletonType: 'SingletonType'> # inherited,
                subject          = None | <ObjectShell Property(<QualName default::__|departmentId@default|Project>) at 0x10ec609d0>
            )
        )
    ),
    <AlterObjectType canonical=True, classname=default::InternshipProject, annotations={'confidence': 0.0, 'orig_cmdclass': <class 'edb.schema.objtypes.AlterObjectType'>}, orig_cmd_type=<class 'edb.schema.objtypes.AlterObjectType'> at 0x10ea28490> (
        <AlterProperty canonical=True, classname=default::__|departmentId@default|InternshipProject, annotations={'confidence': 0.0, 'orig_cmdclass': <class 'edb.schema.properties.AlterProperty'>}, aux_object_data={'from_alias': None}, orig_cmd_type=<class 'edb.schema.properties.AlterProperty'> at 0x10ea2a510> (
            <CreateConstraint canonical=True, classname=default::std|min_value@default|__||departmentId&default||InternshipProject@8a12a315082a345f1a9d3ad14b214cd36d310cf8, ddl_identity={'args': edb.schema.expr.ExpressionList([<Expression text='10000', refs=None, origin=None at 0x10bfabe10>])}, annotations={'orig_cmdclass': <class 'edb.schema.constraints.CreateConstraint'>, 'confidence': 0.0} at 0x10ea4f710> (
                ancestors        = None | <ObjectCollectionShell ObjectList['InheritingObject'](default::std|min_value@default|__||departmentId&default||Project@8a12a315082a345f1a9d3ad14b214cd36d310cf8, std::min_value, std::constraint) at 0x10ec74bd0>,
                args             = None | edb.schema.expr.ExpressionList([<Expression text='10000', refs=None, origin=None at 0x10bfabe10>]),
                bases            = None | <ObjectCollectionShell ObjectList['InheritingObject'](default::std|min_value@default|__||departmentId&default||Project@8a12a315082a345f1a9d3ad14b214cd36d310cf8) at 0x10ea7d890>,
                builtin          = None | False,
                errmessage       = None | 'Minimum allowed value for {__subject__} is {min}.' # inherited,
                expr             = None | <ExpressionShell (__subject__ >= min) refs=(<ObjectShell Operator(<QualName std::std|>=@anytype@anytype@Infix>) at 0x10ebf41d0>)> # inherited,
                finalexpr        = None | <ExpressionShell select (__subject__ >= 10000) refs=(<ObjectShell Operator(<QualName std::std|>=@std|int32@std|int64@Infix>) at 0x10ebf6d50>, <TypeShell ScalarType(<QualName std::int64>) at 0x10ebf6090>)> # inherited,
                inherited_fields = None | edb.common.checked.FrozenCheckedSet[str]({'params', 'errmessage', 'return_typemod', 'finalexpr', 'return_type', 'expr'}),
                internal         = None | False,
                name             = None | <QualName default::std|min_value@default|__||departmentId&default||InternshipProject@8a12a315082a345f1a9d3ad14b214cd36d310cf8>,
                params           = None | <ObjectCollectionShell FuncParameterList(std::__subject__@std|min_value, std::min@std|min_value) at 0x10ec33610> # inherited,
                return_type      = None | <TypeShell ScalarType(<QualName std::bool>) at 0x10ec33590> # inherited,
                return_typemod   = None | <TypeModifier.SingletonType: 'SingletonType'> # inherited,
                subject          = None | <ObjectShell Property(<QualName default::__|departmentId@default|InternshipProject>) at 0x10ec32b10>
            )
        )
    ),
    <AlterObjectType canonical=True, classname=default::TranslationProject, annotations={'confidence': 0.0, 'orig_cmdclass': <class 'edb.schema.objtypes.AlterObjectType'>}, orig_cmd_type=<class 'edb.schema.objtypes.AlterObjectType'> at 0x10f0ab090> (
        <AlterProperty canonical=True, classname=default::__|departmentId@default|TranslationProject, annotations={'confidence': 0.0, 'orig_cmdclass': <class 'edb.schema.properties.AlterProperty'>}, aux_object_data={'from_alias': None}, orig_cmd_type=<class 'edb.schema.properties.AlterProperty'> at 0x10f0aa350> (
            <CreateConstraint canonical=True, classname=default::std|min_value@default|__||departmentId&default||TranslationProject@8a12a315082a345f1a9d3ad14b214cd36d310cf8, ddl_identity={'args': edb.schema.expr.ExpressionList([<Expression text='10000', refs=None, origin=None at 0x10b796950>])}, annotations={'orig_cmdclass': <class 'edb.schema.constraints.CreateConstraint'>, 'confidence': 0.0} at 0x10ebf5e90> (
                ancestors        = None | <ObjectCollectionShell ObjectList['InheritingObject'](default::std|min_value@default|__||departmentId&default||Project@8a12a315082a345f1a9d3ad14b214cd36d310cf8, std::min_value, std::constraint) at 0x10ef64bd0>,
                args             = None | edb.schema.expr.ExpressionList([<Expression text='10000', refs=None, origin=None at 0x10b796950>]),
                bases            = None | <ObjectCollectionShell ObjectList['InheritingObject'](default::std|min_value@default|__||departmentId&default||Project@8a12a315082a345f1a9d3ad14b214cd36d310cf8) at 0x10ec2b4d0>,
                builtin          = None | False,
                errmessage       = None | 'Minimum allowed value for {__subject__} is {min}.' # inherited,
                expr             = None | <ExpressionShell (__subject__ >= min) refs=(<ObjectShell Operator(<QualName std::std|>=@anytype@anytype@Infix>) at 0x10f0ab1d0>)> # inherited,
                finalexpr        = None | <ExpressionShell select (__subject__ >= 10000) refs=(<ObjectShell Operator(<QualName std::std|>=@std|int32@std|int64@Infix>) at 0x10ed17a10>, <TypeShell ScalarType(<QualName std::int64>) at 0x10ed15350>)> # inherited,
                inherited_fields = None | edb.common.checked.FrozenCheckedSet[str]({'params', 'errmessage', 'return_typemod', 'finalexpr', 'return_type', 'expr'}),
                internal         = None | False,
                name             = None | <QualName default::std|min_value@default|__||departmentId&default||TranslationProject@8a12a315082a345f1a9d3ad14b214cd36d310cf8>,
                params           = None | <ObjectCollectionShell FuncParameterList(std::__subject__@std|min_value, std::min@std|min_value) at 0x10ed169d0> # inherited,
                return_type      = None | <TypeShell ScalarType(<QualName std::bool>) at 0x10ed15190> # inherited,
                return_typemod   = None | <TypeModifier.SingletonType: 'SingletonType'> # inherited,
                subject          = None | <ObjectShell Property(<QualName default::__|departmentId@default|TranslationProject>) at 0x10ed17fd0>
            )
        )
    ),
    <AlterScalarType canonical=True, classname=default::population, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.scalars.AlterScalarType'>}, orig_cmd_type=<class 'edb.schema.scalars.AlterScalarType'> at 0x10ec1aed0> (
        <DeleteConstraint canonical=True, classname=default::std|min_value@default|population@b6589fc6ab0dc82cf12099d1c2d40ab994e8410c, ddl_identity={'args': edb.schema.expr.ExpressionList([<Expression text='0', refs={}, origin=<edb.common.struct.Field object at 0x1059598f0> at 0x10b0a53d0>])}, annotations={'orig_cmdclass': <class 'edb.schema.constraints.DeleteConstraint'>, 'confidence': 0.4} at 0x10f0aa410> (
            abstract         = False | None,
            ancestors        = <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value, std::constraint) at 0x10f0a9950> | None,
            args             = edb.schema.expr.ExpressionList([<Expression text='0', refs={}, origin=<edb.common.struct.Field object at 0x1059598f0> at 0x10b0a53d0>]) | None,
            bases            = <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value) at 0x10f0a92d0> | None,
            builtin          = False | None,
            errmessage       = 'Minimum allowed value for {__subject__} is {min}.' | None # inherited,
            expr             = <ExpressionShell (__subject__ >= min) refs=(<ObjectShell Operator(<QualName std::std|>=@anytype@anytype@Infix>) at 0x10f0a88d0>)> | None # inherited,
            finalexpr        = <ExpressionShell select (__subject__ >= 0) refs=(<ObjectShell Operator(<QualName std::std|>=@std|int32@std|int64@Infix>) at 0x10f0a9c90>, <TypeShell ScalarType(<QualName std::int64>) at 0x10f0a98d0>)> | None,
            inherited_fields = edb.common.checked.FrozenCheckedSet[str]({'params', 'errmessage', 'return_typemod', 'return_type', 'expr'}) | None,
            internal         = False | None,
            name             = <QualName default::std|min_value@default|population@b6589fc6ab0dc82cf12099d1c2d40ab994e8410c> | None,
            owned            = True | None,
            params           = <ObjectCollectionShell FuncParameterList(std::min@std|min_value, std::__subject__@std|min_value) at 0x10f0a85d0> | None # inherited,
            return_type      = <TypeShell ScalarType(<QualName std::bool>) at 0x10f0a8590> | None # inherited,
            return_typemod   = <TypeModifier.SingletonType: 'SingletonType'> | None # inherited,
            subject          = <TypeShell ScalarType(<QualName default::population>) at 0x10f0a9010> | None
        )
    ),
    <AlterScalarType canonical=True, classname=default::population, annotations={'confidence': 0.4, 'orig_cmdclass': <class 'edb.schema.scalars.AlterScalarType'>}, orig_cmd_type=<class 'edb.schema.scalars.AlterScalarType'> at 0x10ec1b710> (
        <CreateConstraint canonical=True, classname=default::std|min_value@default|population@b6589fc6ab0dc82cf12099d1c2d40ab994e8410c, ddl_identity={'args': edb.schema.expr.ExpressionList([<Expression text='0', refs=None, origin=None at 0x10b858090>])}, annotations={'orig_cmdclass': <class 'edb.schema.constraints.CreateConstraint'>, 'confidence': 0.4} at 0x10ef63fd0> (
            abstract         = None | False,
            ancestors        = None | <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value, std::constraint) at 0x10ef62790>,
            args             = None | edb.schema.expr.ExpressionList([<Expression text='0', refs=None, origin=None at 0x10b858090>]),
            bases            = None | <ObjectCollectionShell ObjectList['InheritingObject'](std::min_value) at 0x10ef60610>,
            builtin          = None | False,
            errmessage       = None | 'Minimum allowed value for {__subject__} is {min}.' # inherited,
            expr             = None | <ExpressionShell (__subject__ >= min) refs=(<ObjectShell Operator(<QualName std::std|>=@anytype@anytype@Infix>) at 0x10f04c6d0>)> # inherited,
            finalexpr        = None | <ExpressionShell select (__subject__ >= 0) refs=(<ObjectShell Operator(<QualName std::std|>=@std|int32@std|int64@Infix>) at 0x10f04c790>, <TypeShell ScalarType(<QualName std::int64>) at 0x10f04fd10>)>,
            inherited_fields = None | edb.common.checked.FrozenCheckedSet[str]({'params', 'errmessage', 'return_typemod', 'return_type', 'expr'}),
            internal         = None | False,
            name             = None | <QualName default::std|min_value@default|population@b6589fc6ab0dc82cf12099d1c2d40ab994e8410c>,
            owned            = None | True,
            params           = None | <ObjectCollectionShell FuncParameterList(std::__subject__@std|min_value, std::min@std|min_value) at 0x10f04de90> # inherited,
            return_type      = None | <TypeShell ScalarType(<QualName std::bool>) at 0x10f04ff90> # inherited,
            return_typemod   = None | <TypeModifier.SingletonType: 'SingletonType'> # inherited,
            subject          = None | <TypeShell ScalarType(<QualName default::population>) at 0x10f04d850>
        )
    )
)
```

It did it before too, but that time it was able to successfully complete the migration.
https://github.com/SeedCompany/cord-api-v3/blob/a501c9abc22add4303835bdacccd42379bc15b13/dbschema/migrations/00038.edgeql#L31-L86


Discussion:
I was only able to reproduce this if I applied the migrations and then restarted the server, which points to some kind of reflection bug. (Though Elvis may have reproed it without that?)
Note that in the delete/create pairs, we have:
```
                params           = <ObjectCollectionShell FuncParameterList(std::min@std|min_value, std::__subject__@std|min_value) at 0x10ec2ac90> | None # inherited,
```
and
```
                params           = None | <ObjectCollectionShell FuncParameterList(std::__subject__@std|min_value, std::min@std|min_value) at 0x10ef6ee90> # inherited,
```
The param list has lost its order!
(I didn't notice this directly: I modified `delta_objects` to produce an alter on one of the objects even when it wanted to do a delete/create.)

It looks like the root cause is that the `@index` field isn't getting serialized properly for the param list!
```
_localdev:bug> create type X { 
..............     create property asdf -> int64 { 
..............         create constraint min_value(0);
..............     }
.............. };
OK: CREATE TYPE
_localdev:bug> select schema::Constraint { name, params: {name, @index} } 
.............. filter .name = 'std::min_value' and .subject.name = 'asdf';
{
  schema::Constraint {
    name: 'std::min_value',
    params: {
      schema::Parameter {name: '__subject__', @index: {}},
      schema::Parameter {name: 'min', @index: {}},
    },
  },
}
```

Seems like this has been lurking since at least 2.x (and probably forever), but we've gotten lucky with join orders and whatnot.

Required link properties would have caught this: https://github.com/edgedb/edgedb/issues/5571.
Schema reflection testing *might* have caught this: https://github.com/edgedb/edgedb/issues/5169.


Resolving patch:
diff --git a/edb/pgsql/patches.py b/edb/pgsql/patches.py
--- a/edb/pgsql/patches.py
+++ b/edb/pgsql/patches.py
@@ -102,4 +102,6 @@ def _setup_patches(patches: list[tuple[str, str]]) -> list[tuple[str, str]]:
 '''),
     ('edgeql+schema', ''),  # pg_attribute, pg_attribute_ext, edgedbsql.columns
     ('edgeql+schema', ''),  # __type__
+    # === 4.6
+    ('edgeql+schema+globalonly', ''),  # recreate introspection query
 ])
diff --git a/edb/schema/reflection/structure.py b/edb/schema/reflection/structure.py
--- a/edb/schema/reflection/structure.py
+++ b/edb/schema/reflection/structure.py
@@ -30,6 +30,7 @@
 
 from edb.edgeql import qltypes
 
+from edb.schema import constraints as s_constr
 from edb.schema import ddl as s_ddl
 from edb.schema import delta as sd
 from edb.schema import expr as s_expr
@@ -529,7 +530,38 @@ def generate_structure(
                         f'{read_ptr}: {{name, value := .{proxy_link}.id}}'
                     )
 
-                if ptr.issubclass(schema, ordered_link):
+                # HACK: Pre 4.6, we did not correctly populate the
+                # @index linkprop for concrete constraint params,
+                # which can cause migration trouble if they happen to
+                # get read back in the wrong order. We fixed it
+                # forward, but we need to be able to handle cases
+                # where it is still missing, so we read the order out
+                # of the nearest abstract *ancestor*, since abstract
+                # constraint @indexs always got populated properly.
+                if (
+                    sfn == 'params'
+                    and issubclass(py_cls, s_constr.Constraint)
+                ):
+                    read_ptr = '''
+                        params := (select .params {
+                          id,
+                          baseindex := assert_single((
+                            # fetch the first non-concrete ancestor
+                            with anc := (
+                              select schema::Constraint.ancestors[
+                                  is schema::Constraint]
+                              filter .abstract order by @index limit 1
+                            ),
+                            # ... and pull out the index of the matching param
+                            select anc {
+                             params
+                             filter .name = schema::Constraint.params.name
+                            }.params@index
+                          ))
+                        } order by @index ?? .baseindex) { id }
+                    '''
+
+                elif ptr.issubclass(schema, ordered_link):
                     read_ptr = f'{read_ptr} ORDER BY @index'
 
                 read_shape.append(read_ptr)
diff --git a/edb/schema/reflection/writer.py b/edb/schema/reflection/writer.py
--- a/edb/schema/reflection/writer.py
+++ b/edb/schema/reflection/writer.py
@@ -299,12 +299,13 @@ def _build_object_mutation_shape(
             # an ObjectKeyDict collection that allow associating objects
             # with arbitrary values (a transposed ObjectDict).
             target_expr = f"""assert_distinct((
-                FOR v IN {{ json_array_unpack(<json>${var_n}) }}
+                FOR v IN {{ enumerate(json_array_unpack(<json>${var_n})) }}
                 UNION (
                     SELECT {target.get_name(schema)} {{
-                        @value := <str>v[1]
+                        @index := v.0,
+                        @value := <str>v.1[1],
                     }}
-                    FILTER .id = <uuid>v[0]
+                    FILTER .id = <uuid>v.1[0]
                 )
             ))"""
             args = props.get('args', [])


Test patch:
diff --git a/tests/test_edgeql_ddl.py b/tests/test_edgeql_ddl.py
--- a/tests/test_edgeql_ddl.py
+++ b/tests/test_edgeql_ddl.py
@@ -10190,6 +10190,26 @@ async def test_edgeql_ddl_constraint_09(self):
             CREATE TYPE Comment EXTENDING Text;
         """)
 
+        await self.assert_query_result(
+            """
+            select schema::Constraint {
+                name, params: {name, @index} order by @index
+            }
+            filter .name = 'std::max_len_value'
+            and .subject.name = 'body'
+            and .subject[is schema::Pointer].source.name ='default::Text';
+            """,
+            [
+                {
+                    "name": "std::max_len_value",
+                    "params": [
+                        {"name": "__subject__", "@index": 0},
+                        {"name": "max", "@index": 1}
+                    ]
+                }
+            ],
+        )
+
         await self.con.execute("""
             ALTER TYPE Text
                 ALTER PROPERTY body