U
    ]ôe^  ă                   @   sH   d Z ddlmZ ddlZddlmZ dZdZdZ	dZ
dd„ Zd	d
„ ZdS )zbproject

Revision ID: af18a0280adf
Revises: f907d52e69fa
Create Date: 2024-03-13 19:26:45.346979

é    )ÚopN)Ú
postgresqlÚaf18a0280adfÚf907d52e69fac                  C   s  dD ]} t  d| › dťˇ qt  dˇ t  dtjdtjddŤd	d
Ťˇ t  dˇ t jt  dˇddgddŤ t  d dddgdgˇ t  dtjdtjddŤd	d
Ťˇ t  dˇ t jt  dˇddgddŤ t  d dddgdgˇ t  dtjdtjddŤd	d
Ťˇ t  dˇ t jt  dˇddgddŤ t  d dddgdgˇ t  dtjdtjddŤd	d
Ťˇ t  dˇ t jt  dˇddgddŤ t  d dddgdgˇ t  dtjdtjddŤd	d
Ťˇ t  dˇ t jt  dˇddgddŤ t  d dddgdgˇ t  dtjdtjddŤd	d
Ťˇ t  dˇ t jt  dˇddgddŤ t  d dddgdgˇ t  d tjdtjddŤd	d
Ťˇ t  d!ˇ t jt  d"ˇd dgddŤ t  d d ddgdgˇ t  d#tjdtjddŤd	d
Ťˇ t  d$ˇ t jt  d%ˇd#dgddŤ t  d d#ddgdgˇ t  d&tjdtjddŤd	d
Ťˇ t  d'ˇ t jt  d(ˇd&dgddŤ t  d d&ddgdgˇ t  d)tjdtjddŤd	d
Ťˇ t  d*ˇ t jt  d+ˇd)dgddŤ t  d d)ddgdgˇ t  d,tjdtjddŤd	d
Ťˇ t  d-ˇ t jt  d.ˇd,dgddŤ t  d d,ddgdgˇ t  d/tjdtjddŤd	d
Ťˇ t  d0ˇ t jt  d1ˇd/dgddŤ t  d d/ddgdgˇ t  d2tjd3tjddŤd	d
Ťˇ t  d4ˇ t jt  d5ˇd2d3gddŤ t  d6tjdtjddŤd	d
Ťˇ t  d7ˇ t jt  d8ˇd6dgddŤ t  d d6ddgdgˇ t  d9tjdtjddŤd	d
Ťˇ t  d:ˇ t jt  d;ˇd9dgddŤ t  d d9ddgdgˇ t  d<tjdtjddŤd	d
Ťˇ t  d=ˇ t jt  d>ˇd<dgddŤ t  d d<ddgdgˇ t  d?tjdtjddŤd	d
Ťˇ t  d@ˇ t jt  dAˇd?dgddŤ t  d d?ddgdgˇ t  dBtjdtjddŤd	d
Ťˇ t  dCˇ t jt  dDˇdBdgddŤ t  d dBddgdgˇ t  dEtjdtjddŤd	d
Ťˇ t  dFˇ t jt  dGˇdEdgddŤ t  d dEddgdgˇ t  dHtjdtjddŤd	d
Ťˇ t  dIˇ t jt  dJˇdHdgddŤ t  d dHddgdgˇ t  dKtjdtjddŤd	d
Ťˇ t  dLˇ t jt  dMˇdKdgddŤ t  d dKddgdgˇ t  dtjdtjddŤd	d
Ťˇ t  dNˇ t jt  dOˇddgddŤ t  d dddgdgˇ t  dPtjdtjddŤd	d
Ťˇ t  dQˇ t jt  dRˇdPdgddŤ t  d dPddgdgˇ t  dStjdtjddŤd	d
Ťˇ t  dTˇ t jt  dUˇdSdgddŤ t  d dSddgdgˇ t  dVtjdtjddŤd	d
Ťˇ t  dWˇ t jt  dXˇdVdgddŤ t  d dVddgdgˇ t  dYtjdtjddŤd	d
Ťˇ t  dZˇ t jt  d[ˇdYdgddŤ t  d dYddgdgˇ t  d\tjdtjddŤd	d
Ťˇ t  d]ˇ t jt  d^ˇd\dgddŤ t  d d\ddgdgˇ t  d_tjdtjddŤd	d
Ťˇ t  d`ˇ t jt  daˇd_dgddŤ t  d d_ddgdgˇ t  dbtjdtjddŤd	d
Ťˇ t  dcˇ t jt  ddˇdbdgddŤ t  d dbddgdgˇ t  detjdtjddŤd	d
Ťˇ t  dfˇ t jt  dgˇdedgddŤ t  d deddgdgˇ t  dhtjdtjddŤd	d
Ťˇ t  diˇ t jt  djˇdhdgddŤ t  d dhddgdgˇ t  dktjdtjddŤd	d
Ťˇ t  dlˇ t jt  dmˇdkdgddŤ t  d dkddgdgˇ t  dntjdtjddŤd	d
Ťˇ t  doˇ t jt  dpˇdndgddŤ t  d dnddgdgˇ t  dqtjdtjddŤd	d
Ťˇ t  drˇ t jt  dsˇdqdgddŤ t  d dqddgdgˇ t  dttjdtjddŤd	d
Ťˇ t  duˇ t jt  dvˇdtdgddŤ t  d dtddgdgˇ t  dwtjdtjddŤd	d
Ťˇ t  dxˇ t jt  dyˇdwdgddŤ t  d dwddgdgˇ t  dztjdtjddŤd	d
Ťˇ t  d{ˇ t jt  d|ˇdzdgddŤ t  d dzddgdgˇ d S )}N)$Úcmf_answer_templateÚ	cmf_assetÚcmf_attachmentÚcmf_chat_groupÚcmf_chat_topicÚcmf_commentÚcmf_companyÚcmf_componentÚcmf_dashboardÚcmf_dealÚcmf_documentÚ
cmf_folderÚ
cmf_importÚcmf_invoiceÚcmf_kanban_boardÚcmf_leadÚcmf_listÚcmf_mail_handlerÚcmf_paymentÚcmf_pipelineÚcmf_projectÚcmf_purchase_orderÚcmf_purchase_order_itemsÚcmf_roadmapÚcmf_scheme_wfÚcmf_stock_incoming_orderÚcmf_stock_initialÚcmf_stock_inventoryÚcmf_stock_moveÚcmf_stock_outcoming_orderÚcmf_taskÚcmf_task_filterÚcmf_task_queueÚcmf_task_reportÚcmf_time_tracker_historyÚcmf_u_work_postzupdate zx set root_parent_id=null where root_parent_id like 'CmfProject:%' and root_parent_id not in (select id from cmf_project)zšupdate cmf_full_search set obj_root_parent_id=null where obj_root_parent_id like 'CmfProject:%' and obj_root_parent_id not in (select id from cmf_project)r   Ú
project_idé@   )ÚlengthT)Únullablezaupdate cmf_answer_template set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Ú!ix_cmf_answer_template_project_idF)Úuniquer   Úidr   zWupdate cmf_asset set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_asset_project_idr   z\update cmf_attachment set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_attachment_project_idr	   z\update cmf_chat_group set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_chat_group_project_idr
   z\update cmf_chat_topic set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_chat_topic_project_idr   zYupdate cmf_comment set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_comment_project_idr   zYupdate cmf_company set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_company_project_idr   z[update cmf_component set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_component_project_idr   z[update cmf_dashboard set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_dashboard_project_idr   zVupdate cmf_deal set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_deal_project_idr   zZupdate cmf_document set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_document_project_idr   zXupdate cmf_folder set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_folder_project_idÚcmf_full_searchÚobj_project_idziupdate cmf_full_search set obj_project_id=obj_root_parent_id where obj_root_parent_id like 'CmfProject:%'Ú!ix_cmf_full_search_obj_project_idr   zXupdate cmf_import set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_import_project_idr   zYupdate cmf_invoice set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_invoice_project_idr   z^update cmf_kanban_board set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_kanban_board_project_idr   zVupdate cmf_lead set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_lead_project_idr   zVupdate cmf_list set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_list_project_idr   z^update cmf_mail_handler set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_mail_handler_project_idr   zYupdate cmf_payment set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_payment_project_idr   zZupdate cmf_pipeline set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_pipeline_project_idzYupdate cmf_project set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_project_project_idr   z`update cmf_purchase_order set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Ú ix_cmf_purchase_order_project_idr   zfupdate cmf_purchase_order_items set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Ú&ix_cmf_purchase_order_items_project_idr   zYupdate cmf_roadmap set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_roadmap_project_idr   z[update cmf_scheme_wf set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_scheme_wf_project_idr   zfupdate cmf_stock_incoming_order set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Ú&ix_cmf_stock_incoming_order_project_idr    z_update cmf_stock_initial set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_stock_initial_project_idr!   zaupdate cmf_stock_inventory set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Ú!ix_cmf_stock_inventory_project_idr"   z\update cmf_stock_move set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_stock_move_project_idr#   zgupdate cmf_stock_outcoming_order set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Ú'ix_cmf_stock_outcoming_order_project_idr$   zVupdate cmf_task set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_task_project_idr%   z]update cmf_task_filter set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_task_filter_project_idr&   z\update cmf_task_queue set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_task_queue_project_idr'   z]update cmf_task_report set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_task_report_project_idr(   zfupdate cmf_time_tracker_history set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Ú&ix_cmf_time_tracker_history_project_idr)   z]update cmf_u_work_post set project_id=root_parent_id where root_parent_id like 'CmfProject:%'Úix_cmf_u_work_post_project_id)	r   ÚexecuteÚ
add_columnÚsaÚColumnÚStringÚcreate_indexÚfÚcreate_foreign_key©Ú
table_name© ra   ú5/opt/eva-app/alembic/versions/af18a0280adf_project.pyÚupgrade   s,   	
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
rc   c                   C   sä  t jd dddŤ t jt  dˇddŤ t  ddˇ t jd dddŤ t jt  dˇddŤ t  ddˇ t jd d	ddŤ t jt  d
ˇd	dŤ t  d	dˇ t jd dddŤ t jt  dˇddŤ t  ddˇ t jd dddŤ t jt  dˇddŤ t  ddˇ t jd dddŤ t jt  dˇddŤ t  ddˇ t jd dddŤ t jt  dˇddŤ t  ddˇ t jd dddŤ t jt  dˇddŤ t  ddˇ t jd dddŤ t jt  dˇddŤ t  ddˇ t jd dddŤ t jt  dˇddŤ t  ddˇ t jd dddŤ t jt  dˇddŤ t  ddˇ t jd dddŤ t jt  dˇddŤ t  ddˇ t jd dddŤ t jt  dˇddŤ t  ddˇ t jd dddŤ t jt  d ˇddŤ t  ddˇ t jd d!ddŤ t jt  d"ˇd!dŤ t  d!dˇ t jd d#ddŤ t jt  d$ˇd#dŤ t  d#dˇ t jd d%ddŤ t jt  d&ˇd%dŤ t  d%dˇ t jd d'ddŤ t jt  d(ˇd'dŤ t  d'dˇ t jd d)ddŤ t jt  d*ˇd)dŤ t  d)dˇ t jd d+ddŤ t jt  d,ˇd+dŤ t  d+dˇ t jd d-ddŤ t jt  d.ˇd-dŤ t  d-dˇ t jd d/ddŤ t jt  d0ˇd/dŤ t  d/dˇ t jd d1ddŤ t jt  d2ˇd1dŤ t  d1dˇ t jd d3ddŤ t jt  d4ˇd3dŤ t  d3dˇ t jt  d5ˇd6dŤ t  d6d7ˇ t jd d8ddŤ t jt  d9ˇd8dŤ t  d8dˇ t jd d:ddŤ t jt  d;ˇd:dŤ t  d:dˇ t jd d<ddŤ t jt  d=ˇd<dŤ t  d<dˇ t jd d>ddŤ t jt  d?ˇd>dŤ t  d>dˇ t jd d@ddŤ t jt  dAˇd@dŤ t  d@dˇ t jd dBddŤ t jt  dCˇdBdŤ t  dBdˇ t jd dDddŤ t jt  dEˇdDdŤ t  dDdˇ t jd dFddŤ t jt  dGˇdFdŤ t  dFdˇ t jd dHddŤ t jt  dIˇdHdŤ t  dHdˇ t jd dJddŤ t jt  dKˇdJdŤ t  dJdˇ t jd dLddŤ t jt  dMˇdLdŤ t  dLdˇ t jd dNddŤ t jt  dOˇdNdŤ t  dNdˇ d S )PNr)   Ú
foreignkey)Útype_rV   r_   r*   r(   rU   r'   rT   r&   rS   r%   rR   r$   rQ   r#   rP   r"   rO   r!   rN   r    rM   r   rL   r   rK   r   rJ   r   rI   r   rH   r   rG   r   rF   r   rE   r   rD   r   rC   r   rB   r   rA   r   r@   r   r?   r>   r<   r=   r   r;   r   r:   r   r9   r   r8   r   r7   r   r6   r   r5   r
   r4   r	   r3   r   r2   r   r1   r   r.   )r   Údrop_constraintÚ
drop_indexr]   Údrop_columnra   ra   ra   rb   Ú	downgrade¶   sÜ    ri   )Ú__doc__Úalembicr   Ú
sqlalchemyrY   Zsqlalchemy.dialectsr   ÚrevisionÚdown_revisionÚbranch_labelsÚ
depends_onrc   ri   ra   ra   ra   rb   Ú<module>   s    $