Skip to content

Commit

Permalink
Fix datetime columns
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarans committed Oct 17, 2024
1 parent 339377c commit e9b46fc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ content-type = "text/markdown"
Homepage = "https://github.com/OCHA-DAP/hapi-schemas"

[project.optional-dependencies]
database = ["hdx-python-database>=1.3.3"]
database = ["hdx-python-database>=1.3.4"]
dev = ["pre-commit"]
test = ["hdx-python-database>=1.3.3", "psycopg[binary]", "pytest", "pytest-cov"]
test = ["hdx-python-database>=1.3.4", "psycopg[binary]", "pytest", "pytest-cov"]

#########
# Hatch #
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ filelock==3.16.1
# via virtualenv
greenlet==3.1.1
# via sqlalchemy
hdx-python-database==1.3.3
hdx-python-database==1.3.4
# via hapi-schema (pyproject.toml)
identify==2.6.1
# via pre-commit
Expand Down Expand Up @@ -38,7 +38,7 @@ pytest-cov==5.0.0
# via hapi-schema (pyproject.toml)
pyyaml==6.0.2
# via pre-commit
sqlalchemy==2.0.35
sqlalchemy==2.0.36
# via
# hapi-schema (pyproject.toml)
# hdx-python-database
Expand Down
9 changes: 2 additions & 7 deletions src/hapi_schema/db_idps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from datetime import datetime

from sqlalchemy import (
DateTime,
ForeignKey,
Integer,
String,
Expand Down Expand Up @@ -57,13 +56,9 @@ class DBIDPs(Base):
population: Mapped[int] = mapped_column(
Integer, nullable=False, index=True
)

reference_period_start: Mapped[datetime] = mapped_column(
DateTime, primary_key=True
)

reference_period_start: Mapped[datetime] = mapped_column(primary_key=True)
reference_period_end: Mapped[datetime] = mapped_column(
DateTime, nullable=True, index=True
nullable=False, index=True
)

resource = relationship(DBResource)
Expand Down
7 changes: 2 additions & 5 deletions src/hapi_schema/db_returnees.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from datetime import datetime

from sqlalchemy import (
DateTime,
ForeignKey,
Integer,
String,
Expand Down Expand Up @@ -64,11 +63,9 @@ class DBReturnees(Base):
population: Mapped[int] = mapped_column(
Integer, nullable=False, index=True
)
reference_period_start: Mapped[datetime] = mapped_column(
DateTime, primary_key=True
)
reference_period_start: Mapped[datetime] = mapped_column(primary_key=True)
reference_period_end: Mapped[datetime] = mapped_column(
DateTime, nullable=False, index=True
nullable=False, index=True
)

# resource = relationship("DBResource")
Expand Down

0 comments on commit e9b46fc

Please sign in to comment.