Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HYDWS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Indu
HYDWS
Commits
07c5fd2e
Commit
07c5fd2e
authored
4 months ago
by
Nicolas Schmid
Browse files
Options
Downloads
Patches
Plain Diff
fix: change id's to bigint
parent
6e8e3827
Branches
bedretto-environment
main
No related tags found
No related merge requests found
Pipeline
#3871
passed
4 months ago
Stage: codestyle
Stage: test
Stage: publish
Stage: deploy
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
hydws/datamodel/base.py
+7
-2
7 additions, 2 deletions
hydws/datamodel/base.py
hydws/datamodel/orm.py
+3
-3
3 additions, 3 deletions
hydws/datamodel/orm.py
hydws/routers/boreholes.py
+3
-3
3 additions, 3 deletions
hydws/routers/boreholes.py
with
13 additions
and
8 deletions
hydws/datamodel/base.py
+
7
−
2
View file @
07c5fd2e
...
...
@@ -3,7 +3,8 @@ import functools
import
uuid
from
datetime
import
datetime
from
sqlalchemy
import
Boolean
,
Column
,
DateTime
,
Float
,
Integer
,
String
from
sqlalchemy
import
(
BigInteger
,
Boolean
,
Column
,
DateTime
,
Float
,
Integer
,
String
)
from
sqlalchemy.dialects.postgresql
import
UUID
from
sqlalchemy.ext.declarative
import
declared_attr
from
sqlalchemy.orm
import
declarative_base
...
...
@@ -17,7 +18,11 @@ class Base(object):
@declared_attr
def
__tablename__
(
cls
):
return
cls
.
__name__
.
lower
()
_oid
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
,
autoincrement
=
True
)
_oid
=
Column
(
BigInteger
,
primary_key
=
True
,
nullable
=
False
,
autoincrement
=
True
)
ORMBase
=
declarative_base
(
cls
=
Base
)
...
...
This diff is collapsed.
Click to expand it.
hydws/datamodel/orm.py
+
3
−
3
View file @
07c5fd2e
from
sqlalchemy
import
Boolean
,
Column
,
ForeignKey
,
Index
,
Integer
,
String
from
sqlalchemy
import
BigInteger
,
Boolean
,
Column
,
ForeignKey
,
Index
,
String
from
sqlalchemy.orm
import
relationship
from
hydws.datamodel.base
import
(
CreationInfoMixin
,
EpochMixin
,
ORMBase
,
...
...
@@ -73,7 +73,7 @@ class BoreholeSection(EpochMixin('Epoch', epoch_type='finite'),
description
=
Column
(
String
)
_borehole_oid
=
Column
(
Integer
,
Big
Integer
,
ForeignKey
(
'
borehole._oid
'
,
ondelete
=
"
CASCADE
"
),
index
=
True
)
...
...
@@ -107,7 +107,7 @@ class HydraulicSample(TimeQuantityMixin('datetime', value_nullable=False,
fluidcomposition
=
Column
(
String
)
_boreholesection_oid
=
Column
(
Integer
,
Big
Integer
,
ForeignKey
(
'
boreholesection._oid
'
,
ondelete
=
"
CASCADE
"
),
index
=
True
)
section
=
relationship
(
"
BoreholeSection
"
,
back_populates
=
"
hydraulics
"
)
...
...
This diff is collapsed.
Click to expand it.
hydws/routers/boreholes.py
+
3
−
3
View file @
07c5fd2e
...
...
@@ -141,9 +141,9 @@ def csv_response(data) -> PlainTextResponse:
return
PlainTextResponse
(
data
,
media_type
=
'
text/csv
'
)
@
router
.
get
(
"
/{borehole_id}/sections/{section_id}/hydraulics
"
,
response_model
=
list
[
HydraulicSampleSchema
],
response_model_exclude_none
=
True
)
@router.get
(
"
/{borehole_id}/sections/{section_id}/hydraulics
"
,
response_model
=
list
[
HydraulicSampleSchema
],
response_model_exclude_none
=
True
)
async
def
get_section_hydraulics
(
borehole_id
:
uuid
.
UUID
,
section_id
:
uuid
.
UUID
,
db
:
DBSessionDep
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment