U of@sddlmZddlmZddlmZGdddZGdddZGdd d ZGd d d Z Gd d d Z GdddZ GdddZ dS)) zip_longest)schema) ClauseListc@s$eZdZddZddZddZdS) CompareTablecCs ||_dSN)table)selfrr K/opt/hc_python/lib/python3.8/site-packages/alembic/testing/schemacompare.py__init__szCompareTable.__init__cCsv|jj|jks|jj|jkr dSt|jj|jD]@\}}|dkrH|dk sX|dkr^|dk r^dSt||kr0dSq0dSNFT)rnamerrc CompareColumn)rotherc1c2r r r __eq__ s zCompareTable.__eq__cCs || Srrrrr r r __ne__szCompareTable.__ne__N__name__ __module__ __qualname__r rrr r r r rsrc@s$eZdZddZddZddZdS)rcCs ||_dSr)column)rrr r r r szCompareColumn.__init__cCs|jj|jko|jj|jkSr)rr Znullablerr r r r#s zCompareColumn.__eq__cCs || Srrrr r r r*szCompareColumn.__ne__Nrr r r r rsrc@s.eZdZd ddZddZddZdd Zd S) CompareIndexFcCs||_||_dSr)index name_only)rrrr r r r /szCompareIndex.__init__cCsD|jr|jj|jkStt|jtt|ko>|jj|jkSdSr)rrr strrZ CreateIndexZdialect_kwargsrr r r r3s  zCompareIndex.__eq__cCs || Srrrr r r r=szCompareIndex.__ne__cCsNt|jj}z|j}Wntk r6t|}YnXd|jjd|dS)Nz)rrZ expressionscompilestring Exceptionrr )rexprZexpr_strr r r __repr__@s  zCompareIndex.__repr__N)F)rrrr rrr%r r r r r.s  rc@s$eZdZddZddZddZdS)CompareCheckConstraintcCs ||_dSr constraintrr(r r r r JszCompareCheckConstraint.__init__cCsTt|tjoR|jj|jkoRt|jjt|jkoR|jj|jjjkoR|jj|jjjkSr) isinstancerZCheckConstraintr(r rZsqltextrrr r r rMs  zCompareCheckConstraint.__eq__cCs || Srrrr r r rVszCompareCheckConstraint.__ne__Nrr r r r r&Is r&c@s$eZdZddZddZddZdS)CompareForeignKeycCs ||_dSrr'r)r r r r [szCompareForeignKey.__init__cCst|tjo<|jj|jko<|jj|jjjko<|jj|jjjk}|sFdSt|jj|jD]@\}}|dkrn|dk s~|dkr|dk rdSt||krVdSqVdSr ) r*rZForeignKeyConstraintr(r rrcolumnsrrrr1rrr r r r^s&   zCompareForeignKey.__eq__cCs || Srrrr r r rpszCompareForeignKey.__ne__Nrr r r r r+Zsr+c@s$eZdZddZddZddZdS)ComparePrimaryKeycCs ||_dSrr'r)r r r r uszComparePrimaryKey.__init__cCst|tjo<|jj|jko<|jj|jjjko<|jj|jjjk}|sFdSt|jj|jD]@\}}|dkrn|dk s~|dkr|dk rdSt||krVdSqVdSr ) r*rZPrimaryKeyConstraintr(r rrr,rr-r r r rxs&   zComparePrimaryKey.__eq__cCs || Srrrr r r rszComparePrimaryKey.__ne__Nrr r r r r/tsr/c@s$eZdZddZddZddZdS)CompareUniqueConstraintcCs ||_dSrr'r)r r r r sz CompareUniqueConstraint.__init__cCst|tjo<|jj|jko<|jj|jjjko<|jj|jjjk}|sFdSt|jj|jD]@\}}|dkrn|dk s~|dkr|dk rdSt||krVdSqVdSr ) r*rZUniqueConstraintr(r rrr,rr-r r r rs&   zCompareUniqueConstraint.__eq__cCs || Srrrr r r rszCompareUniqueConstraint.__ne__Nrr r r r r0sr0N) itertoolsrZ sqlalchemyrZsqlalchemy.sql.elementsrrrrr&r+r/r0r r r r s