a
    žwÍi$  ã                   @   s<   d Z ddlmZ ddlZdZdZdZdZdd„ Z	dd„ Z
dS )	z]initial schema

Revision ID: 851d54415f73
Revises: 
Create Date: 2026-04-01 19:53:02.835586

é    )ÚopNZ851d54415f73c                  C   s  t  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 ¡ 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jd	dddtjdtjd	dddtjdt 	¡ ddt 
d¡t d¡¡ t  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 ¡ ddt 
d¡¡ t jdd d(} | j|  d¡dgdd W d   ƒ n1 sÒ0    Y  t  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 ¡ 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 	¡ ddtjd(tjd)dddtjdt ¡ ddt dgd*g¡t 
d¡¡ t  d+tjdt ¡ 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d0t 	¡ ddtjd!t ¡ ddtjd"t ¡ ddtjd1t 	¡ ddtjd2t 	¡ ddtjd3tjd)dddtjd4tjd	dddtjd5t ¡ ddtjd6t ¡ ddtjd7t ¡ ddtjd8t 	¡ ddtjd9t 	¡ ddtjdt ¡ ddt d/gd:g¡t d.gd;g¡t dgd*g¡t 
d¡t d,¡¡ t  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 ¡ ddtjd?t ¡ ddtjd@t ¡ ddtjdAt 	¡ ddtjdBt ¡ ddtjdCt ¡ ddtjdDt ¡ ddt d.gd;g¡t 
d¡¡ t jd<d dJ} | jdEd.d=gdd | jdFd.gdd | jdGd.d>gdd W d   ƒ n1 sô0    Y  d S )HNÚanalysis_typesÚidF)ÚnullableÚslugé2   )ÚlengthÚnameéÿ   ÚdescriptionTÚcategoryÚ	min_fixesÚmin_animalsÚmin_duration_hoursÚrequires_regular_samplingÚpython_moduleÚpython_functionÚdefault_paramsÚusersÚemailÚpassword_hashÚinstitutionÚ
created_at©ÚschemaÚix_users_email)ÚuniqueÚdatasetsÚuser_idÚoriginal_filenameÚnum_animalsÚ	num_fixesÚ
time_startÚtime_endÚbbox_min_latÚbbox_min_lonÚbbox_max_latÚbbox_max_lonÚcolumn_mappingÚupload_statusé   zusers.idÚanalysis_runsÚuuidé$   Ú
dataset_idÚanalysis_type_idÚ
animal_idsÚbboxÚparamsÚstatusÚcelery_task_idÚ
started_atÚcompleted_atÚerror_messageÚresult_summaryÚresult_artifactszanalysis_types.idzdatasets.idÚdata_pointsÚ	animal_idÚ	timestampÚlatÚlonÚsensor_dataÚspeedÚstep_lengthÚturning_angleÚidx_dp_animalÚidx_dp_datasetÚidx_dp_time)r   Úcreate_tableÚsaÚColumnÚIntegerÚStringÚTextÚFloatÚBooleanÚJSONÚPrimaryKeyConstraintÚUniqueConstraintÚDateTimeÚbatch_alter_tableÚcreate_indexÚfÚForeignKeyConstraintÚ
BigInteger©Úbatch_op© rY   úh/home/japhy/trackingScienceReplication.artiswrong.com/migrations/versions/851d54415f73_initial_schema.pyÚupgrade   s´    òù	8îéôr[   c                  C   sÀ   t jdd d.} |  d¡ |  d¡ |  d¡ W d   ƒ n1 sB0    Y  t  d¡ t  d¡ t  d¡ t jdd d } |  |  d	¡¡ W d   ƒ n1 sž0    Y  t  d¡ t  d
¡ d S )Nr:   r   rE   rD   rC   r+   r   r   r   r   )r   rR   Ú
drop_indexÚ
drop_tablerT   rW   rY   rY   rZ   Ú	downgradet   s    

(


.
r^   )Ú__doc__Úalembicr   Ú
sqlalchemyrG   ÚrevisionÚdown_revisionÚbranch_labelsÚ
depends_onr[   r^   rY   rY   rY   rZ   Ú<module>   s   a