55from sqlalchemy import BigInteger , Boolean , Column , Date , DateTime , Float , ForeignKey , Integer , String , case
66from sqlalchemy .dialects import mysql , postgresql , sqlite
77from sqlalchemy .orm import relationship
8-
98Base = modelBase .Base
109
1110BigIntegerType = BigInteger ()
1211BigIntegerType = BigIntegerType .with_variant (sqlite .INTEGER (), 'sqlite' )
1312BigIntegerType = BigIntegerType .with_variant (postgresql .BIGINT (), 'postgresql' )
1413BigIntegerType = BigIntegerType .with_variant (mysql .BIGINT (), 'mysql' )
1514
15+ DateTimeType = DateTime ()
16+ DateTimeType = DateTimeType .with_variant (sqlite .INTEGER (), 'sqlite' )
17+
1618
1719def is_hex (s ):
1820 try :
@@ -404,9 +406,9 @@ class Results(Base):
404406 ProcessingLevelID = Column ('processinglevelid' , ForeignKey (ProcessingLevels .ProcessingLevelID ),
405407 nullable = False )
406408 ResultDateTime = Column ('resultdatetime' , DateTime )
407- ResultDateTimeUTCOffset = Column ('resultdatetimeutcoffset' , BigInteger )
409+ ResultDateTimeUTCOffset = Column ('resultdatetimeutcoffset' , BigIntegerType )
408410 ValidDateTime = Column ('validdatetime' , DateTime )
409- ValidDateTimeUTCOffset = Column ('validdatetimeutcoffset' , BigInteger )
411+ ValidDateTimeUTCOffset = Column ('validdatetimeutcoffset' , BigIntegerType )
410412 StatusCV = Column ('statuscv' , ForeignKey (CVStatus .Name ), index = True )
411413 SampledMediumCV = Column ('sampledmediumcv' , ForeignKey (CVMediumType .Name ), nullable = False , index = True )
412414 ValueCount = Column ('valuecount' , Integer , nullable = False )
@@ -503,7 +505,7 @@ class InstrumentOutputVariables(Base):
503505class DataLoggerFileColumns (Base ):
504506
505507 DataLoggerFileColumnID = Column ('dataloggerfilecolumnid' , Integer , primary_key = True , nullable = False )
506- ResultID = Column ('resultid' , BigInteger , ForeignKey (Results .ResultID ))
508+ ResultID = Column ('resultid' , BigIntegerType , ForeignKey (Results .ResultID ))
507509 DataLoggerFileID = Column ('dataloggerfileid' , Integer ,
508510 ForeignKey (DataLoggerFiles .DataLoggerFileID ), nullable = False )
509511 InstrumentOutputVariableID = Column ('instrumentoutputvariableid' , Integer ,
@@ -861,7 +863,7 @@ class ActionAnnotations(Base):
861863class EquipmentAnnotations (Base ):
862864
863865 BridgeID = Column ('bridgeid' , Integer , primary_key = True , nullable = False )
864- EquipmentID = Column ('valueid' , BigInteger , ForeignKey (Equipment .EquipmentID ), nullable = False )
866+ EquipmentID = Column ('valueid' , BigIntegerType , ForeignKey (Equipment .EquipmentID ), nullable = False )
865867 AnnotationID = Column ('annotationid' , ForeignKey (Annotations .AnnotationID ), nullable = False )
866868
867869 AnnotationObj = relationship (Annotations )
@@ -1640,7 +1642,7 @@ class CategoricalResultValues(Base):
16401642 ValueID = Column ('valueid' , BigIntegerType , primary_key = True )
16411643 ResultID = Column ('resultid' , ForeignKey (CategoricalResults .ResultID ), nullable = False )
16421644 DataValue = Column ('datavalue' , String (255 ), nullable = False )
1643- ValueDateTime = Column ('valuedatetime' , DateTime , nullable = False )
1645+ ValueDateTime = Column ('valuedatetime' , DateTimeType , nullable = False )
16441646 ValueDateTimeUTCOffset = Column ('valuedatetimeutcoffset' , Integer , nullable = False )
16451647
16461648 ResultObj = relationship (CategoricalResults )
@@ -1651,7 +1653,7 @@ class MeasurementResultValues(Base):
16511653 ValueID = Column ('valueid' , BigIntegerType , primary_key = True )
16521654 ResultID = Column ('resultid' , ForeignKey (MeasurementResults .ResultID ), nullable = False )
16531655 DataValue = Column ('datavalue' , Float (53 ), nullable = False )
1654- ValueDateTime = Column ('valuedatetime' , DateTime , nullable = False )
1656+ ValueDateTime = Column ('valuedatetime' , DateTimeType , nullable = False )
16551657 ValueDateTimeUTCOffset = Column ('valuedatetimeutcoffset' , Integer , nullable = False )
16561658
16571659 ResultObj = relationship (MeasurementResults )
@@ -1661,8 +1663,8 @@ class PointCoverageResultValues(Base):
16611663
16621664 ValueID = Column ('valueid' , BigIntegerType , primary_key = True )
16631665 ResultID = Column ('resultid' , ForeignKey (PointCoverageResults .ResultID ), nullable = False )
1664- DataValue = Column ('datavalue' , BigInteger , nullable = False )
1665- ValueDateTime = Column ('valuedatetime' , DateTime , nullable = False )
1666+ DataValue = Column ('datavalue' , BigIntegerType , nullable = False )
1667+ ValueDateTime = Column ('valuedatetime' , DateTimeType , nullable = False )
16661668 ValueDateTimeUTCOffset = Column ('valuedatetimeutcoffset' , Integer , nullable = False )
16671669 XLocation = Column ('xlocation' , Float (53 ), nullable = False )
16681670 XLocationUnitsID = Column ('xlocationunitsid' , ForeignKey (Units .UnitsID ), nullable = False )
@@ -1687,7 +1689,7 @@ class ProfileResultValues(Base):
16871689 ValueID = Column ('valueid' , BigIntegerType , primary_key = True )
16881690 ResultID = Column ('resultid' , ForeignKey (ProfileResults .ResultID ), nullable = False )
16891691 DataValue = Column ('datavalue' , Float (53 ), nullable = False )
1690- ValueDateTime = Column ('valuedatetime' , DateTime , nullable = False )
1692+ ValueDateTime = Column ('valuedatetime' , DateTimeType , nullable = False )
16911693 ValueDateTimeUTCOffset = Column ('valuedatetimeutcoffset' , Integer , nullable = False )
16921694 ZLocation = Column ('zlocation' , Float (53 ), nullable = False )
16931695 ZAggregationInterval = Column ('zaggregationinterval' , Float (53 ), nullable = False )
@@ -1714,12 +1716,12 @@ class SectionResultValues(Base):
17141716 ValueID = Column ('valueid' , BigIntegerType , primary_key = True )
17151717 ResultID = Column ('resultid' , ForeignKey (SectionResults .ResultID ), nullable = False )
17161718 DataValue = Column ('datavalue' , Float (53 ), nullable = False )
1717- ValueDateTime = Column ('valuedatetime' , BigInteger , nullable = False )
1718- ValueDateTimeUTCOffset = Column ('valuedatetimeutcoffset' , BigInteger , nullable = False )
1719+ ValueDateTime = Column ('valuedatetime' , DateTimeType , nullable = False )
1720+ ValueDateTimeUTCOffset = Column ('valuedatetimeutcoffset' , Integer , nullable = False )
17191721 XLocation = Column ('xlocation' , Float (53 ), nullable = False )
17201722 XAggregationInterval = Column ('xaggregationinterval' , Float (53 ), nullable = False )
17211723 XLocationUnitsID = Column ('xlocationunitsid' , ForeignKey (Units .UnitsID ), nullable = False )
1722- ZLocation = Column ('zlocation' , BigInteger , nullable = False )
1724+ ZLocation = Column ('zlocation' , BigIntegerType , nullable = False )
17231725 ZAggregationInterval = Column ('zaggregationinterval' , Float (53 ), nullable = False )
17241726 ZLocationUnitsID = Column ('zlocationunitsid' , ForeignKey (Units .UnitsID ), nullable = False )
17251727 CensorCodeCV = Column ('censorcodecv' , ForeignKey (CVCensorCode .Name ), nullable = False , index = True )
@@ -1750,7 +1752,7 @@ class SpectraResultValues(Base):
17501752 ValueID = Column ('valueid' , BigIntegerType , primary_key = True )
17511753 ResultID = Column ('resultid' , ForeignKey (SpectraResults .ResultID ), nullable = False )
17521754 DataValue = Column ('datavalue' , Float (53 ), nullable = False )
1753- ValueDateTime = Column ('valuedatetime' , DateTime , nullable = False )
1755+ ValueDateTime = Column ('valuedatetime' , DateTimeType , nullable = False )
17541756 ValueDateTimeUTCOffset = Column ('valuedatetimeutcoffset' , Integer , nullable = False )
17551757 ExcitationWavelength = Column ('excitationwavelength' , Float (53 ), nullable = False )
17561758 EmissionWavelength = Column ('emmistionwavelength' , Float (53 ), nullable = False )
@@ -1779,7 +1781,7 @@ class TimeSeriesResultValues(Base):
17791781 ValueID = Column ('valueid' , BigIntegerType , primary_key = True )
17801782 ResultID = Column ('resultid' , ForeignKey (TimeSeriesResults .ResultID ), nullable = False )
17811783 DataValue = Column ('datavalue' , Float (53 ), nullable = False )
1782- ValueDateTime = Column ('valuedatetime' , DateTime , nullable = False )
1784+ ValueDateTime = Column ('valuedatetime' , DateTimeType , nullable = False )
17831785 ValueDateTimeUTCOffset = Column ('valuedatetimeutcoffset' , Integer , nullable = False )
17841786 CensorCodeCV = Column ('censorcodecv' , ForeignKey (CVCensorCode .Name ), nullable = False , index = True )
17851787 QualityCodeCV = Column ('qualitycodecv' , ForeignKey (CVQualityCode .Name ), nullable = False , index = True )
@@ -1805,7 +1807,7 @@ class TrajectoryResultValues(Base):
18051807 ValueID = Column ('valueid' , BigIntegerType , primary_key = True )
18061808 ResultID = Column ('resultid' , ForeignKey (TrajectoryResults .ResultID ), nullable = False )
18071809 DataValue = Column ('datavalue' , Float (53 ), nullable = False )
1808- ValueDateTime = Column ('valuedatetime' , DateTime , nullable = False )
1810+ ValueDateTime = Column ('valuedatetime' , DateTimeType , nullable = False )
18091811 ValueDateTimeUTCOffset = Column ('valuedatetimeutcoffset' , Integer , nullable = False )
18101812 XLocation = Column ('xlocation' , Float (53 ), nullable = False )
18111813 XLocationUnitsID = Column ('xlocationunitsid' , ForeignKey (Units .UnitsID ), nullable = False )
@@ -1850,8 +1852,8 @@ class TransectResultValues(Base):
18501852 ValueID = Column ('valueid' , BigIntegerType , primary_key = True )
18511853 ResultID = Column ('resultid' , ForeignKey (TransectResults .ResultID ), nullable = False )
18521854 DataValue = Column ('datavalue' , Float (53 ), nullable = False )
1853- ValueDateTime = Column ('valuedatetime' , DateTime , nullable = False )
1854- ValueDateTimeUTCOffset = Column ('valuedatetimeutcoffset' , DateTime , nullable = False )
1855+ ValueDateTime = Column ('valuedatetime' , DateTimeType , nullable = False )
1856+ ValueDateTimeUTCOffset = Column ('valuedatetimeutcoffset' , Integer , nullable = False )
18551857 XLocation = Column ('xlocation' , Float (53 ), nullable = False )
18561858 XLocationUnitsID = Column ('xlocationunitsid' , ForeignKey (Units .UnitsID ), nullable = False )
18571859 YLocation = Column ('ylocation' , Float (53 ), nullable = False )
@@ -1896,7 +1898,7 @@ class TransectResultValues(Base):
18961898class CategoricalResultValueAnnotations (Base ):
18971899
18981900 BridgeID = Column ('bridgeid' , Integer , primary_key = True , nullable = False )
1899- ValueID = Column ('valueid' , BigInteger , ForeignKey (CategoricalResultValues .ValueID ), nullable = False )
1901+ ValueID = Column ('valueid' , BigIntegerType , ForeignKey (CategoricalResultValues .ValueID ), nullable = False )
19001902 AnnotationID = Column ('annotationid' , ForeignKey (Annotations .AnnotationID ), nullable = False )
19011903
19021904 AnnotationObj = relationship (Annotations )
@@ -1906,7 +1908,7 @@ class CategoricalResultValueAnnotations(Base):
19061908class MeasurementResultValueAnnotations (Base ):
19071909
19081910 BridgeID = Column ('bridgeid' , Integer , primary_key = True , nullable = False )
1909- ValueID = Column ('valueid' , BigInteger , ForeignKey (MeasurementResultValues .ValueID ), nullable = False )
1911+ ValueID = Column ('valueid' , BigIntegerType , ForeignKey (MeasurementResultValues .ValueID ), nullable = False )
19101912 AnnotationID = Column ('annotationid' , ForeignKey (Annotations .AnnotationID ), nullable = False )
19111913
19121914 AnnotationObj = relationship (Annotations )
@@ -1916,7 +1918,7 @@ class MeasurementResultValueAnnotations(Base):
19161918class PointCoverageResultValueAnnotations (Base ):
19171919
19181920 BridgeID = Column ('bridgeid' , Integer , primary_key = True , nullable = False )
1919- ValueID = Column ('valueid' , BigInteger , ForeignKey (PointCoverageResultValues .ValueID ), nullable = False )
1921+ ValueID = Column ('valueid' , BigIntegerType , ForeignKey (PointCoverageResultValues .ValueID ), nullable = False )
19201922 AnnotationID = Column ('annotationid' , ForeignKey (Annotations .AnnotationID ), nullable = False )
19211923
19221924 AnnotationObj = relationship (Annotations )
@@ -1926,7 +1928,7 @@ class PointCoverageResultValueAnnotations(Base):
19261928class ProfileResultValueAnnotations (Base ):
19271929
19281930 BridgeID = Column ('bridgeid' , Integer , primary_key = True , nullable = False )
1929- ValueID = Column ('valueid' , BigInteger , ForeignKey (ProfileResultValues .ValueID ), nullable = False )
1931+ ValueID = Column ('valueid' , BigIntegerType , ForeignKey (ProfileResultValues .ValueID ), nullable = False )
19301932 AnnotationID = Column ('annotationid' , ForeignKey (Annotations .AnnotationID ), nullable = False )
19311933
19321934 AnnotationObj = relationship (Annotations )
@@ -1936,7 +1938,7 @@ class ProfileResultValueAnnotations(Base):
19361938class SectionResultValueAnnotations (Base ):
19371939
19381940 BridgeID = Column ('bridgeid' , Integer , primary_key = True , nullable = False )
1939- ValueID = Column ('valueid' , BigInteger , ForeignKey (SectionResultValues .ValueID ), nullable = False )
1941+ ValueID = Column ('valueid' , BigIntegerType , ForeignKey (SectionResultValues .ValueID ), nullable = False )
19401942 AnnotationID = Column ('annotationid' , ForeignKey (Annotations .AnnotationID ), nullable = False )
19411943
19421944 AnnotationObj = relationship (Annotations )
@@ -1946,7 +1948,7 @@ class SectionResultValueAnnotations(Base):
19461948class SpectraResultValueAnnotations (Base ):
19471949
19481950 BridgeID = Column ('bridgeid' , Integer , primary_key = True , nullable = False )
1949- ValueID = Column ('valueid' , BigInteger , ForeignKey (SpectraResultValues .ValueID ), nullable = False )
1951+ ValueID = Column ('valueid' , BigIntegerType , ForeignKey (SpectraResultValues .ValueID ), nullable = False )
19501952 AnnotationID = Column ('annotationid' , ForeignKey (Annotations .AnnotationID ), nullable = False )
19511953
19521954 AnnotationObj = relationship (Annotations )
@@ -1956,7 +1958,7 @@ class SpectraResultValueAnnotations(Base):
19561958class TimeSeriesResultValueAnnotations (Base ):
19571959
19581960 BridgeID = Column ('bridgeid' , Integer , primary_key = True , nullable = False )
1959- ValueID = Column ('valueid' , BigInteger , ForeignKey (TimeSeriesResultValues .ValueID ), nullable = False )
1961+ ValueID = Column ('valueid' , BigIntegerType , ForeignKey (TimeSeriesResultValues .ValueID ), nullable = False )
19601962 AnnotationID = Column ('annotationid' , ForeignKey (Annotations .AnnotationID ), nullable = False )
19611963
19621964 AnnotationObj = relationship (Annotations )
@@ -1966,7 +1968,7 @@ class TimeSeriesResultValueAnnotations(Base):
19661968class TrajectoryResultValueAnnotations (Base ):
19671969
19681970 BridgeID = Column ('bridgeid' , Integer , primary_key = True , nullable = False )
1969- ValueID = Column ('valueid' , BigInteger , ForeignKey (TrajectoryResultValues .ValueID ), nullable = False )
1971+ ValueID = Column ('valueid' , BigIntegerType , ForeignKey (TrajectoryResultValues .ValueID ), nullable = False )
19701972 AnnotationID = Column ('annotationid' , ForeignKey (Annotations .AnnotationID ), nullable = False )
19711973
19721974 AnnotationObj = relationship (Annotations )
@@ -1976,7 +1978,7 @@ class TrajectoryResultValueAnnotations(Base):
19761978class TransectResultValueAnnotations (Base ):
19771979
19781980 BridgeID = Column ('bridgeid' , Integer , primary_key = True , nullable = False )
1979- ValueID = Column ('valueid' , BigInteger , ForeignKey (TransectResultValues .ValueID ), nullable = False )
1981+ ValueID = Column ('valueid' , BigIntegerType , ForeignKey (TransectResultValues .ValueID ), nullable = False )
19801982 AnnotationID = Column ('annotationid' , ForeignKey (Annotations .AnnotationID ), nullable = False )
19811983
19821984 AnnotationObj = relationship (Annotations )
0 commit comments