diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0f3ea7ab0..aa3794df1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,7 @@
### Added
- Reusable form components.
+- Quality attribute for stratigraphy.
### Changed
diff --git a/src/api-legacy/__init__.py b/src/api-legacy/__init__.py
index 2da445749..7453b14ca 100644
--- a/src/api-legacy/__init__.py
+++ b/src/api-legacy/__init__.py
@@ -34,9 +34,6 @@
from bms.v1.borehole.identifier import IdentifierAdminHandler
from bms.v1.borehole.identifier import IdentifierViewerHandler
-# Profiles's ACTION Handlers
-from bms.v1.borehole.profile.viewer import ProfileViewerHandler
-
# Profiles layers's ACTION Handlers
from bms.v1.borehole.profile.layer.viewer import ProfileLayerViewerHandler
from bms.v1.borehole.profile.layer.producer import ProfileLayerProducerHandler
diff --git a/src/api-legacy/main.py b/src/api-legacy/main.py
index ac4c024dc..7b0929b89 100644
--- a/src/api-legacy/main.py
+++ b/src/api-legacy/main.py
@@ -144,9 +144,6 @@ async def close(application):
LayerViewerHandler,
LayerProducerHandler,
- # Profile handlers
- ProfileViewerHandler,
-
# Layer handlers
ProfileLayerViewerHandler,
@@ -218,9 +215,6 @@ async def close(application):
(r'/api/v1/borehole/stratigraphy/layer', LayerViewerHandler),
(r'/api/v1/borehole/stratigraphy/layer/edit', LayerProducerHandler),
- # Profile handlers
- (r'/api/v1/borehole/profile', ProfileViewerHandler),
-
# Profile Layer handlers
(r'/api/v1/borehole/profile/layer', ProfileLayerViewerHandler),
diff --git a/src/api-legacy/v1/borehole/profile/__init__.py b/src/api-legacy/v1/borehole/profile/__init__.py
index fa0ea0a93..c357f40d8 100644
--- a/src/api-legacy/v1/borehole/profile/__init__.py
+++ b/src/api-legacy/v1/borehole/profile/__init__.py
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Actions
-from bms.v1.borehole.profile.list import ListProfiles
-from bms.v1.borehole.profile.get import GetProfile
from bms.v1.borehole.profile.validate import ValidateProfile
diff --git a/src/api-legacy/v1/borehole/profile/get.py b/src/api-legacy/v1/borehole/profile/get.py
index e3a364f92..b7fb70ecf 100644
--- a/src/api-legacy/v1/borehole/profile/get.py
+++ b/src/api-legacy/v1/borehole/profile/get.py
@@ -17,6 +17,7 @@ class GetProfile(Action):
stratigraphy.kind_id_cli as kind,
COALESCE(name_sty, '') as name,
primary_sty as primary,
+ quality_id as quality,
to_char(
date_sty,
'YYYY-MM-DD'
diff --git a/src/api-legacy/v1/borehole/profile/list.py b/src/api-legacy/v1/borehole/profile/list.py
deleted file mode 100644
index 03d0fd2ea..000000000
--- a/src/api-legacy/v1/borehole/profile/list.py
+++ /dev/null
@@ -1,108 +0,0 @@
-# -*- coding: utf-8 -*-
-from bms.v1.action import Action
-import math
-
-
-class ListProfiles(Action):
-
-
- sql = """
- SELECT
- id_sty as id,
- stratigraphy.id_bho_fk as borehole,
- stratigraphy.kind_id_cli AS kind,
- name_sty as name,
- primary_sty as primary,
- to_char(
- date_sty,
- 'YYYY-MM-DD'
- ) as date
-
- FROM
- bdms.stratigraphy
-
- INNER JOIN
- bdms.borehole
- ON
- stratigraphy.id_bho_fk = id_bho
-
- INNER JOIN (
- SELECT
- id_bho_fk,
- array_agg(
- json_build_object(
- 'workflow', id_wkf,
- 'role', name_rol,
- 'username', username,
- 'started', started,
- 'finished', finished
- )
- ) as status
- FROM (
- SELECT
- id_bho_fk,
- name_rol,
- id_wkf,
- username,
- started_wkf as started,
- finished_wkf as finished
- FROM
- bdms.workflow,
- bdms.roles,
- bdms.users
- WHERE
- id_rol = id_rol_fk
- AND
- id_usr = id_usr_fk
- ORDER BY
- id_bho_fk asc, id_wkf asc
- ) t
- GROUP BY
- id_bho_fk
- ) as v
- ON
- v.id_bho_fk = id_bho
- """
-
- async def execute(self, borehole, kind, user=None):
- """Return a list of profiles for a borehole.
-
-id: borehole id
-user: user requesting the list
-
- """
-
- where = ""
-
- permissions = None
- if user is not None:
- permissions = self.filterPermission(user)
- if permissions is not None:
- where = """
- AND {}
- """.format(permissions)
-
- rec = await self.conn.fetchval(
- """
- SELECT
- array_to_json(
- array_agg(
- row_to_json(t)
- )
- )
- FROM (
- %s
- WHERE
- stratigraphy.id_bho_fk = $1
- AND
- stratigraphy.kind_id_cli = $2
- %s
- ORDER BY date_sty desc
- ) AS t
- """ % (self.sql, where),
- borehole, kind
- )
-
- return {
- "data": self.decode(rec, [])
- }
diff --git a/src/api-legacy/v1/borehole/profile/viewer.py b/src/api-legacy/v1/borehole/profile/viewer.py
deleted file mode 100644
index 8bd2f7cf5..000000000
--- a/src/api-legacy/v1/borehole/profile/viewer.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# -*- coding: utf-8 -*-
-from bms.v1.handlers import Viewer
-from bms.v1.borehole.profile import (
- GetProfile,
- ListProfiles
-)
-
-
-class ProfileViewerHandler(Viewer):
- async def execute(self, request):
- action = request.pop('action', None)
-
- if action in [
- 'LIST',
- 'GET'
- ]:
-
- async with self.pool.acquire() as conn:
-
- exe = None
-
- request['user'] = self.user
-
- if action == 'GET':
- exe = GetProfile(conn)
-
- elif action == 'LIST':
- exe = ListProfiles(conn)
-
- request.pop('lang', None)
-
- if exe is not None:
- return (
- await exe.execute(**request)
- )
-
- raise Exception("Action '%s' unknown" % action)
diff --git a/src/api/BdmsContextExtensions.cs b/src/api/BdmsContextExtensions.cs
index e8ba17e5a..835d8670b 100644
--- a/src/api/BdmsContextExtensions.cs
+++ b/src/api/BdmsContextExtensions.cs
@@ -290,6 +290,8 @@ public static void SeedData(this BdmsContext context)
.RuleFor(o => o.Date, f => f.Date.Past().ToUniversalTime().OrNull(f, .05f))
.RuleFor(o => o.KindId, f => f.PickRandom(layerKindIds))
.RuleFor(o => o.Kind, _ => default!)
+ .RuleFor(o => o.QualityId, f => f.PickRandom(descriptionQualityIds).OrNull(f, .05f))
+ .RuleFor(o => o.Quality, _ => default!)
.RuleFor(o => o.Name, f => f.Name.FullName())
.RuleFor(o => o.Notes, f => f.Rant.Review())
.RuleFor(o => o.IsPrimary, f => f.Random.Bool())
diff --git a/src/api/Migrations/20240207154353_AddStratigraphyQuality.Designer.cs b/src/api/Migrations/20240207154353_AddStratigraphyQuality.Designer.cs
new file mode 100644
index 000000000..6915bc0e2
--- /dev/null
+++ b/src/api/Migrations/20240207154353_AddStratigraphyQuality.Designer.cs
@@ -0,0 +1,2806 @@
+//
+using System;
+using BDMS;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using NetTopologySuite.Geometries;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace BDMS.Migrations
+{
+ [DbContext(typeof(BdmsContext))]
+ [Migration("20240207154353_AddStratigraphyQuality")]
+ partial class AddStratigraphyQuality
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasDefaultSchema("bdms")
+ .HasAnnotation("ProductVersion", "8.0.0")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "ltree");
+ NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "postgis");
+ NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+ modelBuilder.Entity("BDMS.Models.Backfill", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CompletionId")
+ .HasColumnType("integer")
+ .HasColumnName("completion_id");
+
+ b.Property("Created")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("creation");
+
+ b.Property("CreatedById")
+ .HasColumnType("integer")
+ .HasColumnName("creator");
+
+ b.Property("FromDepth")
+ .HasColumnType("double precision")
+ .HasColumnName("from_depth");
+
+ b.Property("KindId")
+ .HasColumnType("integer")
+ .HasColumnName("kind_id");
+
+ b.Property("MaterialId")
+ .HasColumnType("integer")
+ .HasColumnName("material_id");
+
+ b.Property("Notes")
+ .HasColumnType("text")
+ .HasColumnName("notes");
+
+ b.Property("ToDepth")
+ .HasColumnType("double precision")
+ .HasColumnName("to_depth");
+
+ b.Property("Updated")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("update");
+
+ b.Property("UpdatedById")
+ .HasColumnType("integer")
+ .HasColumnName("updater");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CompletionId");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("KindId");
+
+ b.HasIndex("MaterialId");
+
+ b.HasIndex("UpdatedById");
+
+ b.ToTable("backfill", "bdms");
+ });
+
+ modelBuilder.Entity("BDMS.Models.Borehole", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id_bho");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AlternateName")
+ .HasColumnType("text")
+ .HasColumnName("alternate_name_bho");
+
+ b.Property("Canton")
+ .HasColumnType("text")
+ .HasColumnName("canton_bho");
+
+ b.Property("ChronostratigraphyId")
+ .HasColumnType("integer")
+ .HasColumnName("chronostrat_id_cli");
+
+ b.Property("Country")
+ .HasColumnType("text")
+ .HasColumnName("country_bho");
+
+ b.Property("Created")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_bho");
+
+ b.Property("CreatedById")
+ .HasColumnType("integer")
+ .HasColumnName("created_by_bho");
+
+ b.Property("CuttingsId")
+ .HasColumnType("integer")
+ .HasColumnName("cuttings_id_cli");
+
+ b.Property("DrillingDate")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("drilling_date_bho");
+
+ b.Property("DrillingDiameter")
+ .HasColumnType("double precision")
+ .HasColumnName("drilling_diameter_bho");
+
+ b.Property("DrillingMethodId")
+ .HasColumnType("integer")
+ .HasColumnName("drilling_method_id_cli");
+
+ b.Property("ElevationZ")
+ .HasColumnType("double precision")
+ .HasColumnName("elevation_z_bho");
+
+ b.Property("Geometry")
+ .HasColumnType("geometry")
+ .HasColumnName("geom_bho");
+
+ b.Property("HasGroundwater")
+ .HasColumnType("boolean")
+ .HasColumnName("groundwater_bho");
+
+ b.Property("HrsId")
+ .HasColumnType("integer")
+ .HasColumnName("hrs_id_cli");
+
+ b.Property("Inclination")
+ .HasColumnType("double precision")
+ .HasColumnName("inclination_bho");
+
+ b.Property("InclinationDirection")
+ .HasColumnType("double precision")
+ .HasColumnName("inclination_direction_bho");
+
+ b.Property("IsPublic")
+ .HasColumnType("boolean")
+ .HasColumnName("public_bho");
+
+ b.Property("KindId")
+ .HasColumnType("integer")
+ .HasColumnName("kind_id_cli");
+
+ b.Property("LithologyTopBedrockId")
+ .HasColumnType("integer")
+ .HasColumnName("lithology_top_bedrock_id_cli");
+
+ b.Property("LithostratigraphyId")
+ .HasColumnType("integer")
+ .HasColumnName("lithostrat_id_cli");
+
+ b.Property("LocationX")
+ .HasColumnType("double precision")
+ .HasColumnName("location_x_bho");
+
+ b.Property("LocationXLV03")
+ .HasColumnType("double precision")
+ .HasColumnName("location_x_lv03_bho");
+
+ b.Property("LocationY")
+ .HasColumnType("double precision")
+ .HasColumnName("location_y_bho");
+
+ b.Property("LocationYLV03")
+ .HasColumnType("double precision")
+ .HasColumnName("location_y_lv03_bho");
+
+ b.Property("Locked")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("locked_bho");
+
+ b.Property("LockedById")
+ .HasColumnType("integer")
+ .HasColumnName("locked_by_bho");
+
+ b.Property("Municipality")
+ .HasColumnType("text")
+ .HasColumnName("municipality_bho");
+
+ b.Property("NationalInterest")
+ .HasColumnType("boolean")
+ .HasColumnName("national_interest");
+
+ b.Property("OriginalName")
+ .HasColumnType("text")
+ .HasColumnName("original_name_bho");
+
+ b.Property("OriginalReferenceSystem")
+ .HasColumnType("integer")
+ .HasColumnName("srs_id_cli");
+
+ b.Property("ProjectName")
+ .HasColumnType("text")
+ .HasColumnName("project_name_bho");
+
+ b.Property("PurposeId")
+ .HasColumnType("integer")
+ .HasColumnName("purpose_id_cli");
+
+ b.Property("QtDepthId")
+ .HasColumnType("integer")
+ .HasColumnName("qt_depth_id_cli");
+
+ b.Property("QtElevationId")
+ .HasColumnType("integer")
+ .HasColumnName("qt_elevation_id_cli");
+
+ b.Property("QtInclinationDirectionId")
+ .HasColumnType("integer")
+ .HasColumnName("qt_inclination_direction_id_cli");
+
+ b.Property("QtLocationId")
+ .HasColumnType("integer")
+ .HasColumnName("qt_location_id_cli");
+
+ b.Property("QtReferenceElevationId")
+ .HasColumnType("integer")
+ .HasColumnName("qt_reference_elevation_id_cli");
+
+ b.Property("QtTopBedrock")
+ .HasColumnType("double precision")
+ .HasColumnName("qt_top_bedrock");
+
+ b.Property("QtTopBedrockTvd")
+ .HasColumnType("double precision")
+ .HasColumnName("qt_top_bedrock_tvd");
+
+ b.Property("QtTotalDepthTvdId")
+ .HasColumnType("integer")
+ .HasColumnName("qt_total_depth_tvd_id_cli");
+
+ b.Property("ReferenceElevation")
+ .HasColumnType("double precision")
+ .HasColumnName("reference_elevation_bho");
+
+ b.Property("ReferenceElevationTypeId")
+ .HasColumnType("integer")
+ .HasColumnName("reference_elevation_type_id_cli");
+
+ b.Property("Remarks")
+ .HasColumnType("text")
+ .HasColumnName("remarks_bho");
+
+ b.Property("RestrictionId")
+ .HasColumnType("integer")
+ .HasColumnName("restriction_id_cli");
+
+ b.Property("RestrictionUntil")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("restriction_until_bho");
+
+ b.Property("SpudDate")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("spud_date_bho");
+
+ b.Property("StatusId")
+ .HasColumnType("integer")
+ .HasColumnName("status_id_cli");
+
+ b.Property("TopBedrock")
+ .HasColumnType("double precision")
+ .HasColumnName("top_bedrock_bho");
+
+ b.Property("TopBedrockTvd")
+ .HasColumnType("double precision")
+ .HasColumnName("top_bedrock_tvd_bho");
+
+ b.Property("TotalDepth")
+ .HasColumnType("double precision")
+ .HasColumnName("total_depth_bho");
+
+ b.Property("TotalDepthTvd")
+ .HasColumnType("double precision")
+ .HasColumnName("total_depth_tvd_bho");
+
+ b.Property("Updated")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_bho");
+
+ b.Property("UpdatedById")
+ .HasColumnType("integer")
+ .HasColumnName("updated_by_bho");
+
+ b.Property("WorkgroupId")
+ .HasColumnType("integer")
+ .HasColumnName("id_wgp_fk");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ChronostratigraphyId");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("CuttingsId");
+
+ b.HasIndex("DrillingMethodId");
+
+ b.HasIndex("HrsId");
+
+ b.HasIndex("KindId");
+
+ b.HasIndex("LithologyTopBedrockId");
+
+ b.HasIndex("LithostratigraphyId");
+
+ b.HasIndex("LockedById");
+
+ b.HasIndex("PurposeId");
+
+ b.HasIndex("QtDepthId");
+
+ b.HasIndex("QtElevationId");
+
+ b.HasIndex("QtInclinationDirectionId");
+
+ b.HasIndex("QtLocationId");
+
+ b.HasIndex("QtReferenceElevationId");
+
+ b.HasIndex("QtTotalDepthTvdId");
+
+ b.HasIndex("ReferenceElevationTypeId");
+
+ b.HasIndex("RestrictionId");
+
+ b.HasIndex("StatusId");
+
+ b.HasIndex("UpdatedById");
+
+ b.HasIndex("WorkgroupId");
+
+ b.ToTable("borehole", "bdms");
+ });
+
+ modelBuilder.Entity("BDMS.Models.BoreholeCodelist", b =>
+ {
+ b.Property("BoreholeId")
+ .HasColumnType("integer")
+ .HasColumnName("id_bho_fk");
+
+ b.Property("CodelistId")
+ .HasColumnType("integer")
+ .HasColumnName("id_cli_fk");
+
+ b.Property("SchemaName")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("code_cli");
+
+ b.Property("Value")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("value_bco");
+
+ b.HasKey("BoreholeId", "CodelistId");
+
+ b.HasIndex("CodelistId");
+
+ b.ToTable("borehole_codelist", "bdms");
+ });
+
+ modelBuilder.Entity("BDMS.Models.BoreholeFile", b =>
+ {
+ b.Property("BoreholeId")
+ .HasColumnType("integer")
+ .HasColumnName("id_bho_fk");
+
+ b.Property("FileId")
+ .HasColumnType("integer")
+ .HasColumnName("id_fil_fk");
+
+ b.Property("Attached")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("attached_bfi");
+
+ b.Property("Created")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_bfi");
+
+ b.Property("CreatedById")
+ .HasColumnType("integer")
+ .HasColumnName("created_by_bfi");
+
+ b.Property("Description")
+ .HasColumnType("text")
+ .HasColumnName("description_bfi");
+
+ b.Property("Public")
+ .HasColumnType("boolean")
+ .HasColumnName("public_bfi");
+
+ b.Property("Updated")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("update_bfi");
+
+ b.Property("UpdatedById")
+ .HasColumnType("integer")
+ .HasColumnName("updater_bfi");
+
+ b.Property("UserId")
+ .HasColumnType("integer")
+ .HasColumnName("id_usr_fk");
+
+ b.HasKey("BoreholeId", "FileId");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("FileId");
+
+ b.HasIndex("UpdatedById");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("borehole_files", "bdms");
+ });
+
+ modelBuilder.Entity("BDMS.Models.Casing", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CompletionId")
+ .HasColumnType("integer")
+ .HasColumnName("completion_id");
+
+ b.Property("Created")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("creation");
+
+ b.Property("CreatedById")
+ .HasColumnType("integer")
+ .HasColumnName("creator");
+
+ b.Property("DateFinish")
+ .HasColumnType("date")
+ .HasColumnName("date_finish");
+
+ b.Property("DateStart")
+ .HasColumnType("date")
+ .HasColumnName("date_start");
+
+ b.Property("FromDepth")
+ .HasColumnType("double precision")
+ .HasColumnName("from_depth");
+
+ b.Property("InnerDiameter")
+ .HasColumnType("double precision")
+ .HasColumnName("inner_diameter");
+
+ b.Property("KindId")
+ .HasColumnType("integer")
+ .HasColumnName("kind_id");
+
+ b.Property("MaterialId")
+ .HasColumnType("integer")
+ .HasColumnName("material_id");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("name");
+
+ b.Property("Notes")
+ .HasColumnType("text")
+ .HasColumnName("notes");
+
+ b.Property("OuterDiameter")
+ .HasColumnType("double precision")
+ .HasColumnName("outer_diameter");
+
+ b.Property("ToDepth")
+ .HasColumnType("double precision")
+ .HasColumnName("to_depth");
+
+ b.Property("Updated")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("update");
+
+ b.Property("UpdatedById")
+ .HasColumnType("integer")
+ .HasColumnName("updater");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CompletionId");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("KindId");
+
+ b.HasIndex("MaterialId");
+
+ b.HasIndex("UpdatedById");
+
+ b.ToTable("casing", "bdms");
+ });
+
+ modelBuilder.Entity("BDMS.Models.ChronostratigraphyLayer", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id_chr");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("ChronostratigraphyId")
+ .HasColumnType("integer")
+ .HasColumnName("chronostratigraphy_id");
+
+ b.Property("Created")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("creation");
+
+ b.Property("CreatedById")
+ .HasColumnType("integer")
+ .HasColumnName("creator");
+
+ b.Property("FromDepth")
+ .HasColumnType("double precision")
+ .HasColumnName("depth_from");
+
+ b.Property("IsLast")
+ .HasColumnType("boolean")
+ .HasColumnName("is_last");
+
+ b.Property("StratigraphyId")
+ .HasColumnType("integer")
+ .HasColumnName("id_sty_fk");
+
+ b.Property("ToDepth")
+ .HasColumnType("double precision")
+ .HasColumnName("depth_to");
+
+ b.Property("Updated")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("update");
+
+ b.Property("UpdatedById")
+ .HasColumnType("integer")
+ .HasColumnName("updater");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ChronostratigraphyId");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("StratigraphyId");
+
+ b.HasIndex("UpdatedById");
+
+ b.ToTable("chronostratigraphy", "bdms");
+ });
+
+ modelBuilder.Entity("BDMS.Models.Codelist", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id_cli");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Code")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("code_cli");
+
+ b.Property("Conf")
+ .HasColumnType("text")
+ .HasColumnName("conf_cli");
+
+ b.Property("De")
+ .HasColumnType("text")
+ .HasColumnName("text_cli_de");
+
+ b.Property("DescriptionDe")
+ .HasColumnType("text")
+ .HasColumnName("description_cli_de");
+
+ b.Property("DescriptionEn")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("description_cli_en");
+
+ b.Property("DescriptionFr")
+ .HasColumnType("text")
+ .HasColumnName("description_cli_fr");
+
+ b.Property("DescriptionIt")
+ .HasColumnType("text")
+ .HasColumnName("description_cli_it");
+
+ b.Property("DescriptionRo")
+ .HasColumnType("text")
+ .HasColumnName("description_cli_ro");
+
+ b.Property("En")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("text_cli_en");
+
+ b.Property("Fr")
+ .HasColumnType("text")
+ .HasColumnName("text_cli_fr");
+
+ b.Property("Geolcode")
+ .HasColumnType("integer")
+ .HasColumnName("geolcode");
+
+ b.Property("IsDefault")
+ .HasColumnType("boolean")
+ .HasColumnName("default_cli");
+
+ b.Property("It")
+ .HasColumnType("text")
+ .HasColumnName("text_cli_it");
+
+ b.Property("Order")
+ .HasColumnType("integer")
+ .HasColumnName("order_cli");
+
+ b.Property("Path")
+ .HasColumnType("ltree")
+ .HasColumnName("path_cli");
+
+ b.Property("Ro")
+ .HasColumnType("text")
+ .HasColumnName("text_cli_ro");
+
+ b.Property("Schema")
+ .HasColumnType("text")
+ .HasColumnName("schema_cli");
+
+ b.HasKey("Id");
+
+ b.ToTable("codelist", "bdms");
+ });
+
+ modelBuilder.Entity("BDMS.Models.Completion", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AbandonDate")
+ .HasColumnType("date")
+ .HasColumnName("abandon_date");
+
+ b.Property("BoreholeId")
+ .HasColumnType("integer")
+ .HasColumnName("borehole_id");
+
+ b.Property("Created")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("creation");
+
+ b.Property("CreatedById")
+ .HasColumnType("integer")
+ .HasColumnName("creator");
+
+ b.Property("IsPrimary")
+ .HasColumnType("boolean")
+ .HasColumnName("is_primary");
+
+ b.Property("KindId")
+ .HasColumnType("integer")
+ .HasColumnName("kind_id");
+
+ b.Property("Name")
+ .HasColumnType("text")
+ .HasColumnName("name");
+
+ b.Property("Notes")
+ .HasColumnType("text")
+ .HasColumnName("notes");
+
+ b.Property("Updated")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("update");
+
+ b.Property("UpdatedById")
+ .HasColumnType("integer")
+ .HasColumnName("updater");
+
+ b.HasKey("Id");
+
+ b.HasIndex("BoreholeId");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("KindId");
+
+ b.HasIndex("UpdatedById");
+
+ b.ToTable("completion", "bdms");
+ });
+
+ modelBuilder.Entity("BDMS.Models.Config", b =>
+ {
+ b.Property("Name")
+ .HasColumnType("text")
+ .HasColumnName("name_cfg");
+
+ b.Property("Value")
+ .HasColumnType("text")
+ .HasColumnName("value_cfg");
+
+ b.HasKey("Name");
+
+ b.ToTable("config", "bdms");
+ });
+
+ modelBuilder.Entity("BDMS.Models.Content", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id_cnt");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Creation")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("creation_cnt");
+
+ b.Property("Expired")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("expired_cnt");
+
+ b.Property("IsDraft")
+ .HasColumnType("boolean")
+ .HasColumnName("draft_cnt");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("name_cnt");
+
+ b.Property("TextDe")
+ .HasColumnType("text")
+ .HasColumnName("text_cnt_de");
+
+ b.Property("TextEn")
+ .HasColumnType("text")
+ .HasColumnName("text_cnt_en");
+
+ b.Property("TextFr")
+ .HasColumnType("text")
+ .HasColumnName("text_cnt_fr");
+
+ b.Property("TextIt")
+ .HasColumnType("text")
+ .HasColumnName("text_cnt_it");
+
+ b.Property("TextRo")
+ .HasColumnType("text")
+ .HasColumnName("text_cnt_ro");
+
+ b.Property("TitelRo")
+ .HasColumnType("text")
+ .HasColumnName("title_cnt_ro");
+
+ b.Property("TitleDe")
+ .HasColumnType("text")
+ .HasColumnName("title_cnt_de");
+
+ b.Property("TitleEn")
+ .HasColumnType("text")
+ .HasColumnName("title_cnt_en");
+
+ b.Property("TitleFr")
+ .HasColumnType("text")
+ .HasColumnName("title_cnt_fr");
+
+ b.Property("TitleIt")
+ .HasColumnType("text")
+ .HasColumnName("title_cnt_it");
+
+ b.HasKey("Id");
+
+ b.ToTable("contents", "bdms");
+ });
+
+ modelBuilder.Entity("BDMS.Models.FaciesDescription", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id_fac");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("creation");
+
+ b.Property("CreatedById")
+ .HasColumnType("integer")
+ .HasColumnName("creator");
+
+ b.Property("Description")
+ .HasColumnType("text")
+ .HasColumnName("description");
+
+ b.Property("FromDepth")
+ .HasColumnType("double precision")
+ .HasColumnName("depth_from");
+
+ b.Property("IsLast")
+ .HasColumnType("boolean")
+ .HasColumnName("is_last");
+
+ b.Property("QtDescriptionId")
+ .HasColumnType("integer")
+ .HasColumnName("qt_description_id");
+
+ b.Property("StratigraphyId")
+ .HasColumnType("integer")
+ .HasColumnName("id_sty_fk");
+
+ b.Property("ToDepth")
+ .HasColumnType("double precision")
+ .HasColumnName("depth_to");
+
+ b.Property("Updated")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("update");
+
+ b.Property("UpdatedById")
+ .HasColumnType("integer")
+ .HasColumnName("updater");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("QtDescriptionId");
+
+ b.HasIndex("StratigraphyId");
+
+ b.HasIndex("UpdatedById");
+
+ b.ToTable("facies_description", "bdms");
+ });
+
+ modelBuilder.Entity("BDMS.Models.Feedback", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id_feb");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("created_feb");
+
+ b.Property("IsFrw")
+ .HasColumnType("boolean")
+ .HasColumnName("frw_feb");
+
+ b.Property("Message")
+ .HasColumnType("text")
+ .HasColumnName("message_feb");
+
+ b.Property("Tag")
+ .HasColumnType("text")
+ .HasColumnName("tag_feb");
+
+ b.Property("User")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("user_feb");
+
+ b.HasKey("Id");
+
+ b.ToTable("feedbacks", "bdms");
+ });
+
+ modelBuilder.Entity("BDMS.Models.File", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id_fil");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("uploaded_fil");
+
+ b.Property("CreatedById")
+ .HasColumnType("integer")
+ .HasColumnName("id_usr_fk");
+
+ b.Property("Hash")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("hash_fil");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("name_fil");
+
+ b.Property("NameUuid")
+ .HasColumnType("text")
+ .HasColumnName("name_uuid_fil");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("type_fil");
+
+ b.Property("Updated")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("updated_fil");
+
+ b.Property("UpdatedById")
+ .HasColumnType("integer")
+ .HasColumnName("updated_by_fil");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("UpdatedById");
+
+ b.ToTable("files", "bdms");
+ });
+
+ modelBuilder.Entity("BDMS.Models.HydrotestCodelist", b =>
+ {
+ b.Property("HydrotestId")
+ .HasColumnType("integer")
+ .HasColumnName("id_ht_fk");
+
+ b.Property("CodelistId")
+ .HasColumnType("integer")
+ .HasColumnName("id_cli_fk");
+
+ b.HasKey("HydrotestId", "CodelistId");
+
+ b.HasIndex("CodelistId");
+
+ b.ToTable("hydrotest_codelist", "bdms");
+ });
+
+ modelBuilder.Entity("BDMS.Models.HydrotestResult", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("creation");
+
+ b.Property("CreatedById")
+ .HasColumnType("integer")
+ .HasColumnName("creator");
+
+ b.Property("HydrotestId")
+ .HasColumnType("integer")
+ .HasColumnName("hydrotest_id");
+
+ b.Property("MaxValue")
+ .HasColumnType("double precision")
+ .HasColumnName("max_value");
+
+ b.Property("MinValue")
+ .HasColumnType("double precision")
+ .HasColumnName("min_value");
+
+ b.Property("ParameterId")
+ .HasColumnType("integer")
+ .HasColumnName("parameter");
+
+ b.Property("Updated")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("update");
+
+ b.Property("UpdatedById")
+ .HasColumnType("integer")
+ .HasColumnName("updater");
+
+ b.Property("Value")
+ .HasColumnType("double precision")
+ .HasColumnName("value");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("HydrotestId");
+
+ b.HasIndex("ParameterId");
+
+ b.HasIndex("UpdatedById");
+
+ b.ToTable("hydrotest_result", "bdms");
+ });
+
+ modelBuilder.Entity("BDMS.Models.Instrumentation", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("CasingId")
+ .HasColumnType("integer")
+ .HasColumnName("casing_id");
+
+ b.Property("CompletionId")
+ .HasColumnType("integer")
+ .HasColumnName("completion_id");
+
+ b.Property("Created")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("creation");
+
+ b.Property("CreatedById")
+ .HasColumnType("integer")
+ .HasColumnName("creator");
+
+ b.Property("FromDepth")
+ .HasColumnType("double precision")
+ .HasColumnName("from_depth");
+
+ b.Property("KindId")
+ .HasColumnType("integer")
+ .HasColumnName("kind_id");
+
+ b.Property("Name")
+ .HasColumnType("text")
+ .HasColumnName("name");
+
+ b.Property("Notes")
+ .HasColumnType("text")
+ .HasColumnName("notes");
+
+ b.Property("StatusId")
+ .HasColumnType("integer")
+ .HasColumnName("status_id");
+
+ b.Property("ToDepth")
+ .HasColumnType("double precision")
+ .HasColumnName("to_depth");
+
+ b.Property("Updated")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("update");
+
+ b.Property("UpdatedById")
+ .HasColumnType("integer")
+ .HasColumnName("updater");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CasingId");
+
+ b.HasIndex("CompletionId");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("KindId");
+
+ b.HasIndex("StatusId");
+
+ b.HasIndex("UpdatedById");
+
+ b.ToTable("instrumentation", "bdms");
+ });
+
+ modelBuilder.Entity("BDMS.Models.Layer", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id_lay");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("AlterationId")
+ .HasColumnType("integer")
+ .HasColumnName("alteration_id_cli");
+
+ b.Property("CohesionId")
+ .HasColumnType("integer")
+ .HasColumnName("cohesion_id_cli");
+
+ b.Property("CompactnessId")
+ .HasColumnType("integer")
+ .HasColumnName("compactness_id_cli");
+
+ b.Property("ConsistanceId")
+ .HasColumnType("integer")
+ .HasColumnName("consistance_id_cli");
+
+ b.Property("Created")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("creation_lay");
+
+ b.Property("CreatedById")
+ .HasColumnType("integer")
+ .HasColumnName("creator_lay");
+
+ b.Property("FromDepth")
+ .HasColumnType("double precision")
+ .HasColumnName("depth_from_lay");
+
+ b.Property("GradationId")
+ .HasColumnType("integer")
+ .HasColumnName("gradation_id_cli");
+
+ b.Property("GrainSize1Id")
+ .HasColumnType("integer")
+ .HasColumnName("grain_size_1_id_cli");
+
+ b.Property("GrainSize2Id")
+ .HasColumnType("integer")
+ .HasColumnName("grain_size_2_id_cli");
+
+ b.Property("HumidityId")
+ .HasColumnType("integer")
+ .HasColumnName("humidity_id_cli");
+
+ b.Property("IsLast")
+ .HasColumnType("boolean")
+ .HasColumnName("last_lay");
+
+ b.Property("IsStriae")
+ .HasColumnType("boolean")
+ .HasColumnName("striae_lay");
+
+ b.Property("IsUndefined")
+ .HasColumnType("boolean")
+ .HasColumnName("undefined_lay");
+
+ b.Property("LithologyId")
+ .HasColumnType("integer")
+ .HasColumnName("lithology_id_cli");
+
+ b.Property("LithologyTopBedrockId")
+ .HasColumnType("integer")
+ .HasColumnName("lithology_top_bedrock_id_cli");
+
+ b.Property("LithostratigraphyId")
+ .HasColumnType("integer")
+ .HasColumnName("lithostratigraphy_id_cli");
+
+ b.Property("Notes")
+ .HasColumnType("text")
+ .HasColumnName("notes_lay");
+
+ b.Property("OriginalLithology")
+ .HasColumnType("text")
+ .HasColumnName("original_lithology");
+
+ b.Property("OriginalUscs")
+ .HasColumnType("text")
+ .HasColumnName("uscs_original_lay");
+
+ b.Property("PlasticityId")
+ .HasColumnType("integer")
+ .HasColumnName("plasticity_id_cli");
+
+ b.Property("QtDescriptionId")
+ .HasColumnType("integer")
+ .HasColumnName("qt_description_id_cli");
+
+ b.Property("StratigraphyId")
+ .HasColumnType("integer")
+ .HasColumnName("id_sty_fk");
+
+ b.Property("ToDepth")
+ .HasColumnType("double precision")
+ .HasColumnName("depth_to_lay");
+
+ b.Property("Updated")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("update_lay");
+
+ b.Property("UpdatedById")
+ .HasColumnType("integer")
+ .HasColumnName("updater_lay");
+
+ b.Property("Uscs1Id")
+ .HasColumnType("integer")
+ .HasColumnName("uscs_1_id_cli");
+
+ b.Property("Uscs2Id")
+ .HasColumnType("integer")
+ .HasColumnName("uscs_2_id_cli");
+
+ b.Property("UscsDeterminationId")
+ .HasColumnType("integer")
+ .HasColumnName("uscs_determination_id_cli");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AlterationId");
+
+ b.HasIndex("CohesionId");
+
+ b.HasIndex("CompactnessId");
+
+ b.HasIndex("ConsistanceId");
+
+ b.HasIndex("CreatedById");
+
+ b.HasIndex("GradationId");
+
+ b.HasIndex("GrainSize1Id");
+
+ b.HasIndex("GrainSize2Id");
+
+ b.HasIndex("HumidityId");
+
+ b.HasIndex("LithologyId");
+
+ b.HasIndex("LithologyTopBedrockId");
+
+ b.HasIndex("LithostratigraphyId");
+
+ b.HasIndex("PlasticityId");
+
+ b.HasIndex("QtDescriptionId");
+
+ b.HasIndex("StratigraphyId");
+
+ b.HasIndex("UpdatedById");
+
+ b.HasIndex("Uscs1Id");
+
+ b.HasIndex("Uscs2Id");
+
+ b.HasIndex("UscsDeterminationId");
+
+ b.ToTable("layer", "bdms");
+ });
+
+ modelBuilder.Entity("BDMS.Models.LayerCodelist", b =>
+ {
+ b.Property("LayerId")
+ .HasColumnType("integer")
+ .HasColumnName("id_lay_fk");
+
+ b.Property("CodelistId")
+ .HasColumnType("integer")
+ .HasColumnName("id_cli_fk");
+
+ b.Property("SchemaName")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("code_cli");
+
+ b.HasKey("LayerId", "CodelistId");
+
+ b.HasIndex("CodelistId");
+
+ b.ToTable("layer_codelist", "bdms");
+ });
+
+ modelBuilder.Entity("BDMS.Models.LithologicalDescription", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .HasColumnName("id_ldp");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("timestamp with time zone")
+ .HasColumnName("creation");
+
+ b.Property("CreatedById")
+ .HasColumnType("integer")
+ .HasColumnName("creator");
+
+ b.Property("Description")
+ .HasColumnType("text")
+ .HasColumnName("description");
+
+ b.Property