U
    \ÚdB%  ã                   @   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 )zhchat_messages

Revision ID: c1fb20145a41
Revises: 5c86366d5292
Create Date: 2021-11-09 15:43:22.985835

é    )ÚopN)Ú
postgresqlZc1fb20145a41Z5c86366d5292c                    C   sB  t  dtjdtjddddtjdtjdd	ddtjd
tjdd	ddtjdtjdd	ddtjdtjdd	ddtjdt ¡ ddtjdt ¡ ddtjdt ¡ ddtjdt ¡ ddtjdt ¡ ddtjdt ¡ ddtjdt ¡ ddtjdt ¡ ddtjdtjddddtjdtjddddtjdtjddddtjdtjddddtjdtjddddtjdtjddddtjdtjddddtjdtjddddtjdtjddddtjdtjddddtjd tjddddt 	dgd!g¡t 	d gd"g¡t 
d¡¡ t jt  d#¡ddgdd$ t jt  d%¡ddgdd$ t jt  d&¡ddgdd$ t jt  d'¡dd
gdd$ t jt  d(¡ddgdd$ t jt  d)¡ddgdd$ t jt  d*¡ddgdd$ t jt  d+¡ddgdd$ t jt  d,¡ddgdd$ t jt  d-¡ddgdd$ t jt  d.¡ddgdd$ t jt  d/¡ddgdd$ t jt  d0¡ddgdd$ t jt  d1¡ddgdd$ t jt  d2¡dd gdd$ t jt  d3¡ddgdd$ t jt  d4¡ddgdd$ t  d5tjdtjddddtjd6tjddddtjd7tjddddtjd8tjddddt 	d6gd9g¡t 	d8gd:g¡t 	d7gd;g¡t 
d¡¡	 t jt  d<¡d5d6gdd$ t jt  d=¡d5d8gdd$ t jt  d>¡d5d7gdd$ t jd?d@dA t jdBd@dA t jdCd@dA t  d@¡ t  dDtjdEtjdddd¡ t jt  dF¡dDdEgdd$ t  d dDddEgdg¡ d S )GNÚcmf_chat_messageÚidé@   ©ÚlengthF)ÚnullableZcmf_locked_atT)ÚtimezoneZcmf_created_atZcmf_modified_atZcmf_viewed_atZcmf_deletedZcmf_versionÚtextZlikesÚviewsZ	importantÚpriorityZpinnedZcache_cmf_author_loginZcache_cmf_author_nameé   Zcache_cmf_author_codeZcmf_author_idZcmf_owner_idZcmf_owner_assistant_idÚ	parent_idZcmf_modified_by_idZcmf_locked_by_idZdeal_idZlead_idzcmf_deal.idzcmf_lead.idÚ)ix_cmf_chat_message_cache_cmf_author_code©ÚuniqueÚ)ix_cmf_chat_message_cache_cmf_author_nameÚ!ix_cmf_chat_message_cmf_author_idÚ"ix_cmf_chat_message_cmf_created_atÚix_cmf_chat_message_cmf_deletedÚ!ix_cmf_chat_message_cmf_locked_atÚ$ix_cmf_chat_message_cmf_locked_by_idÚ#ix_cmf_chat_message_cmf_modified_atÚ&ix_cmf_chat_message_cmf_modified_by_idÚ*ix_cmf_chat_message_cmf_owner_assistant_idÚ ix_cmf_chat_message_cmf_owner_idÚix_cmf_chat_message_cmf_versionÚ!ix_cmf_chat_message_cmf_viewed_atÚix_cmf_chat_message_deal_idÚix_cmf_chat_message_lead_idÚix_cmf_chat_message_parent_idÚix_cmf_chat_message_pinnedÚcmf_chat_topic_unread_messageÚchat_topic_idÚ	person_idZ
message_idúcmf_chat_topic.idzcmf_chat_message.idúcmf_person.idÚ.ix_cmf_chat_topic_unread_message_chat_topic_idÚ+ix_cmf_chat_topic_unread_message_message_idÚ*ix_cmf_chat_topic_unread_message_person_idÚ.ix_cmf_chat_topic_unread_comment_chat_topic_idÚcmf_chat_topic_unread_comment©Ú
table_nameÚ+ix_cmf_chat_topic_unread_comment_comment_idÚ*ix_cmf_chat_topic_unread_comment_person_idÚcmf_channel_messageÚchat_message_idÚ&ix_cmf_channel_message_chat_message_id)r   Úcreate_tableÚsaÚColumnÚStringÚ	TIMESTAMPÚBooleanÚIntegerÚTEXTÚForeignKeyConstraintÚPrimaryKeyConstraintÚcreate_indexÚfÚ
drop_indexÚ
drop_tableÚ
add_columnÚcreate_foreign_key© rD   rD   ú;/opt/eva-app/alembic/versions/c1fb20145a41_chat_messages.pyÚupgrade   s„    åø

 rF   c                   C   sÀ  t jd ddd t jt  d¡dd t  dd¡ t  dtjdtjd	d
dddtjdtjd	d
dddtjdtjd	d
dddtjdtjd	d
dddtj	dgdgddtj	dgdgddtj	dgdgddtj
ddd¡	 t jdddgdd t jdddgdd t jdddgdd t jt  d¡dd t jt  d¡dd t jt  d¡dd t  d¡ t jt  d ¡d!d t jt  d"¡d!d t jt  d#¡d!d t jt  d$¡d!d t jt  d%¡d!d t jt  d&¡d!d t jt  d'¡d!d t jt  d(¡d!d t jt  d)¡d!d t jt  d*¡d!d t jt  d+¡d!d t jt  d,¡d!d t jt  d-¡d!d t jt  d.¡d!d t jt  d/¡d!d t jt  d0¡d!d t jt  d1¡d!d t  d!¡ d S )2Nr1   Ú
foreignkey)Útype_r3   r-   r2   r,   r   r   r   F)Úautoincrementr	   r$   r%   Z
comment_idr&   Z0cmf_chat_topic_unread_comment_chat_topic_id_fkey)Únamezcmf_comment.idZ-cmf_chat_topic_unread_comment_comment_id_fkeyr'   Z,cmf_chat_topic_unread_comment_person_id_fkeyZ"cmf_chat_topic_unread_comment_pkeyr0   r   r/   r+   r*   r#   r)   r(   r"   r   r!   r    r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   Údrop_constraintr@   r?   Údrop_columnr4   r5   r6   ÚVARCHARr<   r=   r>   rA   rD   rD   rD   rE   Ú	downgradeZ   sL    ø

rN   )Ú__doc__Úalembicr   Ú
sqlalchemyr5   Zsqlalchemy.dialectsr   ÚrevisionÚdown_revisionÚbranch_labelsÚ
depends_onrF   rN   rD   rD   rD   rE   Ú<module>   s   G