|L iOddlmZddlmZddlmZddlmZddl m Z ddl m Z erdd l m Z ejej dd Zejej"dd Zejej& dd Zejej* ddZejej.ddZejej2 ddZejej6 ddZejej: d dZejej> d!dZ ejejBd"dZ"ejejF d#dZ$ejejJ d$dZ&ejejN d%dZ(ejejR d&dZ*y )') TYPE_CHECKINGschema)ops) Operations)_copy)sqla_2)TableNc|jjj|jjd|j}|j}|j }|j }|j}|j}|j}|j} |j} |j} |j} |j} fd}|ri|rg|jj!|t#j$|||}|j&D]&}||s |jj)|(|jj*||f| | | |||||| | d |j,|rn|jj!||jj/|||}|j&D]&}||s |jj1|(yy)Nc~t|tj xr |j xs|jSN) isinstance sa_schemaPrimaryKeyConstraint _create_rule) constraintcompilers _/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/alembic/operations/toimpl.py_count_constraintz'alter_column.._count_constraint&s<j)*H*HII '' ' L:+B+B8+L r) nullableserver_defaultnametype_r existing_typeexisting_server_defaultexisting_nullablecommentexisting_comment)impldialectstatement_compilerrrr modify_type column_name table_namermodify_server_default modify_namemodify_nullablemodify_commentr! schema_objtablerColumn constraintsdrop_constraint alter_columnkwcolumnadd_constraint) operations operationrrrrr&r'rrnew_column_namerr r!rtrrs @rr1r1s&&99H++M!33'??  ! !E''K%%J   F44N++O((H&&G 11   ! ! ' '    [- 8 (  -- rc|j|j}|jj|j|f|j |j d|jy)N)rr;) to_columnr>r" drop_columnr'rr;r2)r5r6r3s rrBrBZsa !=!= >FJOO%%  ,, rc|j|j}i}|j|j|d<|jj|fi|yN if_not_exists)to_indexr>rEr" create_index)r5r6idxr2s rrGrGhsT   Z99 :C B*'55? JOO  ++rci}|j|j|d<|jj|j|jfi|yr:)r;r" drop_indexrFr>r?s rrJrJssR B&#--;JOO:778 rci}|j|j|d<|j|j}|jj|fi||SrD)rEr=r>r" create_table)r5r6r2r-s rrLrLsY B*'55?   z;; r"create_table_commentr5r6r-s rrRrRs,   z;; r"drop_table_commentrSs rrUrUs,   z;; rPs rcreate_constraintr`s*OO"" < <=rc$i}|j ts td|j|d<|jj|j j |j|j|j|jfi|y)NzSQLAlchemy 2.0 requiredr;r) r;r NotImplementedErrorr"r0r,generic_constraintconstraint_namer'constraint_typerr?s rr0r0s B&%&?@ @#--;#JOO##00  % %   % %## 1  rc||jj|j|j|jy)N) multiinsert)r" bulk_insertr-rowsrgrPs rrhrhs0OOY5J5J rcz|jjj|j|jy)N)execution_options)r>r"executesqltextrkrPs r execute_sqlrns4  %%--Y-H-H.r)r5rr6zops.AlterColumnOpreturnN)r5rr6zops.DropTableOproN)r5rr6zops.DropColumnOproN)r5rr6zops.CreateIndexOproN)r5rr6zops.DropIndexOproN)r5rr6zops.CreateTableOpror )r5rr6zops.RenameTableOproN)r5rr6zops.CreateTableCommentOproN)r5rr6zops.DropTableCommentOproN)r5rr6zops.AddColumnOproN)r5rr6zops.AddConstraintOproN)r5rr6zops.DropConstraintOproN)r5rr6zops.BulkInsertOproN)r5rr6zops.ExecuteSQLOproN)+typingr sqlalchemyrrrbaserutil.sqla_compatr r sqlalchemy.sql.schemar implementation_for AlterColumnOpr1 DropTableOpr< DropColumnOprB CreateIndexOprG DropIndexOprJ CreateTableOprL RenameTableOprNCreateTableCommentOprRDropTableCommentOprU AddColumnOprWAddConstraintOpr`DropConstraintOpr0 BulkInsertOprh ExecuteSQLOprnrrrsE!*$%+s001;;;;)<;; ;;2;;|s/0s//0  );   1 s001,,)<, ,2,s/0s001)< 2s001)< 2s77800)C0 090s556..)A. .7.s/606Bs223)> 4s334)? 5&s//0); 1s//0); 1r