Skip to content

Commit

Permalink
Test all models and fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Reillyhewitson committed Nov 3, 2022
1 parent 92f8682 commit df446d6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
18 changes: 8 additions & 10 deletions datagateway_api/src/datagateway_api/database/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ class DATAPUBLICATIONDATE(Base, EntityHelper, metaclass=EntityMeta):
__singularfieldname__ = "dataPublicationDate"
__pluralfieldname__ = "dataPublicationDates"
__table_args__ = (
Index("UNQ_DATAPUBLICATIONDATE_0", "DATAPUBLICATION_ID", "DATE_TYPE"),
Index("UNQ_DATAPUBLICATIONDATE_0", "DATAPUBLICATION_ID", "DATETYPE"),
)

id = Column("ID", BigInteger, primary_key=True)
Expand All @@ -468,7 +468,7 @@ class DATAPUBLICATIONDATE(Base, EntityHelper, metaclass=EntityMeta):
modId = Column("MOD_ID", String(255), nullable=False)
modTime = Column("MOD_TIME", DateTime, nullable=False)
dateType = Column("DATETYPE", String(255), nullable=False)
date = Column("DATE", String(255), nullable=False)
date = Column("DATE_", String(255), nullable=False)
datapublicationId = Column(
"DATAPUBLICATION_ID", ForeignKey("DATAPUBLICATION.ID"), nullable=False
)
Expand Down Expand Up @@ -567,7 +567,7 @@ class DATAPUBLICATIONUSER(Base, EntityHelper, metaclass=EntityMeta):

USER = relationship(
"USER",
primaryjoin="DATAPUBLICATIONUSER.userID == USER.id",
primaryjoin="DATAPUBLICATIONUSER.userId == USER.id",
backref="dataPublicationUsers",
)

Expand Down Expand Up @@ -807,7 +807,6 @@ class DATASETTECHNIQUE(Base, EntityHelper, metaclass=EntityMeta):
id = Column("ID", BigInteger, primary_key=True)
createId = Column("CREATE_ID", String(255), nullable=False)
createTime = Column("CREATE_TIME", DateTime, nullable=False)
description = Column("DESCRIPTION", String(255))
modId = Column("MOD_ID", String(255), nullable=False)
modTime = Column("MOD_TIME", DateTime, nullable=False)
datasetId = Column("DATASET_ID", ForeignKey("DATASET.ID"), nullable=False)
Expand Down Expand Up @@ -854,12 +853,11 @@ class FUNDINGREFERENCE(Base, EntityHelper, metaclass=EntityMeta):
__tablename__ = "FUNDINGREFERENCE"
__singularfieldname__ = "fundingReference"
__pluralfieldname__ = "fundingReferences"
__table_args__ = (Index("UNQ_FUNDINGREFERENCE_0", "FUNDER_NAME", "AWARD_NUMBER"),)
__table_args__ = (Index("UNQ_FUNDINGREFERENCE_0", "FUNDERNAME", "AWARDNUMBER"),)

id = Column("ID", BigInteger, primary_key=True)
createId = Column("CREATE_ID", String(255), nullable=False)
createTime = Column("CREATE_TIME", DateTime, nullable=False)
description = Column("DESCRIPTION", String(255))
modId = Column("MOD_ID", String(255), nullable=False)
modTime = Column("MOD_TIME", DateTime, nullable=False)
funderIdentifier = Column("FUNDERIDENTIFIER", String(255))
Expand Down Expand Up @@ -990,7 +988,7 @@ class INVESTIGATIONFACILITYCYCLE(Base, EntityHelper, metaclass=EntityMeta):
facilityCycleId = Column(
"FACILITYCYCLE_ID", ForeignKey("FACILITYCYCLE.ID"), nullable=False,
)
investigationID = Column(
investigationId = Column(
"INVESTIGATION_ID", ForeignKey("INVESTIGATION.ID"), nullable=False, index=True,
)

Expand All @@ -1001,7 +999,7 @@ class INVESTIGATIONFACILITYCYCLE(Base, EntityHelper, metaclass=EntityMeta):
)
INVESTIGATION = relationship(
"INVESTIGATION",
primaryjoin="INVESTIGATIONFACILITYCYCLE.investigationID == INVESTIGATION.id",
primaryjoin="INVESTIGATIONFACILITYCYCLE.investigationId == INVESTIGATION.id",
backref="investigationFacilityCycles",
)

Expand All @@ -1020,7 +1018,7 @@ class INVESTIGATIONFUNDING(Base, EntityHelper, metaclass=EntityMeta):
modId = Column("MOD_ID", String(255), nullable=False)
modTime = Column("MOD_TIME", DateTime, nullable=False)
fundingId = Column("FUNDING_ID", ForeignKey("FUNDINGREFERENCE.ID"), nullable=False)
investigationID = Column(
investigationId = Column(
"INVESTIGATION_ID", ForeignKey("INVESTIGATION.ID"), nullable=False, index=True,
)

Expand All @@ -1031,7 +1029,7 @@ class INVESTIGATIONFUNDING(Base, EntityHelper, metaclass=EntityMeta):
)
INVESTIGATION = relationship(
"INVESTIGATION",
primaryjoin="INVESTIGATIONFUNDING.investigationID == INVESTIGATION.id",
primaryjoin="INVESTIGATIONFUNDING.investigationId == INVESTIGATION.id",
backref="fundingReferences",
)

Expand Down
18 changes: 8 additions & 10 deletions datagateway_api/src/swagger/datagateway_api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,8 @@ components:
type: string
email:
type: string
familyName:
type: string
fullName:
type: string
givenName:
Expand All @@ -795,7 +797,7 @@ components:
type: string
publicationId:
type: integer
userID:
userId:
type: integer
required:
- id
Expand All @@ -805,7 +807,7 @@ components:
- modTime
- contributorType
- publicationId
- userID
- userId
DATASET:
properties:
DATASETTYPE:
Expand Down Expand Up @@ -967,8 +969,6 @@ components:
type: string
datasetId:
type: integer
description:
type: string
id:
readOnly: true
type: integer
Expand Down Expand Up @@ -1150,8 +1150,6 @@ components:
createTime:
format: datetime
type: string
description:
type: string
funderIdentifier:
type: string
funderName:
Expand Down Expand Up @@ -1421,7 +1419,7 @@ components:
id:
readOnly: true
type: integer
investigationID:
investigationId:
type: integer
modId:
type: string
Expand All @@ -1435,7 +1433,7 @@ components:
- modId
- modTime
- facilityCycleId
- investigationID
- investigationId
INVESTIGATIONFUNDING:
properties:
FUNDINGREFERENCE:
Expand All @@ -1452,7 +1450,7 @@ components:
id:
readOnly: true
type: integer
investigationID:
investigationId:
type: integer
modId:
type: string
Expand All @@ -1466,7 +1464,7 @@ components:
- modId
- modTime
- fundingId
- investigationID
- investigationId
INVESTIGATIONGROUP:
properties:
GROUPING:
Expand Down

0 comments on commit df446d6

Please sign in to comment.