Skip to content

Commit

Permalink
#89: Update column types
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranjprice101 committed Oct 14, 2019
1 parent a99cc3a commit d5f0e31
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions common/models/db_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from datetime import datetime
from sqlalchemy import Index, Column, BigInteger, String, DateTime, ForeignKey, Integer, Float, FetchedValue, \
TypeDecorator
TypeDecorator, Boolean
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy.orm.collections import InstrumentedList
Expand Down Expand Up @@ -320,7 +320,7 @@ class DATASET(Base, EntityHelper):
)

ID = Column(BigInteger, primary_key=True)
COMPLETE = Column(Integer, nullable=False, server_default=FetchedValue())
COMPLETE = Column(Boolean, nullable=False, server_default=FetchedValue())
CREATE_ID = Column(String(255), nullable=False)
CREATE_TIME = Column(DateTime, nullable=False)
DESCRIPTION = Column(String(255))
Expand Down Expand Up @@ -642,15 +642,15 @@ class ValueTypeEnum(enum.Enum):
STRING = 2

ID = Column(BigInteger, primary_key=True)
APPLICABLETODATACOLLECTION = Column(Integer, server_default=FetchedValue())
APPLICABLETODATAFILE = Column(Integer, server_default=FetchedValue())
APPLICABLETODATASET = Column(Integer, server_default=FetchedValue())
APPLICABLETOINVESTIGATION = Column(Integer, server_default=FetchedValue())
APPLICABLETOSAMPLE = Column(Integer, server_default=FetchedValue())
APPLICABLETODATACOLLECTION = Column(Boolean, server_default=FetchedValue())
APPLICABLETODATAFILE = Column(Boolean, server_default=FetchedValue())
APPLICABLETODATASET = Column(Boolean, server_default=FetchedValue())
APPLICABLETOINVESTIGATION = Column(Boolean, server_default=FetchedValue())
APPLICABLETOSAMPLE = Column(Boolean, server_default=FetchedValue())
CREATE_ID = Column(String(255), nullable=False)
CREATE_TIME = Column(DateTime, nullable=False)
DESCRIPTION = Column(String(255))
ENFORCED = Column(Integer, server_default=FetchedValue())
ENFORCED = Column(Boolean, server_default=FetchedValue())
MAXIMUMNUMERICVALUE = Column(Float(asdecimal=True))
MINIMUMNUMERICVALUE = Column(Float(asdecimal=True))
MOD_ID = Column(String(255), nullable=False)
Expand All @@ -659,7 +659,7 @@ class ValueTypeEnum(enum.Enum):
UNITS = Column(String(255), nullable=False)
UNITSFULLNAME = Column(String(255))
VALUETYPE = Column(EnumAsInteger(ValueTypeEnum), nullable=False)
VERIFIED = Column(Integer, server_default=FetchedValue())
VERIFIED = Column(Boolean, server_default=FetchedValue())
FACILITY_ID = Column(ForeignKey('FACILITY.ID'), nullable=False)

FACILITY = relationship('FACILITY', primaryjoin='PARAMETERTYPE.FACILITY_ID == FACILITY.ID',
Expand Down

0 comments on commit d5f0e31

Please sign in to comment.