From d15832f2b6431285b822f4dc82e52078f9080674 Mon Sep 17 00:00:00 2001 From: tschumpr Date: Mon, 4 Dec 2023 16:51:02 +0100 Subject: [PATCH 1/9] Update qt_top_bedrock fields to be actual value --- src/api-legacy/v1/action.py | 4 +- src/api-legacy/v1/borehole/copy.py | 9 +- src/api-legacy/v1/borehole/get.py | 4 +- src/api-legacy/v1/borehole/list.py | 22 +- src/api-legacy/v1/borehole/patch.py | 8 +- src/api/BdmsContext.cs | 2 - src/api/BdmsContextExtensions.cs | 11 +- src/api/Controllers/UploadController.cs | 4 +- ...231204153139_AlterQtTopBedrock.Designer.cs | 2471 +++++++++++ .../20231204153139_AlterQtTopBedrock.cs | 84 + .../Migrations/BdmsContextModelSnapshot.cs | 3635 ++++++++--------- src/api/Models/Borehole.cs | 18 +- 12 files changed, 4388 insertions(+), 1884 deletions(-) create mode 100644 src/api/Migrations/20231204153139_AlterQtTopBedrock.Designer.cs create mode 100644 src/api/Migrations/20231204153139_AlterQtTopBedrock.cs diff --git a/src/api-legacy/v1/action.py b/src/api-legacy/v1/action.py index 7d86a366b..bb839a314 100644 --- a/src/api-legacy/v1/action.py +++ b/src/api-legacy/v1/action.py @@ -1043,7 +1043,7 @@ def filterBorehole(self, filter={}): 'qt_top_bedrock'] not in ['', None]: params.append(int(filter['qt_top_bedrock'])) where.append(""" - qt_top_bedrock_id_cli = %s + qt_top_bedrock = %s """ % self.getIdx()) if 'top_bedrock_tvd_from' in keys and filter['top_bedrock_tvd_from'] not in ['', None]: @@ -1062,7 +1062,7 @@ def filterBorehole(self, filter={}): 'qt_top_bedrock_tvd'] not in ['', None]: params.append(int(filter['qt_top_bedrock_tvd'])) where.append(""" - qt_top_bedrock_tvd_id_cli = %s + qt_top_bedrock_tvd = %s """ % self.getIdx()) if 'lithology_top_bedrock' in keys and filter[ diff --git a/src/api-legacy/v1/borehole/copy.py b/src/api-legacy/v1/borehole/copy.py index c57d1f188..98a112b8e 100644 --- a/src/api-legacy/v1/borehole/copy.py +++ b/src/api-legacy/v1/borehole/copy.py @@ -47,9 +47,9 @@ async def execute(self, borehole, workgroup, user): qt_inclination_direction_id_cli, qt_depth_id_cli, top_bedrock_bho, - qt_top_bedrock_id_cli, + qt_top_bedrock, top_bedrock_tvd_bho, - qt_top_bedrock_tvd_id_cli, + qt_top_bedrock_tvd, groundwater_bho, --geom_bho, remarks_bho, @@ -92,10 +92,9 @@ async def execute(self, borehole, workgroup, user): qt_inclination_direction_id_cli, qt_depth_id_cli, top_bedrock_bho, - qt_top_bedrock_id_cli, + qt_top_bedrock, top_bedrock_tvd_bho, - qt_top_bedrock_tvd_id_cli, - groundwater_bho, + qt_top_bedrock_tvd, --geom_bho, remarks_bho, lithology_top_bedrock_id_cli, diff --git a/src/api-legacy/v1/borehole/get.py b/src/api-legacy/v1/borehole/get.py index bca374bd0..20f916d12 100644 --- a/src/api-legacy/v1/borehole/get.py +++ b/src/api-legacy/v1/borehole/get.py @@ -102,8 +102,8 @@ def get_sql(sql_lock='', file_permission=''): drilling_diameter_bho as drill_diameter, qt_inclination_direction_id_cli as qt_bore_inc_dir, qt_depth_id_cli as qt_depth, - qt_top_bedrock_id_cli as qt_top_bedrock, - qt_top_bedrock_tvd_id_cli as qt_top_bedrock_tvd, + qt_top_bedrock, + qt_top_bedrock_tvd, lithology_top_bedrock_id_cli as lithology_top_bedrock, lithostrat_id_cli as lithostratigraphy_top_bedrock, chronostrat_id_cli AS chronostratigraphy_top_bedrock, diff --git a/src/api-legacy/v1/borehole/list.py b/src/api-legacy/v1/borehole/list.py index 6e5c3d97d..970ef30f8 100644 --- a/src/api-legacy/v1/borehole/list.py +++ b/src/api-legacy/v1/borehole/list.py @@ -108,16 +108,10 @@ def get_sql_text(language='en', cols=None): ) as qt_depth, top_bedrock_bho as top_bedrock, - COALESCE( - qt_tbed.text_cli_{language}, - qt_tbed.text_cli_{fallback} - ) as qt_top_bedrock, + qt_top_bedrock, top_bedrock_tvd_bho as top_bedrock_tvd, - COALESCE( - qt_tbed_tvd.text_cli_{language}, - qt_tbed_tvd.text_cli_{fallback} - ) as qt_top_bedrock_tvd, + qt_top_bedrock_tvd, groundwater_bho as groundwater, @@ -128,12 +122,6 @@ def get_sql_text(language='en', cols=None): FROM bdms.borehole - LEFT JOIN bdms.codelist as qt_tbed_tvd - ON qt_tbed_tvd.id_cli = qt_top_bedrock_tvd_id_cli - - LEFT JOIN bdms.codelist as qt_tbed - ON qt_tbed.id_cli = qt_top_bedrock_id_cli - LEFT JOIN bdms.codelist as rest ON rest.id_cli = restriction_id_cli @@ -328,12 +316,6 @@ def get_sql_geolcode(cols=None, join=None, where=None): ON idf.id_bho_fk = id_bho - LEFT JOIN bdms.codelist as qt_tbed_tvd - ON qt_tbed_tvd.id_cli = qt_top_bedrock_tvd_id_cli - - LEFT JOIN bdms.codelist as qt_tbed - ON qt_tbed.id_cli = qt_top_bedrock_id_cli - LEFT JOIN bdms.codelist as rest ON rest.id_cli = restriction_id_cli diff --git a/src/api-legacy/v1/borehole/patch.py b/src/api-legacy/v1/borehole/patch.py index 90cc9c922..c340057e3 100644 --- a/src/api-legacy/v1/borehole/patch.py +++ b/src/api-legacy/v1/borehole/patch.py @@ -156,10 +156,10 @@ def get_column(field): column = 'qt_depth_id_cli' elif field == 'custom.qt_top_bedrock': - column = 'qt_top_bedrock_id_cli' + column = 'qt_top_bedrock' elif field == 'custom.qt_top_bedrock_tvd': - column = 'qt_top_bedrock_tvd_id_cli' + column = 'qt_top_bedrock_tvd' elif field == 'custom.lithology_top_bedrock': column = 'lithology_top_bedrock_id_cli' @@ -207,6 +207,8 @@ async def execute(self, id, field, value, user): 'total_depth_tvd', 'extended.top_bedrock', 'extended.top_bedrock_tvd', + 'custom.qt_top_bedrock', + 'custom.qt_top_bedrock_tvd', 'extended.groundwater', 'custom.mistakes', 'custom.remarks', @@ -281,8 +283,6 @@ async def execute(self, id, field, value, user): 'extended.status', 'custom.qt_bore_inc_dir', 'custom.qt_depth', - 'custom.qt_top_bedrock', - 'custom.qt_top_bedrock_tvd', 'custom.processing_status', 'custom.lithology_top_bedrock', 'custom.lithostratigraphy_top_bedrock', diff --git a/src/api/BdmsContext.cs b/src/api/BdmsContext.cs index 70bf8d010..8193cae03 100644 --- a/src/api/BdmsContext.cs +++ b/src/api/BdmsContext.cs @@ -124,8 +124,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity().HasOne(l => l.QtInclinationDirection).WithMany().HasForeignKey(l => l.QtInclinationDirectionId); modelBuilder.Entity().HasOne(l => l.QtLocation).WithMany().HasForeignKey(l => l.QtLocationId); modelBuilder.Entity().HasOne(l => l.QtTotalDepthTvd).WithMany().HasForeignKey(l => l.QtTotalDepthTvdId); - modelBuilder.Entity().HasOne(l => l.QtTopBedrock).WithMany().HasForeignKey(l => l.QtTopBedrockId); - modelBuilder.Entity().HasOne(l => l.QtTopBedrockTvd).WithMany().HasForeignKey(l => l.QtTopBedrockTvdId); modelBuilder.Entity().HasOne(l => l.QtReferenceElevation).WithMany().HasForeignKey(l => l.QtReferenceElevationId); modelBuilder.Entity().HasOne(l => l.ReferenceElevationType).WithMany().HasForeignKey(l => l.ReferenceElevationTypeId); modelBuilder.Entity().HasOne(l => l.Restriction).WithMany().HasForeignKey(l => l.RestrictionId); diff --git a/src/api/BdmsContextExtensions.cs b/src/api/BdmsContextExtensions.cs index 91f30ea2c..26768380b 100644 --- a/src/api/BdmsContextExtensions.cs +++ b/src/api/BdmsContextExtensions.cs @@ -71,7 +71,6 @@ public static void SeedData(this BdmsContext context) List layerKindIds = codelists.Where(c => c.Schema == "layer_kind").Select(s => s.Id).ToList(); List purposeIds = codelists.Where(c => c.Schema == "extended.purpose").Select(s => s.Id).ToList(); List statusIds = codelists.Where(c => c.Schema == "extended.status").Select(s => s.Id).ToList(); - List qtTopBedrockIds = codelists.Where(c => c.Schema == "custom.qt_top_bedrock").Select(s => s.Id).ToList(); List lithologyTopBedrockIds = codelists.Where(c => c.Schema == "custom.lithology_top_bedrock").Select(s => s.Id).ToList(); List qtInclinationDirectionIds = codelists.Where(c => c.Schema == "custom.qt_bore_inc_dir").Select(s => s.Id).ToList(); List chronostratigraphyTopBedrockIds = codelists.Where(c => c.Schema == "custom.chronostratigraphy_top_bedrock").Select(s => s.Id).ToList(); @@ -160,10 +159,9 @@ public static void SeedData(this BdmsContext context) .RuleFor(o => o.Inclination, f => f.Random.Double(0, 5).OrNull(f, .05f)) .RuleFor(o => o.InclinationDirection, f => f.Random.Double(0, 360).OrNull(f, .05f)) .RuleFor(o => o.QtDepthId, f => f.PickRandom(qtDepthIds).OrNull(f, .05f)) - .RuleFor(o => o.QtDepth, _ => default!) + .RuleFor(o => o.QtDepth, _ => default!) .RuleFor(o => o.TopBedrock, f => f.Random.Double(0, 1000).OrNull(f, .05f)) - .RuleFor(o => o.QtTopBedrockId, f => f.PickRandom(qtTopBedrockIds).OrNull(f, .05f)) - .RuleFor(o => o.QtTopBedrock, _ => default!) + .RuleFor(o => o.QtTopBedrock, f => f.Random.Double(0, 2).OrNull(f, .05f)) .RuleFor(o => o.HasGroundwater, f => f.Random.Bool().OrNull(f, .2f)) .RuleFor(o => o.Remarks, f => f.Rant.Review().OrNull(f, .05f)) .RuleFor(o => o.LithologyTopBedrockId, f => f.PickRandom(lithologyTopBedrockIds).OrNull(f, .05f)) @@ -174,8 +172,7 @@ public static void SeedData(this BdmsContext context) .RuleFor(o => o.Chronostratigraphy, _ => default!) .RuleFor(o => o.SpudDate, f => f.Date.Past().ToUniversalTime().OrNull(f, .05f)) .RuleFor(o => o.TopBedrockTvd, f => f.Random.Double(0, 1000).OrNull(f, .05f)) - .RuleFor(o => o.QtTopBedrockTvdId, f => f.PickRandom(qtTopBedrockIds).OrNull(f, .05f)) - .RuleFor(o => o.QtTopBedrockTvd, _ => default!) + .RuleFor(o => o.QtTopBedrockTvd, f => f.Random.Double(0, 2).OrNull(f, .05f)) .RuleFor(o => o.ReferenceElevation, f => f.Random.Double(0, 4500).OrNull(f, .05f)) .RuleFor(o => o.QtReferenceElevationId, f => f.PickRandom(qtElevationIds).OrNull(f, .05f)) .RuleFor(o => o.QtReferenceElevation, _ => default!) @@ -185,7 +182,7 @@ public static void SeedData(this BdmsContext context) .RuleFor(o => o.ReferenceElevationType, _ => default!) .RuleFor(o => o.TotalDepthTvd, f => f.Random.Double(0, 4500).OrNull(f, .05f)) .RuleFor(o => o.QtTotalDepthTvdId, f => f.PickRandom(qtDepthIds).OrNull(f, .05f)) - .RuleFor(o => o.QtTotalDepthTvd, _ => default!) + .RuleFor(o => o.QtTotalDepthTvd, _ => default!) .RuleFor(o => o.BoreholeCodelists, _ => new Collection()) .RuleFor(o => o.Codelists, _ => new Collection()) .RuleFor(o => o.Geometry, f => diff --git a/src/api/Controllers/UploadController.cs b/src/api/Controllers/UploadController.cs index 16c0c7c57..4a38eb8aa 100644 --- a/src/api/Controllers/UploadController.cs +++ b/src/api/Controllers/UploadController.cs @@ -484,7 +484,7 @@ public CsvImportBoreholeMap() Map(m => m.QtInclinationDirectionId).Optional(); Map(m => m.QtDepthId).Optional(); Map(m => m.TopBedrock).Optional(); - Map(m => m.QtTopBedrockId).Optional(); + Map(m => m.QtTopBedrock).Optional(); Map(m => m.HasGroundwater).Optional(); Map(m => m.Remarks).Optional(); Map(m => m.LithologyTopBedrockId).Optional(); @@ -492,7 +492,7 @@ public CsvImportBoreholeMap() Map(m => m.ChronostratigraphyId).Optional(); Map(m => m.SpudDate).Optional(); Map(m => m.TopBedrockTvd).Optional(); - Map(m => m.QtTopBedrockTvdId).Optional(); + Map(m => m.QtTopBedrockTvd).Optional(); Map(m => m.ReferenceElevation).Optional(); Map(m => m.QtReferenceElevationId).Optional(); Map(m => m.ReferenceElevationTypeId).Optional(); diff --git a/src/api/Migrations/20231204153139_AlterQtTopBedrock.Designer.cs b/src/api/Migrations/20231204153139_AlterQtTopBedrock.Designer.cs new file mode 100644 index 000000000..bd7dee191 --- /dev/null +++ b/src/api/Migrations/20231204153139_AlterQtTopBedrock.Designer.cs @@ -0,0 +1,2471 @@ +// +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("20231204153139_AlterQtTopBedrock")] +partial class AlterQtTopBedrock +{ + /// + 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.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.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.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.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("Casing") + .HasColumnType("text") + .HasColumnName("casng_id"); + + b.Property("CasingDateFinish") + .HasColumnType("timestamp with time zone") + .HasColumnName("casng_date_finish_lay"); + + b.Property("CasingDateSpud") + .HasColumnType("timestamp with time zone") + .HasColumnName("casng_date_spud_lay"); + + b.Property("CasingInnerDiameter") + .HasColumnType("double precision") + .HasColumnName("casng_inner_diameter_lay"); + + b.Property("CasingKindId") + .HasColumnType("integer") + .HasColumnName("casng_kind_id_cli"); + + b.Property("CasingMaterialId") + .HasColumnType("integer") + .HasColumnName("casng_material_id_cli"); + + b.Property("CasingOuterDiameter") + .HasColumnType("double precision") + .HasColumnName("casng_outer_diameter_lay"); + + 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("FillKindId") + .HasColumnType("integer") + .HasColumnName("fill_kind_id_cli"); + + b.Property("FillMaterialId") + .HasColumnType("integer") + .HasColumnName("fill_material_id_cli"); + + 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("Instrument") + .HasColumnType("text") + .HasColumnName("instr_id"); + + b.Property("InstrumentCasingId") + .HasColumnType("integer") + .HasColumnName("instr_id_sty_fk"); + + b.Property("InstrumentCasingLayerId") + .HasColumnType("integer") + .HasColumnName("instr_id_lay_fk"); + + b.Property("InstrumentKindId") + .HasColumnType("integer") + .HasColumnName("instr_kind_id_cli"); + + b.Property("InstrumentStatusId") + .HasColumnType("integer") + .HasColumnName("instr_status_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("CasingKindId"); + + b.HasIndex("CasingMaterialId"); + + b.HasIndex("CohesionId"); + + b.HasIndex("CompactnessId"); + + b.HasIndex("ConsistanceId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("FillKindId"); + + b.HasIndex("FillMaterialId"); + + b.HasIndex("GradationId"); + + b.HasIndex("GrainSize1Id"); + + b.HasIndex("GrainSize2Id"); + + b.HasIndex("HumidityId"); + + b.HasIndex("InstrumentCasingId"); + + b.HasIndex("InstrumentKindId"); + + b.HasIndex("InstrumentStatusId"); + + 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("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("lithological_description", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.LithostratigraphyLayer", 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("FromDepth") + .HasColumnType("double precision") + .HasColumnName("depth_from"); + + b.Property("IsLast") + .HasColumnType("boolean") + .HasColumnName("is_last"); + + b.Property("LithostratigraphyId") + .HasColumnType("integer") + .HasColumnName("lithostratigraphy_id"); + + b.Property("StratigraphyId") + .HasColumnType("integer") + .HasColumnName("stratigraphy_id"); + + 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("LithostratigraphyId"); + + b.HasIndex("StratigraphyId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("lithostratigraphy", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.Observation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BoreholeId") + .HasColumnType("integer") + .HasColumnName("borehole_id"); + + b.Property("CasingId") + .HasColumnType("integer") + .HasColumnName("casing"); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment"); + + b.Property("CompletionFinished") + .HasColumnType("boolean") + .HasColumnName("completion_finished"); + + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation"); + + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("creator"); + + b.Property("Duration") + .HasColumnType("double precision") + .HasColumnName("duration"); + + b.Property("EndTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("end_time"); + + b.Property("FromDepthM") + .HasColumnType("double precision") + .HasColumnName("from_depth_m"); + + b.Property("FromDepthMasl") + .HasColumnType("double precision") + .HasColumnName("from_depth_masl"); + + b.Property("ReliabilityId") + .HasColumnType("integer") + .HasColumnName("reliability"); + + b.Property("StartTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("start_time"); + + b.Property("ToDepthM") + .HasColumnType("double precision") + .HasColumnName("to_depth_m"); + + b.Property("ToDepthMasl") + .HasColumnType("double precision") + .HasColumnName("to_depth_masl"); + + b.Property("Type") + .HasColumnType("integer") + .HasColumnName("observation_type"); + + 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("CasingId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("ReliabilityId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("observation", "bdms"); + + b.UseTptMappingStrategy(); + }); + + modelBuilder.Entity("BDMS.Models.Stratigraphy", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_sty"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BoreholeId") + .HasColumnType("integer") + .HasColumnName("id_bho_fk"); + + b.Property("Casing") + .HasColumnType("text") + .HasColumnName("casng_id"); + + b.Property("CasingDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("casng_date_abd_sty"); + + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation_sty"); + + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("author_sty"); + + b.Property("Date") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_sty"); + + b.Property("FillCasingId") + .HasColumnType("integer") + .HasColumnName("fill_casng_id_sty_fk"); + + b.Property("IsPrimary") + .HasColumnType("boolean") + .HasColumnName("primary_sty"); + + b.Property("KindId") + .HasColumnType("integer") + .HasColumnName("kind_id_cli"); + + b.Property("Name") + .HasColumnType("text") + .HasColumnName("name_sty"); + + b.Property("Notes") + .HasColumnType("text") + .HasColumnName("notes_sty"); + + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("update_sty"); + + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updater_sty"); + + b.HasKey("Id"); + + b.HasIndex("BoreholeId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("FillCasingId"); + + b.HasIndex("KindId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("stratigraphy", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.Term", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_tes"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Creation") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation_tes"); + + b.Property("Expiration") + .HasColumnType("timestamp with time zone") + .HasColumnName("expired_tes"); + + b.Property("IsDraft") + .HasColumnType("boolean") + .HasColumnName("draft_tes"); + + b.Property("TextDe") + .HasColumnType("text") + .HasColumnName("text_tes_de"); + + b.Property("TextEn") + .IsRequired() + .HasColumnType("text") + .HasColumnName("text_tes_en"); + + b.Property("TextFr") + .HasColumnType("text") + .HasColumnName("text_tes_fr"); + + b.Property("TextIt") + .HasColumnType("text") + .HasColumnName("text_tes_it"); + + b.Property("TextRo") + .HasColumnType("text") + .HasColumnName("text_tes_ro"); + + b.HasKey("Id"); + + b.ToTable("terms", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_usr"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DisabledAt") + .HasColumnType("timestamp with time zone") + .HasColumnName("disabled_usr"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("text") + .HasColumnName("firstname"); + + b.Property("IsAdmin") + .HasColumnType("boolean") + .HasColumnName("admin_usr"); + + b.Property("IsViewer") + .HasColumnType("boolean") + .HasColumnName("viewer_usr"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("text") + .HasColumnName("lastname"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("username"); + + b.HasKey("Id"); + + b.ToTable("users", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.UserEvent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_evs"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("created_evs"); + + b.Property("Payload") + .HasColumnType("jsonb") + .HasColumnName("payload_evs"); + + b.Property("Topic") + .IsRequired() + .HasColumnType("text") + .HasColumnName("topic_evs"); + + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("id_usr_fk"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("events", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.UserWorkgroupRole", b => + { + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("id_usr_fk"); + + b.Property("WorkgroupId") + .HasColumnType("integer") + .HasColumnName("id_wgp_fk"); + + b.Property("Role") + .HasColumnType("int") + .HasColumnName("id_rol_fk"); + + b.HasKey("UserId", "WorkgroupId", "Role"); + + b.ToTable("users_roles", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.Workflow", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_wkf"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BoreholeId") + .HasColumnType("integer") + .HasColumnName("id_bho_fk"); + + b.Property("Finished") + .HasColumnType("timestamp with time zone") + .HasColumnName("finished_wkf"); + + b.Property("Notes") + .HasColumnType("text") + .HasColumnName("notes_wkf"); + + b.Property("Role") + .HasColumnType("integer") + .HasColumnName("id_rol_fk"); + + b.Property("Started") + .HasColumnType("timestamp with time zone") + .HasColumnName("started_wkf"); + + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("id_usr_fk"); + + b.HasKey("Id"); + + b.HasIndex("BoreholeId"); + + b.HasIndex("UserId"); + + b.ToTable("workflow", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.Workgroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_wgp"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("created_wgp"); + + b.Property("Disabled") + .HasColumnType("timestamp with time zone") + .HasColumnName("disabled_wgp"); + + b.Property("IsSupplier") + .HasColumnType("boolean") + .HasColumnName("supplier_wgp"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name_wgp"); + + b.Property("Settings") + .HasColumnType("json") + .HasColumnName("settings_wgp"); + + b.HasKey("Id"); + + b.ToTable("workgroups", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.FieldMeasurement", b => + { + b.HasBaseType("BDMS.Models.Observation"); + + b.Property("ParameterId") + .HasColumnType("integer") + .HasColumnName("parameter"); + + b.Property("SampleTypeId") + .HasColumnType("integer") + .HasColumnName("sample_type"); + + b.Property("Value") + .HasColumnType("double precision") + .HasColumnName("value"); + + b.HasIndex("ParameterId"); + + b.HasIndex("SampleTypeId"); + + b.ToTable("field_measurement", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.GroundwaterLevelMeasurement", b => + { + b.HasBaseType("BDMS.Models.Observation"); + + b.Property("KindId") + .HasColumnType("integer") + .HasColumnName("kind"); + + b.Property("LevelM") + .HasColumnType("double precision") + .HasColumnName("level_m"); + + b.Property("LevelMasl") + .HasColumnType("double precision") + .HasColumnName("level_masl"); + + b.HasIndex("KindId"); + + b.ToTable("groundwater_level_measurement", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.Hydrotest", b => + { + b.HasBaseType("BDMS.Models.Observation"); + + b.ToTable("hydrotest", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.WaterIngress", b => + { + b.HasBaseType("BDMS.Models.Observation"); + + b.Property("ConditionsId") + .HasColumnType("integer") + .HasColumnName("conditions"); + + b.Property("QuantityId") + .HasColumnType("integer") + .HasColumnName("quantity"); + + b.HasIndex("ConditionsId"); + + b.HasIndex("QuantityId"); + + b.ToTable("water_ingress", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.Borehole", b => + { + b.HasOne("BDMS.Models.Codelist", "Chronostratigraphy") + .WithMany() + .HasForeignKey("ChronostratigraphyId"); + + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.Codelist", "Cuttings") + .WithMany() + .HasForeignKey("CuttingsId"); + + b.HasOne("BDMS.Models.Codelist", "DrillingMethod") + .WithMany() + .HasForeignKey("DrillingMethodId"); + + b.HasOne("BDMS.Models.Codelist", "Hrs") + .WithMany() + .HasForeignKey("HrsId"); + + b.HasOne("BDMS.Models.Codelist", "Kind") + .WithMany() + .HasForeignKey("KindId"); + + b.HasOne("BDMS.Models.Codelist", "LithologyTopBedrock") + .WithMany() + .HasForeignKey("LithologyTopBedrockId"); + + b.HasOne("BDMS.Models.Codelist", "Lithostratigraphy") + .WithMany() + .HasForeignKey("LithostratigraphyId"); + + b.HasOne("BDMS.Models.User", "LockedBy") + .WithMany() + .HasForeignKey("LockedById"); + + b.HasOne("BDMS.Models.Codelist", "Purpose") + .WithMany() + .HasForeignKey("PurposeId"); + + b.HasOne("BDMS.Models.Codelist", "QtDepth") + .WithMany() + .HasForeignKey("QtDepthId"); + + b.HasOne("BDMS.Models.Codelist", "QtElevation") + .WithMany() + .HasForeignKey("QtElevationId"); + + b.HasOne("BDMS.Models.Codelist", "QtInclinationDirection") + .WithMany() + .HasForeignKey("QtInclinationDirectionId"); + + b.HasOne("BDMS.Models.Codelist", "QtLocation") + .WithMany() + .HasForeignKey("QtLocationId"); + + b.HasOne("BDMS.Models.Codelist", "QtReferenceElevation") + .WithMany() + .HasForeignKey("QtReferenceElevationId"); + + b.HasOne("BDMS.Models.Codelist", "QtTotalDepthTvd") + .WithMany() + .HasForeignKey("QtTotalDepthTvdId"); + + b.HasOne("BDMS.Models.Codelist", "ReferenceElevationType") + .WithMany() + .HasForeignKey("ReferenceElevationTypeId"); + + b.HasOne("BDMS.Models.Codelist", "Restriction") + .WithMany() + .HasForeignKey("RestrictionId"); + + b.HasOne("BDMS.Models.Codelist", "Status") + .WithMany() + .HasForeignKey("StatusId"); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.HasOne("BDMS.Models.Workgroup", "Workgroup") + .WithMany("Boreholes") + .HasForeignKey("WorkgroupId"); + + b.Navigation("Chronostratigraphy"); + + b.Navigation("CreatedBy"); + + b.Navigation("Cuttings"); + + b.Navigation("DrillingMethod"); + + b.Navigation("Hrs"); + + b.Navigation("Kind"); + + b.Navigation("LithologyTopBedrock"); + + b.Navigation("Lithostratigraphy"); + + b.Navigation("LockedBy"); + + b.Navigation("Purpose"); + + b.Navigation("QtDepth"); + + b.Navigation("QtElevation"); + + b.Navigation("QtInclinationDirection"); + + b.Navigation("QtLocation"); + + b.Navigation("QtReferenceElevation"); + + b.Navigation("QtTotalDepthTvd"); + + b.Navigation("ReferenceElevationType"); + + b.Navigation("Restriction"); + + b.Navigation("Status"); + + b.Navigation("UpdatedBy"); + + b.Navigation("Workgroup"); + }); + + modelBuilder.Entity("BDMS.Models.BoreholeCodelist", b => + { + b.HasOne("BDMS.Models.Borehole", "Borehole") + .WithMany("BoreholeCodelists") + .HasForeignKey("BoreholeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Codelist", "Codelist") + .WithMany("BoreholeCodelists") + .HasForeignKey("CodelistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Borehole"); + + b.Navigation("Codelist"); + }); + + modelBuilder.Entity("BDMS.Models.BoreholeFile", b => + { + b.HasOne("BDMS.Models.Borehole", "Borehole") + .WithMany("BoreholeFiles") + .HasForeignKey("BoreholeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.File", "File") + .WithMany("BoreholeFiles") + .HasForeignKey("FileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.HasOne("BDMS.Models.User", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("Borehole"); + + b.Navigation("CreatedBy"); + + b.Navigation("File"); + + b.Navigation("UpdatedBy"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BDMS.Models.ChronostratigraphyLayer", b => + { + b.HasOne("BDMS.Models.Codelist", "Chronostratigraphy") + .WithMany() + .HasForeignKey("ChronostratigraphyId"); + + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.Stratigraphy", "Stratigraphy") + .WithMany("ChronostratigraphyLayers") + .HasForeignKey("StratigraphyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("Chronostratigraphy"); + + b.Navigation("CreatedBy"); + + b.Navigation("Stratigraphy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("BDMS.Models.FaciesDescription", b => + { + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.Codelist", "QtDescription") + .WithMany() + .HasForeignKey("QtDescriptionId"); + + b.HasOne("BDMS.Models.Stratigraphy", "Stratigraphy") + .WithMany("FaciesDescriptions") + .HasForeignKey("StratigraphyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("CreatedBy"); + + b.Navigation("QtDescription"); + + b.Navigation("Stratigraphy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("BDMS.Models.File", b => + { + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("CreatedBy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("BDMS.Models.HydrotestCodelist", b => + { + b.HasOne("BDMS.Models.Codelist", "Codelist") + .WithMany("HydrotestCodelists") + .HasForeignKey("CodelistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Hydrotest", "Hydrotest") + .WithMany("HydrotestCodelists") + .HasForeignKey("HydrotestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Codelist"); + + b.Navigation("Hydrotest"); + }); + + modelBuilder.Entity("BDMS.Models.HydrotestResult", b => + { + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.Hydrotest", "Hydrotest") + .WithMany("HydrotestResults") + .HasForeignKey("HydrotestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Codelist", "Parameter") + .WithMany() + .HasForeignKey("ParameterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("CreatedBy"); + + b.Navigation("Hydrotest"); + + b.Navigation("Parameter"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("BDMS.Models.Layer", b => + { + b.HasOne("BDMS.Models.Codelist", "Alteration") + .WithMany() + .HasForeignKey("AlterationId"); + + b.HasOne("BDMS.Models.Codelist", "CasingKind") + .WithMany() + .HasForeignKey("CasingKindId"); + + b.HasOne("BDMS.Models.Codelist", "CasingMaterial") + .WithMany() + .HasForeignKey("CasingMaterialId"); + + b.HasOne("BDMS.Models.Codelist", "Cohesion") + .WithMany() + .HasForeignKey("CohesionId"); + + b.HasOne("BDMS.Models.Codelist", "Compactness") + .WithMany() + .HasForeignKey("CompactnessId"); + + b.HasOne("BDMS.Models.Codelist", "Consistance") + .WithMany() + .HasForeignKey("ConsistanceId"); + + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.Codelist", "FillKind") + .WithMany() + .HasForeignKey("FillKindId"); + + b.HasOne("BDMS.Models.Codelist", "FillMaterial") + .WithMany() + .HasForeignKey("FillMaterialId"); + + b.HasOne("BDMS.Models.Codelist", "Gradation") + .WithMany() + .HasForeignKey("GradationId"); + + b.HasOne("BDMS.Models.Codelist", "GrainSize1") + .WithMany() + .HasForeignKey("GrainSize1Id"); + + b.HasOne("BDMS.Models.Codelist", "GrainSize2") + .WithMany() + .HasForeignKey("GrainSize2Id"); + + b.HasOne("BDMS.Models.Codelist", "Humidity") + .WithMany() + .HasForeignKey("HumidityId"); + + b.HasOne("BDMS.Models.Stratigraphy", "InstrumentCasing") + .WithMany() + .HasForeignKey("InstrumentCasingId"); + + b.HasOne("BDMS.Models.Codelist", "InstrumentKind") + .WithMany() + .HasForeignKey("InstrumentKindId"); + + b.HasOne("BDMS.Models.Codelist", "InstrumentStatus") + .WithMany() + .HasForeignKey("InstrumentStatusId"); + + b.HasOne("BDMS.Models.Codelist", "Lithology") + .WithMany() + .HasForeignKey("LithologyId"); + + b.HasOne("BDMS.Models.Codelist", "LithologyTopBedrock") + .WithMany() + .HasForeignKey("LithologyTopBedrockId"); + + b.HasOne("BDMS.Models.Codelist", "Lithostratigraphy") + .WithMany() + .HasForeignKey("LithostratigraphyId"); + + b.HasOne("BDMS.Models.Codelist", "Plasticity") + .WithMany() + .HasForeignKey("PlasticityId"); + + b.HasOne("BDMS.Models.Codelist", "QtDescription") + .WithMany() + .HasForeignKey("QtDescriptionId"); + + b.HasOne("BDMS.Models.Stratigraphy", "Stratigraphy") + .WithMany("Layers") + .HasForeignKey("StratigraphyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.HasOne("BDMS.Models.Codelist", "Uscs1") + .WithMany() + .HasForeignKey("Uscs1Id"); + + b.HasOne("BDMS.Models.Codelist", "Uscs2") + .WithMany() + .HasForeignKey("Uscs2Id"); + + b.HasOne("BDMS.Models.Codelist", "UscsDetermination") + .WithMany() + .HasForeignKey("UscsDeterminationId"); + + b.Navigation("Alteration"); + + b.Navigation("CasingKind"); + + b.Navigation("CasingMaterial"); + + b.Navigation("Cohesion"); + + b.Navigation("Compactness"); + + b.Navigation("Consistance"); + + b.Navigation("CreatedBy"); + + b.Navigation("FillKind"); + + b.Navigation("FillMaterial"); + + b.Navigation("Gradation"); + + b.Navigation("GrainSize1"); + + b.Navigation("GrainSize2"); + + b.Navigation("Humidity"); + + b.Navigation("InstrumentCasing"); + + b.Navigation("InstrumentKind"); + + b.Navigation("InstrumentStatus"); + + b.Navigation("Lithology"); + + b.Navigation("LithologyTopBedrock"); + + b.Navigation("Lithostratigraphy"); + + b.Navigation("Plasticity"); + + b.Navigation("QtDescription"); + + b.Navigation("Stratigraphy"); + + b.Navigation("UpdatedBy"); + + b.Navigation("Uscs1"); + + b.Navigation("Uscs2"); + + b.Navigation("UscsDetermination"); + }); + + modelBuilder.Entity("BDMS.Models.LayerCodelist", b => + { + b.HasOne("BDMS.Models.Codelist", "Codelist") + .WithMany("LayerCodelists") + .HasForeignKey("CodelistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Layer", "Layer") + .WithMany("LayerCodelists") + .HasForeignKey("LayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Codelist"); + + b.Navigation("Layer"); + }); + + modelBuilder.Entity("BDMS.Models.LithologicalDescription", b => + { + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.Codelist", "QtDescription") + .WithMany() + .HasForeignKey("QtDescriptionId"); + + b.HasOne("BDMS.Models.Stratigraphy", "Stratigraphy") + .WithMany("LithologicalDescriptions") + .HasForeignKey("StratigraphyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("CreatedBy"); + + b.Navigation("QtDescription"); + + b.Navigation("Stratigraphy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("BDMS.Models.LithostratigraphyLayer", b => + { + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.Codelist", "Lithostratigraphy") + .WithMany() + .HasForeignKey("LithostratigraphyId"); + + b.HasOne("BDMS.Models.Stratigraphy", "Stratigraphy") + .WithMany("LithostratigraphyLayers") + .HasForeignKey("StratigraphyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("CreatedBy"); + + b.Navigation("Lithostratigraphy"); + + b.Navigation("Stratigraphy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("BDMS.Models.Observation", b => + { + b.HasOne("BDMS.Models.Borehole", "Borehole") + .WithMany() + .HasForeignKey("BoreholeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Stratigraphy", "Casing") + .WithMany() + .HasForeignKey("CasingId"); + + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.Codelist", "Reliability") + .WithMany() + .HasForeignKey("ReliabilityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("Borehole"); + + b.Navigation("Casing"); + + b.Navigation("CreatedBy"); + + b.Navigation("Reliability"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("BDMS.Models.Stratigraphy", b => + { + b.HasOne("BDMS.Models.Borehole", "Borehole") + .WithMany("Stratigraphies") + .HasForeignKey("BoreholeId"); + + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.Stratigraphy", "FillCasing") + .WithMany() + .HasForeignKey("FillCasingId"); + + b.HasOne("BDMS.Models.Codelist", "Kind") + .WithMany() + .HasForeignKey("KindId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("Borehole"); + + b.Navigation("CreatedBy"); + + b.Navigation("FillCasing"); + + b.Navigation("Kind"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("BDMS.Models.UserEvent", b => + { + b.HasOne("BDMS.Models.User", "User") + .WithMany("BoringEvents") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BDMS.Models.UserWorkgroupRole", b => + { + b.HasOne("BDMS.Models.User", null) + .WithMany("WorkgroupRoles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("BDMS.Models.Workflow", b => + { + b.HasOne("BDMS.Models.Borehole", "Borehole") + .WithMany("Workflows") + .HasForeignKey("BoreholeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Borehole"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BDMS.Models.FieldMeasurement", b => + { + b.HasOne("BDMS.Models.Observation", null) + .WithOne() + .HasForeignKey("BDMS.Models.FieldMeasurement", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Codelist", "Parameter") + .WithMany() + .HasForeignKey("ParameterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Codelist", "SampleType") + .WithMany() + .HasForeignKey("SampleTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Parameter"); + + b.Navigation("SampleType"); + }); + + modelBuilder.Entity("BDMS.Models.GroundwaterLevelMeasurement", b => + { + b.HasOne("BDMS.Models.Observation", null) + .WithOne() + .HasForeignKey("BDMS.Models.GroundwaterLevelMeasurement", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Codelist", "Kind") + .WithMany() + .HasForeignKey("KindId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Kind"); + }); + + modelBuilder.Entity("BDMS.Models.Hydrotest", b => + { + b.HasOne("BDMS.Models.Observation", null) + .WithOne() + .HasForeignKey("BDMS.Models.Hydrotest", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("BDMS.Models.WaterIngress", b => + { + b.HasOne("BDMS.Models.Codelist", "Conditions") + .WithMany() + .HasForeignKey("ConditionsId"); + + b.HasOne("BDMS.Models.Observation", null) + .WithOne() + .HasForeignKey("BDMS.Models.WaterIngress", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Codelist", "Quantity") + .WithMany() + .HasForeignKey("QuantityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Conditions"); + + b.Navigation("Quantity"); + }); + + modelBuilder.Entity("BDMS.Models.Borehole", b => + { + b.Navigation("BoreholeCodelists"); + + b.Navigation("BoreholeFiles"); + + b.Navigation("Stratigraphies"); + + b.Navigation("Workflows"); + }); + + modelBuilder.Entity("BDMS.Models.Codelist", b => + { + b.Navigation("BoreholeCodelists"); + + b.Navigation("HydrotestCodelists"); + + b.Navigation("LayerCodelists"); + }); + + modelBuilder.Entity("BDMS.Models.File", b => + { + b.Navigation("BoreholeFiles"); + }); + + modelBuilder.Entity("BDMS.Models.Layer", b => + { + b.Navigation("LayerCodelists"); + }); + + modelBuilder.Entity("BDMS.Models.Stratigraphy", b => + { + b.Navigation("ChronostratigraphyLayers"); + + b.Navigation("FaciesDescriptions"); + + b.Navigation("Layers"); + + b.Navigation("LithologicalDescriptions"); + + b.Navigation("LithostratigraphyLayers"); + }); + + modelBuilder.Entity("BDMS.Models.User", b => + { + b.Navigation("BoringEvents"); + + b.Navigation("WorkgroupRoles"); + }); + + modelBuilder.Entity("BDMS.Models.Workgroup", b => + { + b.Navigation("Boreholes"); + }); + + modelBuilder.Entity("BDMS.Models.Hydrotest", b => + { + b.Navigation("HydrotestCodelists"); + + b.Navigation("HydrotestResults"); + }); +#pragma warning restore 612, 618 + } +} diff --git a/src/api/Migrations/20231204153139_AlterQtTopBedrock.cs b/src/api/Migrations/20231204153139_AlterQtTopBedrock.cs new file mode 100644 index 000000000..94ef9dbf9 --- /dev/null +++ b/src/api/Migrations/20231204153139_AlterQtTopBedrock.cs @@ -0,0 +1,84 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BDMS.Migrations; + +/// +public partial class AlterQtTopBedrock : Migration +{ + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "borehole_qt_top_bedrock_id_cli_fkey", + schema: "bdms", + table: "borehole"); + + migrationBuilder.DropForeignKey( + name: "borehole_qt_top_bedrock_tvd_id_cli_fkey", + schema: "bdms", + table: "borehole"); + + migrationBuilder.DropIndex( + name: "IX_borehole_qt_top_bedrock_id_cli_fkey", + schema: "bdms", + table: "borehole"); + + migrationBuilder.DropIndex( + name: "IX_borehole_qt_top_bedrock_tvd_id_cli_fkey", + schema: "bdms", + table: "borehole"); + + migrationBuilder.AddColumn( + name: "qt_top_bedrock", + schema: "bdms", + table: "borehole", + type: "double precision", + nullable: true); + + migrationBuilder.AddColumn( + name: "qt_top_bedrock_tvd", + schema: "bdms", + table: "borehole", + type: "double precision", + nullable: true); + + migrationBuilder.Sql(@" + UPDATE bdms.borehole + SET qt_top_bedrock = CASE + WHEN qt_top_bedrock_id_cli = 22108001 THEN 2.0 + WHEN qt_top_bedrock_id_cli = 22108002 THEN 1.0 + WHEN qt_top_bedrock_id_cli = 22108003 THEN 0.5 + WHEN qt_top_bedrock_id_cli = 22108004 THEN 0.1 + ELSE NULL + END; + "); + + migrationBuilder.Sql(@" + UPDATE bdms.borehole + SET qt_top_bedrock_tvd = CASE + WHEN qt_top_bedrock_tvd_id_cli = 22108001 THEN 2.0 + WHEN qt_top_bedrock_tvd_id_cli = 22108002 THEN 1.0 + WHEN qt_top_bedrock_tvd_id_cli = 22108003 THEN 0.5 + WHEN qt_top_bedrock_tvd_id_cli = 22108004 THEN 0.1 + ELSE NULL + END; + "); + + migrationBuilder.DropColumn( + name: "qt_top_bedrock_id_cli", + schema: "bdms", + table: "borehole"); + + migrationBuilder.DropColumn( + name: "qt_top_bedrock_tvd_id_cli", + schema: "bdms", + table: "borehole"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + } +} diff --git a/src/api/Migrations/BdmsContextModelSnapshot.cs b/src/api/Migrations/BdmsContextModelSnapshot.cs index 4a13edd57..0fb8df2f1 100644 --- a/src/api/Migrations/BdmsContextModelSnapshot.cs +++ b/src/api/Migrations/BdmsContextModelSnapshot.cs @@ -9,2477 +9,2460 @@ #nullable disable -namespace BDMS.Migrations +namespace BDMS.Migrations; + +[DbContext(typeof(BdmsContext))] +partial class BdmsContextModelSnapshot : ModelSnapshot { - [DbContext(typeof(BdmsContext))] - partial class BdmsContextModelSnapshot : ModelSnapshot + protected override void BuildModel(ModelBuilder modelBuilder) { - protected override void BuildModel(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.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"); + 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.Borehole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_bho"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CuttingsId") - .HasColumnType("integer") - .HasColumnName("cuttings_id_cli"); + b.Property("AlternateName") + .HasColumnType("text") + .HasColumnName("alternate_name_bho"); - b.Property("DrillingDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("drilling_date_bho"); + b.Property("Canton") + .HasColumnType("text") + .HasColumnName("canton_bho"); - b.Property("DrillingDiameter") - .HasColumnType("double precision") - .HasColumnName("drilling_diameter_bho"); + b.Property("ChronostratigraphyId") + .HasColumnType("integer") + .HasColumnName("chronostrat_id_cli"); - b.Property("DrillingMethodId") - .HasColumnType("integer") - .HasColumnName("drilling_method_id_cli"); + b.Property("Country") + .HasColumnType("text") + .HasColumnName("country_bho"); - b.Property("ElevationZ") - .HasColumnType("double precision") - .HasColumnName("elevation_z_bho"); + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("created_bho"); - b.Property("Geometry") - .HasColumnType("geometry") - .HasColumnName("geom_bho"); + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("created_by_bho"); - b.Property("HasGroundwater") - .HasColumnType("boolean") - .HasColumnName("groundwater_bho"); + b.Property("CuttingsId") + .HasColumnType("integer") + .HasColumnName("cuttings_id_cli"); - b.Property("HrsId") - .HasColumnType("integer") - .HasColumnName("hrs_id_cli"); + b.Property("DrillingDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("drilling_date_bho"); - b.Property("Inclination") - .HasColumnType("double precision") - .HasColumnName("inclination_bho"); + b.Property("DrillingDiameter") + .HasColumnType("double precision") + .HasColumnName("drilling_diameter_bho"); - b.Property("InclinationDirection") - .HasColumnType("double precision") - .HasColumnName("inclination_direction_bho"); + b.Property("DrillingMethodId") + .HasColumnType("integer") + .HasColumnName("drilling_method_id_cli"); - b.Property("IsPublic") - .HasColumnType("boolean") - .HasColumnName("public_bho"); + b.Property("ElevationZ") + .HasColumnType("double precision") + .HasColumnName("elevation_z_bho"); - b.Property("KindId") - .HasColumnType("integer") - .HasColumnName("kind_id_cli"); + b.Property("Geometry") + .HasColumnType("geometry") + .HasColumnName("geom_bho"); - b.Property("LithologyTopBedrockId") - .HasColumnType("integer") - .HasColumnName("lithology_top_bedrock_id_cli"); + b.Property("HasGroundwater") + .HasColumnType("boolean") + .HasColumnName("groundwater_bho"); - b.Property("LithostratigraphyId") - .HasColumnType("integer") - .HasColumnName("lithostrat_id_cli"); + b.Property("HrsId") + .HasColumnType("integer") + .HasColumnName("hrs_id_cli"); - b.Property("LocationX") - .HasColumnType("double precision") - .HasColumnName("location_x_bho"); + b.Property("Inclination") + .HasColumnType("double precision") + .HasColumnName("inclination_bho"); - b.Property("LocationXLV03") - .HasColumnType("double precision") - .HasColumnName("location_x_lv03_bho"); + b.Property("InclinationDirection") + .HasColumnType("double precision") + .HasColumnName("inclination_direction_bho"); - b.Property("LocationY") - .HasColumnType("double precision") - .HasColumnName("location_y_bho"); + b.Property("IsPublic") + .HasColumnType("boolean") + .HasColumnName("public_bho"); - b.Property("LocationYLV03") - .HasColumnType("double precision") - .HasColumnName("location_y_lv03_bho"); + b.Property("KindId") + .HasColumnType("integer") + .HasColumnName("kind_id_cli"); - b.Property("Locked") - .HasColumnType("timestamp with time zone") - .HasColumnName("locked_bho"); + b.Property("LithologyTopBedrockId") + .HasColumnType("integer") + .HasColumnName("lithology_top_bedrock_id_cli"); - b.Property("LockedById") - .HasColumnType("integer") - .HasColumnName("locked_by_bho"); + b.Property("LithostratigraphyId") + .HasColumnType("integer") + .HasColumnName("lithostrat_id_cli"); - b.Property("Municipality") - .HasColumnType("text") - .HasColumnName("municipality_bho"); + b.Property("LocationX") + .HasColumnType("double precision") + .HasColumnName("location_x_bho"); - b.Property("NationalInterest") - .HasColumnType("boolean") - .HasColumnName("national_interest"); + b.Property("LocationXLV03") + .HasColumnType("double precision") + .HasColumnName("location_x_lv03_bho"); - b.Property("OriginalName") - .HasColumnType("text") - .HasColumnName("original_name_bho"); + b.Property("LocationY") + .HasColumnType("double precision") + .HasColumnName("location_y_bho"); - b.Property("OriginalReferenceSystem") - .HasColumnType("integer") - .HasColumnName("srs_id_cli"); + b.Property("LocationYLV03") + .HasColumnType("double precision") + .HasColumnName("location_y_lv03_bho"); - b.Property("ProjectName") - .HasColumnType("text") - .HasColumnName("project_name_bho"); + b.Property("Locked") + .HasColumnType("timestamp with time zone") + .HasColumnName("locked_bho"); - b.Property("PurposeId") - .HasColumnType("integer") - .HasColumnName("purpose_id_cli"); + b.Property("LockedById") + .HasColumnType("integer") + .HasColumnName("locked_by_bho"); - b.Property("QtDepthId") - .HasColumnType("integer") - .HasColumnName("qt_depth_id_cli"); + b.Property("Municipality") + .HasColumnType("text") + .HasColumnName("municipality_bho"); - b.Property("QtElevationId") - .HasColumnType("integer") - .HasColumnName("qt_elevation_id_cli"); + b.Property("NationalInterest") + .HasColumnType("boolean") + .HasColumnName("national_interest"); - b.Property("QtInclinationDirectionId") - .HasColumnType("integer") - .HasColumnName("qt_inclination_direction_id_cli"); + b.Property("OriginalName") + .HasColumnType("text") + .HasColumnName("original_name_bho"); - b.Property("QtLocationId") - .HasColumnType("integer") - .HasColumnName("qt_location_id_cli"); + b.Property("OriginalReferenceSystem") + .HasColumnType("integer") + .HasColumnName("srs_id_cli"); - b.Property("QtReferenceElevationId") - .HasColumnType("integer") - .HasColumnName("qt_reference_elevation_id_cli"); + b.Property("ProjectName") + .HasColumnType("text") + .HasColumnName("project_name_bho"); - b.Property("QtTopBedrockId") - .HasColumnType("integer") - .HasColumnName("qt_top_bedrock_id_cli"); + b.Property("PurposeId") + .HasColumnType("integer") + .HasColumnName("purpose_id_cli"); - b.Property("QtTopBedrockTvdId") - .HasColumnType("integer") - .HasColumnName("qt_top_bedrock_tvd_id_cli"); + b.Property("QtDepthId") + .HasColumnType("integer") + .HasColumnName("qt_depth_id_cli"); - b.Property("QtTotalDepthTvdId") - .HasColumnType("integer") - .HasColumnName("qt_total_depth_tvd_id_cli"); + b.Property("QtElevationId") + .HasColumnType("integer") + .HasColumnName("qt_elevation_id_cli"); - b.Property("ReferenceElevation") - .HasColumnType("double precision") - .HasColumnName("reference_elevation_bho"); + b.Property("QtInclinationDirectionId") + .HasColumnType("integer") + .HasColumnName("qt_inclination_direction_id_cli"); - b.Property("ReferenceElevationTypeId") - .HasColumnType("integer") - .HasColumnName("reference_elevation_type_id_cli"); + b.Property("QtLocationId") + .HasColumnType("integer") + .HasColumnName("qt_location_id_cli"); - b.Property("Remarks") - .HasColumnType("text") - .HasColumnName("remarks_bho"); + b.Property("QtReferenceElevationId") + .HasColumnType("integer") + .HasColumnName("qt_reference_elevation_id_cli"); - b.Property("RestrictionId") - .HasColumnType("integer") - .HasColumnName("restriction_id_cli"); + b.Property("QtTopBedrock") + .HasColumnType("double precision") + .HasColumnName("qt_top_bedrock"); - b.Property("RestrictionUntil") - .HasColumnType("timestamp with time zone") - .HasColumnName("restriction_until_bho"); + b.Property("QtTopBedrockTvd") + .HasColumnType("double precision") + .HasColumnName("qt_top_bedrock_tvd"); - b.Property("SpudDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("spud_date_bho"); + b.Property("QtTotalDepthTvdId") + .HasColumnType("integer") + .HasColumnName("qt_total_depth_tvd_id_cli"); - b.Property("StatusId") - .HasColumnType("integer") - .HasColumnName("status_id_cli"); + b.Property("ReferenceElevation") + .HasColumnType("double precision") + .HasColumnName("reference_elevation_bho"); - b.Property("TopBedrock") - .HasColumnType("double precision") - .HasColumnName("top_bedrock_bho"); + b.Property("ReferenceElevationTypeId") + .HasColumnType("integer") + .HasColumnName("reference_elevation_type_id_cli"); - b.Property("TopBedrockTvd") - .HasColumnType("double precision") - .HasColumnName("top_bedrock_tvd_bho"); + b.Property("Remarks") + .HasColumnType("text") + .HasColumnName("remarks_bho"); - b.Property("TotalDepth") - .HasColumnType("double precision") - .HasColumnName("total_depth_bho"); + b.Property("RestrictionId") + .HasColumnType("integer") + .HasColumnName("restriction_id_cli"); - b.Property("TotalDepthTvd") - .HasColumnType("double precision") - .HasColumnName("total_depth_tvd_bho"); + b.Property("RestrictionUntil") + .HasColumnType("timestamp with time zone") + .HasColumnName("restriction_until_bho"); - b.Property("Updated") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_bho"); + b.Property("SpudDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("spud_date_bho"); - b.Property("UpdatedById") - .HasColumnType("integer") - .HasColumnName("updated_by_bho"); + b.Property("StatusId") + .HasColumnType("integer") + .HasColumnName("status_id_cli"); - b.Property("WorkgroupId") - .HasColumnType("integer") - .HasColumnName("id_wgp_fk"); + b.Property("TopBedrock") + .HasColumnType("double precision") + .HasColumnName("top_bedrock_bho"); - b.HasKey("Id"); + b.Property("TopBedrockTvd") + .HasColumnType("double precision") + .HasColumnName("top_bedrock_tvd_bho"); - b.HasIndex("ChronostratigraphyId"); + b.Property("TotalDepth") + .HasColumnType("double precision") + .HasColumnName("total_depth_bho"); - b.HasIndex("CreatedById"); + b.Property("TotalDepthTvd") + .HasColumnType("double precision") + .HasColumnName("total_depth_tvd_bho"); - b.HasIndex("CuttingsId"); + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_bho"); - b.HasIndex("DrillingMethodId"); + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updated_by_bho"); - b.HasIndex("HrsId"); + b.Property("WorkgroupId") + .HasColumnType("integer") + .HasColumnName("id_wgp_fk"); - b.HasIndex("KindId"); + b.HasKey("Id"); - b.HasIndex("LithologyTopBedrockId"); + b.HasIndex("ChronostratigraphyId"); - b.HasIndex("LithostratigraphyId"); + b.HasIndex("CreatedById"); - b.HasIndex("LockedById"); + b.HasIndex("CuttingsId"); - b.HasIndex("PurposeId"); + b.HasIndex("DrillingMethodId"); - b.HasIndex("QtDepthId"); + b.HasIndex("HrsId"); - b.HasIndex("QtElevationId"); + b.HasIndex("KindId"); - b.HasIndex("QtInclinationDirectionId"); + b.HasIndex("LithologyTopBedrockId"); - b.HasIndex("QtLocationId"); + b.HasIndex("LithostratigraphyId"); - b.HasIndex("QtReferenceElevationId"); + b.HasIndex("LockedById"); - b.HasIndex("QtTopBedrockId"); + b.HasIndex("PurposeId"); - b.HasIndex("QtTopBedrockTvdId"); + b.HasIndex("QtDepthId"); - b.HasIndex("QtTotalDepthTvdId"); + b.HasIndex("QtElevationId"); - b.HasIndex("ReferenceElevationTypeId"); + b.HasIndex("QtInclinationDirectionId"); - b.HasIndex("RestrictionId"); + b.HasIndex("QtLocationId"); - b.HasIndex("StatusId"); + b.HasIndex("QtReferenceElevationId"); - b.HasIndex("UpdatedById"); + b.HasIndex("QtTotalDepthTvdId"); - b.HasIndex("WorkgroupId"); + b.HasIndex("ReferenceElevationTypeId"); - b.ToTable("borehole", "bdms"); - }); + b.HasIndex("RestrictionId"); - modelBuilder.Entity("BDMS.Models.BoreholeCodelist", b => - { - b.Property("BoreholeId") - .HasColumnType("integer") - .HasColumnName("id_bho_fk"); + b.HasIndex("StatusId"); - b.Property("CodelistId") - .HasColumnType("integer") - .HasColumnName("id_cli_fk"); + b.HasIndex("UpdatedById"); - b.Property("SchemaName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("code_cli"); + b.HasIndex("WorkgroupId"); - b.Property("Value") - .IsRequired() - .HasColumnType("text") - .HasColumnName("value_bco"); + b.ToTable("borehole", "bdms"); + }); - b.HasKey("BoreholeId", "CodelistId"); + modelBuilder.Entity("BDMS.Models.BoreholeCodelist", b => + { + b.Property("BoreholeId") + .HasColumnType("integer") + .HasColumnName("id_bho_fk"); - b.HasIndex("CodelistId"); + b.Property("CodelistId") + .HasColumnType("integer") + .HasColumnName("id_cli_fk"); - b.ToTable("borehole_codelist", "bdms"); - }); + b.Property("SchemaName") + .IsRequired() + .HasColumnType("text") + .HasColumnName("code_cli"); - modelBuilder.Entity("BDMS.Models.BoreholeFile", b => - { - b.Property("BoreholeId") - .HasColumnType("integer") - .HasColumnName("id_bho_fk"); + b.Property("Value") + .IsRequired() + .HasColumnType("text") + .HasColumnName("value_bco"); - b.Property("FileId") - .HasColumnType("integer") - .HasColumnName("id_fil_fk"); + b.HasKey("BoreholeId", "CodelistId"); - b.Property("Attached") - .HasColumnType("timestamp with time zone") - .HasColumnName("attached_bfi"); + b.HasIndex("CodelistId"); - b.Property("Created") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_bfi"); + b.ToTable("borehole_codelist", "bdms"); + }); - b.Property("CreatedById") - .HasColumnType("integer") - .HasColumnName("created_by_bfi"); + modelBuilder.Entity("BDMS.Models.BoreholeFile", b => + { + b.Property("BoreholeId") + .HasColumnType("integer") + .HasColumnName("id_bho_fk"); - b.Property("Description") - .HasColumnType("text") - .HasColumnName("description_bfi"); + b.Property("FileId") + .HasColumnType("integer") + .HasColumnName("id_fil_fk"); - b.Property("Public") - .HasColumnType("boolean") - .HasColumnName("public_bfi"); + b.Property("Attached") + .HasColumnType("timestamp with time zone") + .HasColumnName("attached_bfi"); - b.Property("Updated") - .HasColumnType("timestamp with time zone") - .HasColumnName("update_bfi"); + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("created_bfi"); - b.Property("UpdatedById") - .HasColumnType("integer") - .HasColumnName("updater_bfi"); + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("created_by_bfi"); - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("id_usr_fk"); + b.Property("Description") + .HasColumnType("text") + .HasColumnName("description_bfi"); - b.HasKey("BoreholeId", "FileId"); + b.Property("Public") + .HasColumnType("boolean") + .HasColumnName("public_bfi"); - b.HasIndex("CreatedById"); + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("update_bfi"); - b.HasIndex("FileId"); + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updater_bfi"); - b.HasIndex("UpdatedById"); + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("id_usr_fk"); - b.HasIndex("UserId"); + b.HasKey("BoreholeId", "FileId"); - b.ToTable("borehole_files", "bdms"); - }); + b.HasIndex("CreatedById"); - modelBuilder.Entity("BDMS.Models.ChronostratigraphyLayer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id_chr"); + b.HasIndex("FileId"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.HasIndex("UpdatedById"); - b.Property("ChronostratigraphyId") - .HasColumnType("integer") - .HasColumnName("chronostratigraphy_id"); + b.HasIndex("UserId"); - b.Property("Created") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation"); + b.ToTable("borehole_files", "bdms"); + }); - b.Property("CreatedById") - .HasColumnType("integer") - .HasColumnName("creator"); + modelBuilder.Entity("BDMS.Models.ChronostratigraphyLayer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_chr"); - b.Property("FromDepth") - .HasColumnType("double precision") - .HasColumnName("depth_from"); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("IsLast") - .HasColumnType("boolean") - .HasColumnName("is_last"); + b.Property("ChronostratigraphyId") + .HasColumnType("integer") + .HasColumnName("chronostratigraphy_id"); - b.Property("StratigraphyId") - .HasColumnType("integer") - .HasColumnName("id_sty_fk"); + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation"); - b.Property("ToDepth") - .HasColumnType("double precision") - .HasColumnName("depth_to"); + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("creator"); - b.Property("Updated") - .HasColumnType("timestamp with time zone") - .HasColumnName("update"); + b.Property("FromDepth") + .HasColumnType("double precision") + .HasColumnName("depth_from"); - b.Property("UpdatedById") - .HasColumnType("integer") - .HasColumnName("updater"); + b.Property("IsLast") + .HasColumnType("boolean") + .HasColumnName("is_last"); - b.HasKey("Id"); + b.Property("StratigraphyId") + .HasColumnType("integer") + .HasColumnName("id_sty_fk"); - b.HasIndex("ChronostratigraphyId"); + b.Property("ToDepth") + .HasColumnType("double precision") + .HasColumnName("depth_to"); - b.HasIndex("CreatedById"); + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("update"); - b.HasIndex("StratigraphyId"); + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updater"); - b.HasIndex("UpdatedById"); + b.HasKey("Id"); - b.ToTable("chronostratigraphy", "bdms"); - }); + b.HasIndex("ChronostratigraphyId"); - modelBuilder.Entity("BDMS.Models.Codelist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id_cli"); + b.HasIndex("CreatedById"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.HasIndex("StratigraphyId"); - b.Property("Code") - .IsRequired() - .HasColumnType("text") - .HasColumnName("code_cli"); + b.HasIndex("UpdatedById"); - b.Property("Conf") - .HasColumnType("text") - .HasColumnName("conf_cli"); + b.ToTable("chronostratigraphy", "bdms"); + }); - b.Property("De") - .HasColumnType("text") - .HasColumnName("text_cli_de"); + modelBuilder.Entity("BDMS.Models.Codelist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_cli"); - b.Property("DescriptionDe") - .HasColumnType("text") - .HasColumnName("description_cli_de"); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DescriptionEn") - .IsRequired() - .HasColumnType("text") - .HasColumnName("description_cli_en"); + b.Property("Code") + .IsRequired() + .HasColumnType("text") + .HasColumnName("code_cli"); - b.Property("DescriptionFr") - .HasColumnType("text") - .HasColumnName("description_cli_fr"); + b.Property("Conf") + .HasColumnType("text") + .HasColumnName("conf_cli"); - b.Property("DescriptionIt") - .HasColumnType("text") - .HasColumnName("description_cli_it"); + b.Property("De") + .HasColumnType("text") + .HasColumnName("text_cli_de"); - b.Property("DescriptionRo") - .HasColumnType("text") - .HasColumnName("description_cli_ro"); + b.Property("DescriptionDe") + .HasColumnType("text") + .HasColumnName("description_cli_de"); - b.Property("En") - .IsRequired() - .HasColumnType("text") - .HasColumnName("text_cli_en"); + b.Property("DescriptionEn") + .IsRequired() + .HasColumnType("text") + .HasColumnName("description_cli_en"); - b.Property("Fr") - .HasColumnType("text") - .HasColumnName("text_cli_fr"); + b.Property("DescriptionFr") + .HasColumnType("text") + .HasColumnName("description_cli_fr"); - b.Property("Geolcode") - .HasColumnType("integer") - .HasColumnName("geolcode"); + b.Property("DescriptionIt") + .HasColumnType("text") + .HasColumnName("description_cli_it"); - b.Property("IsDefault") - .HasColumnType("boolean") - .HasColumnName("default_cli"); + b.Property("DescriptionRo") + .HasColumnType("text") + .HasColumnName("description_cli_ro"); - b.Property("It") - .HasColumnType("text") - .HasColumnName("text_cli_it"); + b.Property("En") + .IsRequired() + .HasColumnType("text") + .HasColumnName("text_cli_en"); - b.Property("Order") - .HasColumnType("integer") - .HasColumnName("order_cli"); + b.Property("Fr") + .HasColumnType("text") + .HasColumnName("text_cli_fr"); - b.Property("Path") - .HasColumnType("ltree") - .HasColumnName("path_cli"); + b.Property("Geolcode") + .HasColumnType("integer") + .HasColumnName("geolcode"); - b.Property("Ro") - .HasColumnType("text") - .HasColumnName("text_cli_ro"); + b.Property("IsDefault") + .HasColumnType("boolean") + .HasColumnName("default_cli"); - b.Property("Schema") - .HasColumnType("text") - .HasColumnName("schema_cli"); + b.Property("It") + .HasColumnType("text") + .HasColumnName("text_cli_it"); - b.HasKey("Id"); + b.Property("Order") + .HasColumnType("integer") + .HasColumnName("order_cli"); - b.ToTable("codelist", "bdms"); - }); + b.Property("Path") + .HasColumnType("ltree") + .HasColumnName("path_cli"); - modelBuilder.Entity("BDMS.Models.Config", b => - { - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name_cfg"); + b.Property("Ro") + .HasColumnType("text") + .HasColumnName("text_cli_ro"); - b.Property("Value") - .HasColumnType("text") - .HasColumnName("value_cfg"); + b.Property("Schema") + .HasColumnType("text") + .HasColumnName("schema_cli"); - b.HasKey("Name"); + b.HasKey("Id"); - b.ToTable("config", "bdms"); - }); + b.ToTable("codelist", "bdms"); + }); - modelBuilder.Entity("BDMS.Models.Content", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id_cnt"); + modelBuilder.Entity("BDMS.Models.Config", b => + { + b.Property("Name") + .HasColumnType("text") + .HasColumnName("name_cfg"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.Property("Value") + .HasColumnType("text") + .HasColumnName("value_cfg"); - b.Property("Creation") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation_cnt"); + b.HasKey("Name"); - b.Property("Expired") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_cnt"); + b.ToTable("config", "bdms"); + }); - b.Property("IsDraft") - .HasColumnType("boolean") - .HasColumnName("draft_cnt"); + modelBuilder.Entity("BDMS.Models.Content", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_cnt"); - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name_cnt"); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("TextDe") - .HasColumnType("text") - .HasColumnName("text_cnt_de"); + b.Property("Creation") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation_cnt"); - b.Property("TextEn") - .HasColumnType("text") - .HasColumnName("text_cnt_en"); + b.Property("Expired") + .HasColumnType("timestamp with time zone") + .HasColumnName("expired_cnt"); - b.Property("TextFr") - .HasColumnType("text") - .HasColumnName("text_cnt_fr"); + b.Property("IsDraft") + .HasColumnType("boolean") + .HasColumnName("draft_cnt"); - b.Property("TextIt") - .HasColumnType("text") - .HasColumnName("text_cnt_it"); + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name_cnt"); - b.Property("TextRo") - .HasColumnType("text") - .HasColumnName("text_cnt_ro"); + b.Property("TextDe") + .HasColumnType("text") + .HasColumnName("text_cnt_de"); - b.Property("TitelRo") - .HasColumnType("text") - .HasColumnName("title_cnt_ro"); + b.Property("TextEn") + .HasColumnType("text") + .HasColumnName("text_cnt_en"); - b.Property("TitleDe") - .HasColumnType("text") - .HasColumnName("title_cnt_de"); + b.Property("TextFr") + .HasColumnType("text") + .HasColumnName("text_cnt_fr"); - b.Property("TitleEn") - .HasColumnType("text") - .HasColumnName("title_cnt_en"); + b.Property("TextIt") + .HasColumnType("text") + .HasColumnName("text_cnt_it"); - b.Property("TitleFr") - .HasColumnType("text") - .HasColumnName("title_cnt_fr"); + b.Property("TextRo") + .HasColumnType("text") + .HasColumnName("text_cnt_ro"); - b.Property("TitleIt") - .HasColumnType("text") - .HasColumnName("title_cnt_it"); + b.Property("TitelRo") + .HasColumnType("text") + .HasColumnName("title_cnt_ro"); - b.HasKey("Id"); + b.Property("TitleDe") + .HasColumnType("text") + .HasColumnName("title_cnt_de"); - b.ToTable("contents", "bdms"); - }); + b.Property("TitleEn") + .HasColumnType("text") + .HasColumnName("title_cnt_en"); - modelBuilder.Entity("BDMS.Models.FaciesDescription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id_fac"); + b.Property("TitleFr") + .HasColumnType("text") + .HasColumnName("title_cnt_fr"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.Property("TitleIt") + .HasColumnType("text") + .HasColumnName("title_cnt_it"); - b.Property("Created") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation"); + b.HasKey("Id"); - b.Property("CreatedById") - .HasColumnType("integer") - .HasColumnName("creator"); + b.ToTable("contents", "bdms"); + }); - b.Property("Description") - .HasColumnType("text") - .HasColumnName("description"); + modelBuilder.Entity("BDMS.Models.FaciesDescription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_fac"); - b.Property("FromDepth") - .HasColumnType("double precision") - .HasColumnName("depth_from"); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("IsLast") - .HasColumnType("boolean") - .HasColumnName("is_last"); + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation"); - b.Property("QtDescriptionId") - .HasColumnType("integer") - .HasColumnName("qt_description_id"); + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("creator"); - b.Property("StratigraphyId") - .HasColumnType("integer") - .HasColumnName("id_sty_fk"); + b.Property("Description") + .HasColumnType("text") + .HasColumnName("description"); - b.Property("ToDepth") - .HasColumnType("double precision") - .HasColumnName("depth_to"); + b.Property("FromDepth") + .HasColumnType("double precision") + .HasColumnName("depth_from"); - b.Property("Updated") - .HasColumnType("timestamp with time zone") - .HasColumnName("update"); + b.Property("IsLast") + .HasColumnType("boolean") + .HasColumnName("is_last"); - b.Property("UpdatedById") - .HasColumnType("integer") - .HasColumnName("updater"); + b.Property("QtDescriptionId") + .HasColumnType("integer") + .HasColumnName("qt_description_id"); - b.HasKey("Id"); + b.Property("StratigraphyId") + .HasColumnType("integer") + .HasColumnName("id_sty_fk"); - b.HasIndex("CreatedById"); + b.Property("ToDepth") + .HasColumnType("double precision") + .HasColumnName("depth_to"); - b.HasIndex("QtDescriptionId"); + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("update"); - b.HasIndex("StratigraphyId"); + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updater"); - b.HasIndex("UpdatedById"); + b.HasKey("Id"); - b.ToTable("facies_description", "bdms"); - }); + b.HasIndex("CreatedById"); - modelBuilder.Entity("BDMS.Models.Feedback", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id_feb"); + b.HasIndex("QtDescriptionId"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.HasIndex("StratigraphyId"); - b.Property("Created") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_feb"); + b.HasIndex("UpdatedById"); - b.Property("IsFrw") - .HasColumnType("boolean") - .HasColumnName("frw_feb"); + b.ToTable("facies_description", "bdms"); + }); - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message_feb"); + modelBuilder.Entity("BDMS.Models.Feedback", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_feb"); - b.Property("Tag") - .HasColumnType("text") - .HasColumnName("tag_feb"); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("User") - .IsRequired() - .HasColumnType("text") - .HasColumnName("user_feb"); + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("created_feb"); - b.HasKey("Id"); + b.Property("IsFrw") + .HasColumnType("boolean") + .HasColumnName("frw_feb"); - b.ToTable("feedbacks", "bdms"); - }); + b.Property("Message") + .HasColumnType("text") + .HasColumnName("message_feb"); - modelBuilder.Entity("BDMS.Models.File", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id_fil"); + b.Property("Tag") + .HasColumnType("text") + .HasColumnName("tag_feb"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.Property("User") + .IsRequired() + .HasColumnType("text") + .HasColumnName("user_feb"); - b.Property("Created") - .HasColumnType("timestamp with time zone") - .HasColumnName("uploaded_fil"); + b.HasKey("Id"); - b.Property("CreatedById") - .HasColumnType("integer") - .HasColumnName("id_usr_fk"); + b.ToTable("feedbacks", "bdms"); + }); - b.Property("Hash") - .IsRequired() - .HasColumnType("text") - .HasColumnName("hash_fil"); + modelBuilder.Entity("BDMS.Models.File", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_fil"); - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name_fil"); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("NameUuid") - .HasColumnType("text") - .HasColumnName("name_uuid_fil"); + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("uploaded_fil"); - b.Property("Type") - .IsRequired() - .HasColumnType("text") - .HasColumnName("type_fil"); + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("id_usr_fk"); - b.Property("Updated") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_fil"); + b.Property("Hash") + .IsRequired() + .HasColumnType("text") + .HasColumnName("hash_fil"); - b.Property("UpdatedById") - .HasColumnType("integer") - .HasColumnName("updated_by_fil"); + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name_fil"); - b.HasKey("Id"); + b.Property("NameUuid") + .HasColumnType("text") + .HasColumnName("name_uuid_fil"); - b.HasIndex("CreatedById"); + b.Property("Type") + .IsRequired() + .HasColumnType("text") + .HasColumnName("type_fil"); - b.HasIndex("UpdatedById"); + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("updated_fil"); - b.ToTable("files", "bdms"); - }); + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updated_by_fil"); - modelBuilder.Entity("BDMS.Models.HydrotestCodelist", b => - { - b.Property("HydrotestId") - .HasColumnType("integer") - .HasColumnName("id_ht_fk"); + b.HasKey("Id"); - b.Property("CodelistId") - .HasColumnType("integer") - .HasColumnName("id_cli_fk"); + b.HasIndex("CreatedById"); - b.HasKey("HydrotestId", "CodelistId"); + b.HasIndex("UpdatedById"); - b.HasIndex("CodelistId"); + b.ToTable("files", "bdms"); + }); - b.ToTable("hydrotest_codelist", "bdms"); - }); + modelBuilder.Entity("BDMS.Models.HydrotestCodelist", b => + { + b.Property("HydrotestId") + .HasColumnType("integer") + .HasColumnName("id_ht_fk"); - modelBuilder.Entity("BDMS.Models.HydrotestResult", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + b.Property("CodelistId") + .HasColumnType("integer") + .HasColumnName("id_cli_fk"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.HasKey("HydrotestId", "CodelistId"); - b.Property("Created") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation"); + b.HasIndex("CodelistId"); - b.Property("CreatedById") - .HasColumnType("integer") - .HasColumnName("creator"); + b.ToTable("hydrotest_codelist", "bdms"); + }); - b.Property("HydrotestId") - .HasColumnType("integer") - .HasColumnName("hydrotest_id"); + modelBuilder.Entity("BDMS.Models.HydrotestResult", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - b.Property("MaxValue") - .HasColumnType("double precision") - .HasColumnName("max_value"); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("MinValue") - .HasColumnType("double precision") - .HasColumnName("min_value"); + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation"); - b.Property("ParameterId") - .HasColumnType("integer") - .HasColumnName("parameter"); + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("creator"); - b.Property("Updated") - .HasColumnType("timestamp with time zone") - .HasColumnName("update"); + b.Property("HydrotestId") + .HasColumnType("integer") + .HasColumnName("hydrotest_id"); - b.Property("UpdatedById") - .HasColumnType("integer") - .HasColumnName("updater"); + b.Property("MaxValue") + .HasColumnType("double precision") + .HasColumnName("max_value"); - b.Property("Value") - .HasColumnType("double precision") - .HasColumnName("value"); + b.Property("MinValue") + .HasColumnType("double precision") + .HasColumnName("min_value"); - b.HasKey("Id"); + b.Property("ParameterId") + .HasColumnType("integer") + .HasColumnName("parameter"); - b.HasIndex("CreatedById"); + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("update"); - b.HasIndex("HydrotestId"); + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updater"); - b.HasIndex("ParameterId"); + b.Property("Value") + .HasColumnType("double precision") + .HasColumnName("value"); - b.HasIndex("UpdatedById"); + b.HasKey("Id"); - b.ToTable("hydrotest_result", "bdms"); - }); + b.HasIndex("CreatedById"); - modelBuilder.Entity("BDMS.Models.Layer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id_lay"); + b.HasIndex("HydrotestId"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.HasIndex("ParameterId"); - b.Property("AlterationId") - .HasColumnType("integer") - .HasColumnName("alteration_id_cli"); + b.HasIndex("UpdatedById"); - b.Property("Casing") - .HasColumnType("text") - .HasColumnName("casng_id"); + b.ToTable("hydrotest_result", "bdms"); + }); - b.Property("CasingDateFinish") - .HasColumnType("timestamp with time zone") - .HasColumnName("casng_date_finish_lay"); + modelBuilder.Entity("BDMS.Models.Layer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_lay"); - b.Property("CasingDateSpud") - .HasColumnType("timestamp with time zone") - .HasColumnName("casng_date_spud_lay"); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CasingInnerDiameter") - .HasColumnType("double precision") - .HasColumnName("casng_inner_diameter_lay"); + b.Property("AlterationId") + .HasColumnType("integer") + .HasColumnName("alteration_id_cli"); - b.Property("CasingKindId") - .HasColumnType("integer") - .HasColumnName("casng_kind_id_cli"); + b.Property("Casing") + .HasColumnType("text") + .HasColumnName("casng_id"); - b.Property("CasingMaterialId") - .HasColumnType("integer") - .HasColumnName("casng_material_id_cli"); + b.Property("CasingDateFinish") + .HasColumnType("timestamp with time zone") + .HasColumnName("casng_date_finish_lay"); - b.Property("CasingOuterDiameter") - .HasColumnType("double precision") - .HasColumnName("casng_outer_diameter_lay"); + b.Property("CasingDateSpud") + .HasColumnType("timestamp with time zone") + .HasColumnName("casng_date_spud_lay"); - b.Property("CohesionId") - .HasColumnType("integer") - .HasColumnName("cohesion_id_cli"); + b.Property("CasingInnerDiameter") + .HasColumnType("double precision") + .HasColumnName("casng_inner_diameter_lay"); - b.Property("CompactnessId") - .HasColumnType("integer") - .HasColumnName("compactness_id_cli"); + b.Property("CasingKindId") + .HasColumnType("integer") + .HasColumnName("casng_kind_id_cli"); - b.Property("ConsistanceId") - .HasColumnType("integer") - .HasColumnName("consistance_id_cli"); + b.Property("CasingMaterialId") + .HasColumnType("integer") + .HasColumnName("casng_material_id_cli"); - b.Property("Created") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation_lay"); + b.Property("CasingOuterDiameter") + .HasColumnType("double precision") + .HasColumnName("casng_outer_diameter_lay"); - b.Property("CreatedById") - .HasColumnType("integer") - .HasColumnName("creator_lay"); + b.Property("CohesionId") + .HasColumnType("integer") + .HasColumnName("cohesion_id_cli"); - b.Property("FillKindId") - .HasColumnType("integer") - .HasColumnName("fill_kind_id_cli"); + b.Property("CompactnessId") + .HasColumnType("integer") + .HasColumnName("compactness_id_cli"); - b.Property("FillMaterialId") - .HasColumnType("integer") - .HasColumnName("fill_material_id_cli"); + b.Property("ConsistanceId") + .HasColumnType("integer") + .HasColumnName("consistance_id_cli"); - b.Property("FromDepth") - .HasColumnType("double precision") - .HasColumnName("depth_from_lay"); + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation_lay"); - b.Property("GradationId") - .HasColumnType("integer") - .HasColumnName("gradation_id_cli"); + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("creator_lay"); - b.Property("GrainSize1Id") - .HasColumnType("integer") - .HasColumnName("grain_size_1_id_cli"); + b.Property("FillKindId") + .HasColumnType("integer") + .HasColumnName("fill_kind_id_cli"); - b.Property("GrainSize2Id") - .HasColumnType("integer") - .HasColumnName("grain_size_2_id_cli"); + b.Property("FillMaterialId") + .HasColumnType("integer") + .HasColumnName("fill_material_id_cli"); - b.Property("HumidityId") - .HasColumnType("integer") - .HasColumnName("humidity_id_cli"); + b.Property("FromDepth") + .HasColumnType("double precision") + .HasColumnName("depth_from_lay"); - b.Property("Instrument") - .HasColumnType("text") - .HasColumnName("instr_id"); + b.Property("GradationId") + .HasColumnType("integer") + .HasColumnName("gradation_id_cli"); - b.Property("InstrumentCasingId") - .HasColumnType("integer") - .HasColumnName("instr_id_sty_fk"); + b.Property("GrainSize1Id") + .HasColumnType("integer") + .HasColumnName("grain_size_1_id_cli"); - b.Property("InstrumentCasingLayerId") - .HasColumnType("integer") - .HasColumnName("instr_id_lay_fk"); + b.Property("GrainSize2Id") + .HasColumnType("integer") + .HasColumnName("grain_size_2_id_cli"); - b.Property("InstrumentKindId") - .HasColumnType("integer") - .HasColumnName("instr_kind_id_cli"); + b.Property("HumidityId") + .HasColumnType("integer") + .HasColumnName("humidity_id_cli"); - b.Property("InstrumentStatusId") - .HasColumnType("integer") - .HasColumnName("instr_status_id_cli"); + b.Property("Instrument") + .HasColumnType("text") + .HasColumnName("instr_id"); - b.Property("IsLast") - .HasColumnType("boolean") - .HasColumnName("last_lay"); + b.Property("InstrumentCasingId") + .HasColumnType("integer") + .HasColumnName("instr_id_sty_fk"); - b.Property("IsStriae") - .HasColumnType("boolean") - .HasColumnName("striae_lay"); + b.Property("InstrumentCasingLayerId") + .HasColumnType("integer") + .HasColumnName("instr_id_lay_fk"); - b.Property("IsUndefined") - .HasColumnType("boolean") - .HasColumnName("undefined_lay"); + b.Property("InstrumentKindId") + .HasColumnType("integer") + .HasColumnName("instr_kind_id_cli"); - b.Property("LithologyId") - .HasColumnType("integer") - .HasColumnName("lithology_id_cli"); + b.Property("InstrumentStatusId") + .HasColumnType("integer") + .HasColumnName("instr_status_id_cli"); - b.Property("LithologyTopBedrockId") - .HasColumnType("integer") - .HasColumnName("lithology_top_bedrock_id_cli"); + b.Property("IsLast") + .HasColumnType("boolean") + .HasColumnName("last_lay"); - b.Property("LithostratigraphyId") - .HasColumnType("integer") - .HasColumnName("lithostratigraphy_id_cli"); + b.Property("IsStriae") + .HasColumnType("boolean") + .HasColumnName("striae_lay"); - b.Property("Notes") - .HasColumnType("text") - .HasColumnName("notes_lay"); + b.Property("IsUndefined") + .HasColumnType("boolean") + .HasColumnName("undefined_lay"); - b.Property("OriginalLithology") - .HasColumnType("text") - .HasColumnName("original_lithology"); + b.Property("LithologyId") + .HasColumnType("integer") + .HasColumnName("lithology_id_cli"); - b.Property("OriginalUscs") - .HasColumnType("text") - .HasColumnName("uscs_original_lay"); + b.Property("LithologyTopBedrockId") + .HasColumnType("integer") + .HasColumnName("lithology_top_bedrock_id_cli"); - b.Property("PlasticityId") - .HasColumnType("integer") - .HasColumnName("plasticity_id_cli"); + b.Property("LithostratigraphyId") + .HasColumnType("integer") + .HasColumnName("lithostratigraphy_id_cli"); - b.Property("QtDescriptionId") - .HasColumnType("integer") - .HasColumnName("qt_description_id_cli"); + b.Property("Notes") + .HasColumnType("text") + .HasColumnName("notes_lay"); - b.Property("StratigraphyId") - .HasColumnType("integer") - .HasColumnName("id_sty_fk"); + b.Property("OriginalLithology") + .HasColumnType("text") + .HasColumnName("original_lithology"); - b.Property("ToDepth") - .HasColumnType("double precision") - .HasColumnName("depth_to_lay"); + b.Property("OriginalUscs") + .HasColumnType("text") + .HasColumnName("uscs_original_lay"); - b.Property("Updated") - .HasColumnType("timestamp with time zone") - .HasColumnName("update_lay"); + b.Property("PlasticityId") + .HasColumnType("integer") + .HasColumnName("plasticity_id_cli"); - b.Property("UpdatedById") - .HasColumnType("integer") - .HasColumnName("updater_lay"); + b.Property("QtDescriptionId") + .HasColumnType("integer") + .HasColumnName("qt_description_id_cli"); - b.Property("Uscs1Id") - .HasColumnType("integer") - .HasColumnName("uscs_1_id_cli"); + b.Property("StratigraphyId") + .HasColumnType("integer") + .HasColumnName("id_sty_fk"); - b.Property("Uscs2Id") - .HasColumnType("integer") - .HasColumnName("uscs_2_id_cli"); + b.Property("ToDepth") + .HasColumnType("double precision") + .HasColumnName("depth_to_lay"); - b.Property("UscsDeterminationId") - .HasColumnType("integer") - .HasColumnName("uscs_determination_id_cli"); + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("update_lay"); - b.HasKey("Id"); + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updater_lay"); - b.HasIndex("AlterationId"); + b.Property("Uscs1Id") + .HasColumnType("integer") + .HasColumnName("uscs_1_id_cli"); - b.HasIndex("CasingKindId"); + b.Property("Uscs2Id") + .HasColumnType("integer") + .HasColumnName("uscs_2_id_cli"); - b.HasIndex("CasingMaterialId"); + b.Property("UscsDeterminationId") + .HasColumnType("integer") + .HasColumnName("uscs_determination_id_cli"); - b.HasIndex("CohesionId"); + b.HasKey("Id"); - b.HasIndex("CompactnessId"); + b.HasIndex("AlterationId"); - b.HasIndex("ConsistanceId"); + b.HasIndex("CasingKindId"); - b.HasIndex("CreatedById"); + b.HasIndex("CasingMaterialId"); - b.HasIndex("FillKindId"); + b.HasIndex("CohesionId"); - b.HasIndex("FillMaterialId"); + b.HasIndex("CompactnessId"); - b.HasIndex("GradationId"); + b.HasIndex("ConsistanceId"); - b.HasIndex("GrainSize1Id"); + b.HasIndex("CreatedById"); - b.HasIndex("GrainSize2Id"); + b.HasIndex("FillKindId"); - b.HasIndex("HumidityId"); + b.HasIndex("FillMaterialId"); - b.HasIndex("InstrumentCasingId"); + b.HasIndex("GradationId"); - b.HasIndex("InstrumentKindId"); + b.HasIndex("GrainSize1Id"); - b.HasIndex("InstrumentStatusId"); + b.HasIndex("GrainSize2Id"); - b.HasIndex("LithologyId"); + b.HasIndex("HumidityId"); - b.HasIndex("LithologyTopBedrockId"); + b.HasIndex("InstrumentCasingId"); - b.HasIndex("LithostratigraphyId"); + b.HasIndex("InstrumentKindId"); - b.HasIndex("PlasticityId"); + b.HasIndex("InstrumentStatusId"); - b.HasIndex("QtDescriptionId"); + b.HasIndex("LithologyId"); - b.HasIndex("StratigraphyId"); + b.HasIndex("LithologyTopBedrockId"); - b.HasIndex("UpdatedById"); + b.HasIndex("LithostratigraphyId"); - b.HasIndex("Uscs1Id"); + b.HasIndex("PlasticityId"); - b.HasIndex("Uscs2Id"); + b.HasIndex("QtDescriptionId"); - b.HasIndex("UscsDeterminationId"); + b.HasIndex("StratigraphyId"); - b.ToTable("layer", "bdms"); - }); + b.HasIndex("UpdatedById"); - modelBuilder.Entity("BDMS.Models.LayerCodelist", b => - { - b.Property("LayerId") - .HasColumnType("integer") - .HasColumnName("id_lay_fk"); + b.HasIndex("Uscs1Id"); - b.Property("CodelistId") - .HasColumnType("integer") - .HasColumnName("id_cli_fk"); + b.HasIndex("Uscs2Id"); - b.Property("SchemaName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("code_cli"); + b.HasIndex("UscsDeterminationId"); - b.HasKey("LayerId", "CodelistId"); + b.ToTable("layer", "bdms"); + }); - b.HasIndex("CodelistId"); + modelBuilder.Entity("BDMS.Models.LayerCodelist", b => + { + b.Property("LayerId") + .HasColumnType("integer") + .HasColumnName("id_lay_fk"); - b.ToTable("layer_codelist", "bdms"); - }); + b.Property("CodelistId") + .HasColumnType("integer") + .HasColumnName("id_cli_fk"); - modelBuilder.Entity("BDMS.Models.LithologicalDescription", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id_ldp"); + b.Property("SchemaName") + .IsRequired() + .HasColumnType("text") + .HasColumnName("code_cli"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.HasKey("LayerId", "CodelistId"); - b.Property("Created") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation"); + b.HasIndex("CodelistId"); - b.Property("CreatedById") - .HasColumnType("integer") - .HasColumnName("creator"); + b.ToTable("layer_codelist", "bdms"); + }); - b.Property("Description") - .HasColumnType("text") - .HasColumnName("description"); + modelBuilder.Entity("BDMS.Models.LithologicalDescription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_ldp"); - b.Property("FromDepth") - .HasColumnType("double precision") - .HasColumnName("depth_from"); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("IsLast") - .HasColumnType("boolean") - .HasColumnName("is_last"); + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation"); - b.Property("QtDescriptionId") - .HasColumnType("integer") - .HasColumnName("qt_description_id"); + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("creator"); - b.Property("StratigraphyId") - .HasColumnType("integer") - .HasColumnName("id_sty_fk"); + b.Property("Description") + .HasColumnType("text") + .HasColumnName("description"); - b.Property("ToDepth") - .HasColumnType("double precision") - .HasColumnName("depth_to"); + b.Property("FromDepth") + .HasColumnType("double precision") + .HasColumnName("depth_from"); - b.Property("Updated") - .HasColumnType("timestamp with time zone") - .HasColumnName("update"); + b.Property("IsLast") + .HasColumnType("boolean") + .HasColumnName("is_last"); - b.Property("UpdatedById") - .HasColumnType("integer") - .HasColumnName("updater"); + b.Property("QtDescriptionId") + .HasColumnType("integer") + .HasColumnName("qt_description_id"); - b.HasKey("Id"); + b.Property("StratigraphyId") + .HasColumnType("integer") + .HasColumnName("id_sty_fk"); - b.HasIndex("CreatedById"); + b.Property("ToDepth") + .HasColumnType("double precision") + .HasColumnName("depth_to"); - b.HasIndex("QtDescriptionId"); + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("update"); - b.HasIndex("StratigraphyId"); + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updater"); - b.HasIndex("UpdatedById"); + b.HasKey("Id"); - b.ToTable("lithological_description", "bdms"); - }); + b.HasIndex("CreatedById"); - modelBuilder.Entity("BDMS.Models.LithostratigraphyLayer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + b.HasIndex("QtDescriptionId"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.HasIndex("StratigraphyId"); - b.Property("Created") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation"); + b.HasIndex("UpdatedById"); - b.Property("CreatedById") - .HasColumnType("integer") - .HasColumnName("creator"); + b.ToTable("lithological_description", "bdms"); + }); - b.Property("FromDepth") - .HasColumnType("double precision") - .HasColumnName("depth_from"); + modelBuilder.Entity("BDMS.Models.LithostratigraphyLayer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - b.Property("IsLast") - .HasColumnType("boolean") - .HasColumnName("is_last"); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("LithostratigraphyId") - .HasColumnType("integer") - .HasColumnName("lithostratigraphy_id"); + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation"); - b.Property("StratigraphyId") - .HasColumnType("integer") - .HasColumnName("stratigraphy_id"); + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("creator"); - b.Property("ToDepth") - .HasColumnType("double precision") - .HasColumnName("depth_to"); + b.Property("FromDepth") + .HasColumnType("double precision") + .HasColumnName("depth_from"); - b.Property("Updated") - .HasColumnType("timestamp with time zone") - .HasColumnName("update"); + b.Property("IsLast") + .HasColumnType("boolean") + .HasColumnName("is_last"); - b.Property("UpdatedById") - .HasColumnType("integer") - .HasColumnName("updater"); + b.Property("LithostratigraphyId") + .HasColumnType("integer") + .HasColumnName("lithostratigraphy_id"); - b.HasKey("Id"); + b.Property("StratigraphyId") + .HasColumnType("integer") + .HasColumnName("stratigraphy_id"); - b.HasIndex("CreatedById"); + b.Property("ToDepth") + .HasColumnType("double precision") + .HasColumnName("depth_to"); - b.HasIndex("LithostratigraphyId"); + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("update"); - b.HasIndex("StratigraphyId"); + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updater"); - b.HasIndex("UpdatedById"); + b.HasKey("Id"); - b.ToTable("lithostratigraphy", "bdms"); - }); + b.HasIndex("CreatedById"); - modelBuilder.Entity("BDMS.Models.Observation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + b.HasIndex("LithostratigraphyId"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.HasIndex("StratigraphyId"); - b.Property("BoreholeId") - .HasColumnType("integer") - .HasColumnName("borehole_id"); + b.HasIndex("UpdatedById"); - b.Property("CasingId") - .HasColumnType("integer") - .HasColumnName("casing"); + b.ToTable("lithostratigraphy", "bdms"); + }); - b.Property("Comment") - .HasColumnType("text") - .HasColumnName("comment"); + modelBuilder.Entity("BDMS.Models.Observation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - b.Property("CompletionFinished") - .HasColumnType("boolean") - .HasColumnName("completion_finished"); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Created") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation"); + b.Property("BoreholeId") + .HasColumnType("integer") + .HasColumnName("borehole_id"); - b.Property("CreatedById") - .HasColumnType("integer") - .HasColumnName("creator"); + b.Property("CasingId") + .HasColumnType("integer") + .HasColumnName("casing"); - b.Property("Duration") - .HasColumnType("double precision") - .HasColumnName("duration"); + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment"); - b.Property("EndTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("end_time"); + b.Property("CompletionFinished") + .HasColumnType("boolean") + .HasColumnName("completion_finished"); - b.Property("FromDepthM") - .HasColumnType("double precision") - .HasColumnName("from_depth_m"); + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation"); - b.Property("FromDepthMasl") - .HasColumnType("double precision") - .HasColumnName("from_depth_masl"); + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("creator"); - b.Property("ReliabilityId") - .HasColumnType("integer") - .HasColumnName("reliability"); + b.Property("Duration") + .HasColumnType("double precision") + .HasColumnName("duration"); - b.Property("StartTime") - .HasColumnType("timestamp with time zone") - .HasColumnName("start_time"); + b.Property("EndTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("end_time"); - b.Property("ToDepthM") - .HasColumnType("double precision") - .HasColumnName("to_depth_m"); + b.Property("FromDepthM") + .HasColumnType("double precision") + .HasColumnName("from_depth_m"); - b.Property("ToDepthMasl") - .HasColumnType("double precision") - .HasColumnName("to_depth_masl"); + b.Property("FromDepthMasl") + .HasColumnType("double precision") + .HasColumnName("from_depth_masl"); - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("observation_type"); + b.Property("ReliabilityId") + .HasColumnType("integer") + .HasColumnName("reliability"); - b.Property("Updated") - .HasColumnType("timestamp with time zone") - .HasColumnName("update"); + b.Property("StartTime") + .HasColumnType("timestamp with time zone") + .HasColumnName("start_time"); - b.Property("UpdatedById") - .HasColumnType("integer") - .HasColumnName("updater"); + b.Property("ToDepthM") + .HasColumnType("double precision") + .HasColumnName("to_depth_m"); - b.HasKey("Id"); + b.Property("ToDepthMasl") + .HasColumnType("double precision") + .HasColumnName("to_depth_masl"); - b.HasIndex("BoreholeId"); + b.Property("Type") + .HasColumnType("integer") + .HasColumnName("observation_type"); - b.HasIndex("CasingId"); + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("update"); - b.HasIndex("CreatedById"); + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updater"); - b.HasIndex("ReliabilityId"); + b.HasKey("Id"); - b.HasIndex("UpdatedById"); + b.HasIndex("BoreholeId"); - b.ToTable("observation", "bdms"); + b.HasIndex("CasingId"); - b.UseTptMappingStrategy(); - }); + b.HasIndex("CreatedById"); - modelBuilder.Entity("BDMS.Models.Stratigraphy", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id_sty"); + b.HasIndex("ReliabilityId"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.HasIndex("UpdatedById"); - b.Property("BoreholeId") - .HasColumnType("integer") - .HasColumnName("id_bho_fk"); + b.ToTable("observation", "bdms"); - b.Property("Casing") - .HasColumnType("text") - .HasColumnName("casng_id"); + b.UseTptMappingStrategy(); + }); - b.Property("CasingDate") - .HasColumnType("timestamp with time zone") - .HasColumnName("casng_date_abd_sty"); + modelBuilder.Entity("BDMS.Models.Stratigraphy", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_sty"); - b.Property("Created") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation_sty"); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CreatedById") - .HasColumnType("integer") - .HasColumnName("author_sty"); + b.Property("BoreholeId") + .HasColumnType("integer") + .HasColumnName("id_bho_fk"); - b.Property("Date") - .HasColumnType("timestamp with time zone") - .HasColumnName("date_sty"); + b.Property("Casing") + .HasColumnType("text") + .HasColumnName("casng_id"); - b.Property("FillCasingId") - .HasColumnType("integer") - .HasColumnName("fill_casng_id_sty_fk"); + b.Property("CasingDate") + .HasColumnType("timestamp with time zone") + .HasColumnName("casng_date_abd_sty"); - b.Property("IsPrimary") - .HasColumnType("boolean") - .HasColumnName("primary_sty"); + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation_sty"); - b.Property("KindId") - .HasColumnType("integer") - .HasColumnName("kind_id_cli"); + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("author_sty"); - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name_sty"); + b.Property("Date") + .HasColumnType("timestamp with time zone") + .HasColumnName("date_sty"); - b.Property("Notes") - .HasColumnType("text") - .HasColumnName("notes_sty"); + b.Property("FillCasingId") + .HasColumnType("integer") + .HasColumnName("fill_casng_id_sty_fk"); - b.Property("Updated") - .HasColumnType("timestamp with time zone") - .HasColumnName("update_sty"); + b.Property("IsPrimary") + .HasColumnType("boolean") + .HasColumnName("primary_sty"); - b.Property("UpdatedById") - .HasColumnType("integer") - .HasColumnName("updater_sty"); + b.Property("KindId") + .HasColumnType("integer") + .HasColumnName("kind_id_cli"); - b.HasKey("Id"); + b.Property("Name") + .HasColumnType("text") + .HasColumnName("name_sty"); - b.HasIndex("BoreholeId"); + b.Property("Notes") + .HasColumnType("text") + .HasColumnName("notes_sty"); - b.HasIndex("CreatedById"); + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("update_sty"); - b.HasIndex("FillCasingId"); + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updater_sty"); - b.HasIndex("KindId"); + b.HasKey("Id"); - b.HasIndex("UpdatedById"); + b.HasIndex("BoreholeId"); - b.ToTable("stratigraphy", "bdms"); - }); + b.HasIndex("CreatedById"); - modelBuilder.Entity("BDMS.Models.Term", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id_tes"); + b.HasIndex("FillCasingId"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.HasIndex("KindId"); - b.Property("Creation") - .HasColumnType("timestamp with time zone") - .HasColumnName("creation_tes"); + b.HasIndex("UpdatedById"); - b.Property("Expiration") - .HasColumnType("timestamp with time zone") - .HasColumnName("expired_tes"); + b.ToTable("stratigraphy", "bdms"); + }); - b.Property("IsDraft") - .HasColumnType("boolean") - .HasColumnName("draft_tes"); + modelBuilder.Entity("BDMS.Models.Term", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_tes"); - b.Property("TextDe") - .HasColumnType("text") - .HasColumnName("text_tes_de"); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("TextEn") - .IsRequired() - .HasColumnType("text") - .HasColumnName("text_tes_en"); + b.Property("Creation") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation_tes"); - b.Property("TextFr") - .HasColumnType("text") - .HasColumnName("text_tes_fr"); + b.Property("Expiration") + .HasColumnType("timestamp with time zone") + .HasColumnName("expired_tes"); - b.Property("TextIt") - .HasColumnType("text") - .HasColumnName("text_tes_it"); + b.Property("IsDraft") + .HasColumnType("boolean") + .HasColumnName("draft_tes"); - b.Property("TextRo") - .HasColumnType("text") - .HasColumnName("text_tes_ro"); + b.Property("TextDe") + .HasColumnType("text") + .HasColumnName("text_tes_de"); - b.HasKey("Id"); + b.Property("TextEn") + .IsRequired() + .HasColumnType("text") + .HasColumnName("text_tes_en"); - b.ToTable("terms", "bdms"); - }); + b.Property("TextFr") + .HasColumnType("text") + .HasColumnName("text_tes_fr"); - modelBuilder.Entity("BDMS.Models.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id_usr"); + b.Property("TextIt") + .HasColumnType("text") + .HasColumnName("text_tes_it"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.Property("TextRo") + .HasColumnType("text") + .HasColumnName("text_tes_ro"); - b.Property("DisabledAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("disabled_usr"); + b.HasKey("Id"); - b.Property("FirstName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("firstname"); + b.ToTable("terms", "bdms"); + }); - b.Property("IsAdmin") - .HasColumnType("boolean") - .HasColumnName("admin_usr"); + modelBuilder.Entity("BDMS.Models.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_usr"); - b.Property("IsViewer") - .HasColumnType("boolean") - .HasColumnName("viewer_usr"); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("LastName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("lastname"); + b.Property("DisabledAt") + .HasColumnType("timestamp with time zone") + .HasColumnName("disabled_usr"); - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("username"); + b.Property("FirstName") + .IsRequired() + .HasColumnType("text") + .HasColumnName("firstname"); - b.HasKey("Id"); + b.Property("IsAdmin") + .HasColumnType("boolean") + .HasColumnName("admin_usr"); - b.ToTable("users", "bdms"); - }); + b.Property("IsViewer") + .HasColumnType("boolean") + .HasColumnName("viewer_usr"); - modelBuilder.Entity("BDMS.Models.UserEvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id_evs"); + b.Property("LastName") + .IsRequired() + .HasColumnType("text") + .HasColumnName("lastname"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("username"); - b.Property("Created") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_evs"); + b.HasKey("Id"); - b.Property("Payload") - .HasColumnType("jsonb") - .HasColumnName("payload_evs"); + b.ToTable("users", "bdms"); + }); - b.Property("Topic") - .IsRequired() - .HasColumnType("text") - .HasColumnName("topic_evs"); + modelBuilder.Entity("BDMS.Models.UserEvent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_evs"); - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("id_usr_fk"); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.HasKey("Id"); + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("created_evs"); - b.HasIndex("UserId"); + b.Property("Payload") + .HasColumnType("jsonb") + .HasColumnName("payload_evs"); - b.ToTable("events", "bdms"); - }); + b.Property("Topic") + .IsRequired() + .HasColumnType("text") + .HasColumnName("topic_evs"); - modelBuilder.Entity("BDMS.Models.UserWorkgroupRole", b => - { - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("id_usr_fk"); + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("id_usr_fk"); - b.Property("WorkgroupId") - .HasColumnType("integer") - .HasColumnName("id_wgp_fk"); + b.HasKey("Id"); - b.Property("Role") - .HasColumnType("int") - .HasColumnName("id_rol_fk"); + b.HasIndex("UserId"); - b.HasKey("UserId", "WorkgroupId", "Role"); + b.ToTable("events", "bdms"); + }); - b.ToTable("users_roles", "bdms"); - }); + modelBuilder.Entity("BDMS.Models.UserWorkgroupRole", b => + { + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("id_usr_fk"); - modelBuilder.Entity("BDMS.Models.Workflow", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id_wkf"); + b.Property("WorkgroupId") + .HasColumnType("integer") + .HasColumnName("id_wgp_fk"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.Property("Role") + .HasColumnType("int") + .HasColumnName("id_rol_fk"); - b.Property("BoreholeId") - .HasColumnType("integer") - .HasColumnName("id_bho_fk"); + b.HasKey("UserId", "WorkgroupId", "Role"); - b.Property("Finished") - .HasColumnType("timestamp with time zone") - .HasColumnName("finished_wkf"); + b.ToTable("users_roles", "bdms"); + }); - b.Property("Notes") - .HasColumnType("text") - .HasColumnName("notes_wkf"); + modelBuilder.Entity("BDMS.Models.Workflow", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_wkf"); - b.Property("Role") - .HasColumnType("integer") - .HasColumnName("id_rol_fk"); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Started") - .HasColumnType("timestamp with time zone") - .HasColumnName("started_wkf"); + b.Property("BoreholeId") + .HasColumnType("integer") + .HasColumnName("id_bho_fk"); - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("id_usr_fk"); + b.Property("Finished") + .HasColumnType("timestamp with time zone") + .HasColumnName("finished_wkf"); - b.HasKey("Id"); + b.Property("Notes") + .HasColumnType("text") + .HasColumnName("notes_wkf"); - b.HasIndex("BoreholeId"); + b.Property("Role") + .HasColumnType("integer") + .HasColumnName("id_rol_fk"); - b.HasIndex("UserId"); + b.Property("Started") + .HasColumnType("timestamp with time zone") + .HasColumnName("started_wkf"); - b.ToTable("workflow", "bdms"); - }); + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("id_usr_fk"); - modelBuilder.Entity("BDMS.Models.Workgroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id_wgp"); + b.HasKey("Id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.HasIndex("BoreholeId"); - b.Property("Created") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_wgp"); + b.HasIndex("UserId"); - b.Property("Disabled") - .HasColumnType("timestamp with time zone") - .HasColumnName("disabled_wgp"); + b.ToTable("workflow", "bdms"); + }); - b.Property("IsSupplier") - .HasColumnType("boolean") - .HasColumnName("supplier_wgp"); + modelBuilder.Entity("BDMS.Models.Workgroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_wgp"); - b.Property("Name") - .IsRequired() - .HasColumnType("text") - .HasColumnName("name_wgp"); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Settings") - .HasColumnType("json") - .HasColumnName("settings_wgp"); + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("created_wgp"); - b.HasKey("Id"); + b.Property("Disabled") + .HasColumnType("timestamp with time zone") + .HasColumnName("disabled_wgp"); - b.ToTable("workgroups", "bdms"); - }); + b.Property("IsSupplier") + .HasColumnType("boolean") + .HasColumnName("supplier_wgp"); - modelBuilder.Entity("BDMS.Models.FieldMeasurement", b => - { - b.HasBaseType("BDMS.Models.Observation"); + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name_wgp"); - b.Property("ParameterId") - .HasColumnType("integer") - .HasColumnName("parameter"); + b.Property("Settings") + .HasColumnType("json") + .HasColumnName("settings_wgp"); - b.Property("SampleTypeId") - .HasColumnType("integer") - .HasColumnName("sample_type"); + b.HasKey("Id"); - b.Property("Value") - .HasColumnType("double precision") - .HasColumnName("value"); + b.ToTable("workgroups", "bdms"); + }); - b.HasIndex("ParameterId"); + modelBuilder.Entity("BDMS.Models.FieldMeasurement", b => + { + b.HasBaseType("BDMS.Models.Observation"); - b.HasIndex("SampleTypeId"); + b.Property("ParameterId") + .HasColumnType("integer") + .HasColumnName("parameter"); - b.ToTable("field_measurement", "bdms"); - }); + b.Property("SampleTypeId") + .HasColumnType("integer") + .HasColumnName("sample_type"); - modelBuilder.Entity("BDMS.Models.GroundwaterLevelMeasurement", b => - { - b.HasBaseType("BDMS.Models.Observation"); + b.Property("Value") + .HasColumnType("double precision") + .HasColumnName("value"); - b.Property("KindId") - .HasColumnType("integer") - .HasColumnName("kind"); + b.HasIndex("ParameterId"); - b.Property("LevelM") - .HasColumnType("double precision") - .HasColumnName("level_m"); + b.HasIndex("SampleTypeId"); - b.Property("LevelMasl") - .HasColumnType("double precision") - .HasColumnName("level_masl"); + b.ToTable("field_measurement", "bdms"); + }); - b.HasIndex("KindId"); + modelBuilder.Entity("BDMS.Models.GroundwaterLevelMeasurement", b => + { + b.HasBaseType("BDMS.Models.Observation"); - b.ToTable("groundwater_level_measurement", "bdms"); - }); + b.Property("KindId") + .HasColumnType("integer") + .HasColumnName("kind"); - modelBuilder.Entity("BDMS.Models.Hydrotest", b => - { - b.HasBaseType("BDMS.Models.Observation"); + b.Property("LevelM") + .HasColumnType("double precision") + .HasColumnName("level_m"); - b.ToTable("hydrotest", "bdms"); - }); + b.Property("LevelMasl") + .HasColumnType("double precision") + .HasColumnName("level_masl"); - modelBuilder.Entity("BDMS.Models.WaterIngress", b => - { - b.HasBaseType("BDMS.Models.Observation"); + b.HasIndex("KindId"); - b.Property("ConditionsId") - .HasColumnType("integer") - .HasColumnName("conditions"); + b.ToTable("groundwater_level_measurement", "bdms"); + }); - b.Property("QuantityId") - .HasColumnType("integer") - .HasColumnName("quantity"); + modelBuilder.Entity("BDMS.Models.Hydrotest", b => + { + b.HasBaseType("BDMS.Models.Observation"); - b.HasIndex("ConditionsId"); + b.ToTable("hydrotest", "bdms"); + }); - b.HasIndex("QuantityId"); + modelBuilder.Entity("BDMS.Models.WaterIngress", b => + { + b.HasBaseType("BDMS.Models.Observation"); - b.ToTable("water_ingress", "bdms"); - }); + b.Property("ConditionsId") + .HasColumnType("integer") + .HasColumnName("conditions"); - modelBuilder.Entity("BDMS.Models.Borehole", b => - { - b.HasOne("BDMS.Models.Codelist", "Chronostratigraphy") - .WithMany() - .HasForeignKey("ChronostratigraphyId"); + b.Property("QuantityId") + .HasColumnType("integer") + .HasColumnName("quantity"); - b.HasOne("BDMS.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); + b.HasIndex("ConditionsId"); - b.HasOne("BDMS.Models.Codelist", "Cuttings") - .WithMany() - .HasForeignKey("CuttingsId"); + b.HasIndex("QuantityId"); - b.HasOne("BDMS.Models.Codelist", "DrillingMethod") - .WithMany() - .HasForeignKey("DrillingMethodId"); + b.ToTable("water_ingress", "bdms"); + }); - b.HasOne("BDMS.Models.Codelist", "Hrs") - .WithMany() - .HasForeignKey("HrsId"); + modelBuilder.Entity("BDMS.Models.Borehole", b => + { + b.HasOne("BDMS.Models.Codelist", "Chronostratigraphy") + .WithMany() + .HasForeignKey("ChronostratigraphyId"); - b.HasOne("BDMS.Models.Codelist", "Kind") - .WithMany() - .HasForeignKey("KindId"); + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); - b.HasOne("BDMS.Models.Codelist", "LithologyTopBedrock") - .WithMany() - .HasForeignKey("LithologyTopBedrockId"); + b.HasOne("BDMS.Models.Codelist", "Cuttings") + .WithMany() + .HasForeignKey("CuttingsId"); - b.HasOne("BDMS.Models.Codelist", "Lithostratigraphy") - .WithMany() - .HasForeignKey("LithostratigraphyId"); + b.HasOne("BDMS.Models.Codelist", "DrillingMethod") + .WithMany() + .HasForeignKey("DrillingMethodId"); - b.HasOne("BDMS.Models.User", "LockedBy") - .WithMany() - .HasForeignKey("LockedById"); + b.HasOne("BDMS.Models.Codelist", "Hrs") + .WithMany() + .HasForeignKey("HrsId"); - b.HasOne("BDMS.Models.Codelist", "Purpose") - .WithMany() - .HasForeignKey("PurposeId"); + b.HasOne("BDMS.Models.Codelist", "Kind") + .WithMany() + .HasForeignKey("KindId"); - b.HasOne("BDMS.Models.Codelist", "QtDepth") - .WithMany() - .HasForeignKey("QtDepthId"); + b.HasOne("BDMS.Models.Codelist", "LithologyTopBedrock") + .WithMany() + .HasForeignKey("LithologyTopBedrockId"); - b.HasOne("BDMS.Models.Codelist", "QtElevation") - .WithMany() - .HasForeignKey("QtElevationId"); + b.HasOne("BDMS.Models.Codelist", "Lithostratigraphy") + .WithMany() + .HasForeignKey("LithostratigraphyId"); - b.HasOne("BDMS.Models.Codelist", "QtInclinationDirection") - .WithMany() - .HasForeignKey("QtInclinationDirectionId"); + b.HasOne("BDMS.Models.User", "LockedBy") + .WithMany() + .HasForeignKey("LockedById"); - b.HasOne("BDMS.Models.Codelist", "QtLocation") - .WithMany() - .HasForeignKey("QtLocationId"); + b.HasOne("BDMS.Models.Codelist", "Purpose") + .WithMany() + .HasForeignKey("PurposeId"); - b.HasOne("BDMS.Models.Codelist", "QtReferenceElevation") - .WithMany() - .HasForeignKey("QtReferenceElevationId"); + b.HasOne("BDMS.Models.Codelist", "QtDepth") + .WithMany() + .HasForeignKey("QtDepthId"); - b.HasOne("BDMS.Models.Codelist", "QtTopBedrock") - .WithMany() - .HasForeignKey("QtTopBedrockId"); + b.HasOne("BDMS.Models.Codelist", "QtElevation") + .WithMany() + .HasForeignKey("QtElevationId"); - b.HasOne("BDMS.Models.Codelist", "QtTopBedrockTvd") - .WithMany() - .HasForeignKey("QtTopBedrockTvdId"); + b.HasOne("BDMS.Models.Codelist", "QtInclinationDirection") + .WithMany() + .HasForeignKey("QtInclinationDirectionId"); - b.HasOne("BDMS.Models.Codelist", "QtTotalDepthTvd") - .WithMany() - .HasForeignKey("QtTotalDepthTvdId"); + b.HasOne("BDMS.Models.Codelist", "QtLocation") + .WithMany() + .HasForeignKey("QtLocationId"); - b.HasOne("BDMS.Models.Codelist", "ReferenceElevationType") - .WithMany() - .HasForeignKey("ReferenceElevationTypeId"); + b.HasOne("BDMS.Models.Codelist", "QtReferenceElevation") + .WithMany() + .HasForeignKey("QtReferenceElevationId"); - b.HasOne("BDMS.Models.Codelist", "Restriction") - .WithMany() - .HasForeignKey("RestrictionId"); + b.HasOne("BDMS.Models.Codelist", "QtTotalDepthTvd") + .WithMany() + .HasForeignKey("QtTotalDepthTvdId"); - b.HasOne("BDMS.Models.Codelist", "Status") - .WithMany() - .HasForeignKey("StatusId"); + b.HasOne("BDMS.Models.Codelist", "ReferenceElevationType") + .WithMany() + .HasForeignKey("ReferenceElevationTypeId"); - b.HasOne("BDMS.Models.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); + b.HasOne("BDMS.Models.Codelist", "Restriction") + .WithMany() + .HasForeignKey("RestrictionId"); - b.HasOne("BDMS.Models.Workgroup", "Workgroup") - .WithMany("Boreholes") - .HasForeignKey("WorkgroupId"); + b.HasOne("BDMS.Models.Codelist", "Status") + .WithMany() + .HasForeignKey("StatusId"); - b.Navigation("Chronostratigraphy"); + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); - b.Navigation("CreatedBy"); + b.HasOne("BDMS.Models.Workgroup", "Workgroup") + .WithMany("Boreholes") + .HasForeignKey("WorkgroupId"); - b.Navigation("Cuttings"); + b.Navigation("Chronostratigraphy"); - b.Navigation("DrillingMethod"); + b.Navigation("CreatedBy"); - b.Navigation("Hrs"); + b.Navigation("Cuttings"); - b.Navigation("Kind"); + b.Navigation("DrillingMethod"); - b.Navigation("LithologyTopBedrock"); + b.Navigation("Hrs"); - b.Navigation("Lithostratigraphy"); + b.Navigation("Kind"); - b.Navigation("LockedBy"); + b.Navigation("LithologyTopBedrock"); - b.Navigation("Purpose"); + b.Navigation("Lithostratigraphy"); - b.Navigation("QtDepth"); + b.Navigation("LockedBy"); - b.Navigation("QtElevation"); + b.Navigation("Purpose"); - b.Navigation("QtInclinationDirection"); + b.Navigation("QtDepth"); - b.Navigation("QtLocation"); + b.Navigation("QtElevation"); - b.Navigation("QtReferenceElevation"); + b.Navigation("QtInclinationDirection"); - b.Navigation("QtTopBedrock"); + b.Navigation("QtLocation"); - b.Navigation("QtTopBedrockTvd"); + b.Navigation("QtReferenceElevation"); - b.Navigation("QtTotalDepthTvd"); + b.Navigation("QtTotalDepthTvd"); - b.Navigation("ReferenceElevationType"); + b.Navigation("ReferenceElevationType"); - b.Navigation("Restriction"); + b.Navigation("Restriction"); - b.Navigation("Status"); + b.Navigation("Status"); - b.Navigation("UpdatedBy"); + b.Navigation("UpdatedBy"); - b.Navigation("Workgroup"); - }); + b.Navigation("Workgroup"); + }); - modelBuilder.Entity("BDMS.Models.BoreholeCodelist", b => - { - b.HasOne("BDMS.Models.Borehole", "Borehole") - .WithMany("BoreholeCodelists") - .HasForeignKey("BoreholeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + modelBuilder.Entity("BDMS.Models.BoreholeCodelist", b => + { + b.HasOne("BDMS.Models.Borehole", "Borehole") + .WithMany("BoreholeCodelists") + .HasForeignKey("BoreholeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("BDMS.Models.Codelist", "Codelist") - .WithMany("BoreholeCodelists") - .HasForeignKey("CodelistId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("BDMS.Models.Codelist", "Codelist") + .WithMany("BoreholeCodelists") + .HasForeignKey("CodelistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Borehole"); + b.Navigation("Borehole"); - b.Navigation("Codelist"); - }); + b.Navigation("Codelist"); + }); - modelBuilder.Entity("BDMS.Models.BoreholeFile", b => - { - b.HasOne("BDMS.Models.Borehole", "Borehole") - .WithMany("BoreholeFiles") - .HasForeignKey("BoreholeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + modelBuilder.Entity("BDMS.Models.BoreholeFile", b => + { + b.HasOne("BDMS.Models.Borehole", "Borehole") + .WithMany("BoreholeFiles") + .HasForeignKey("BoreholeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("BDMS.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); - b.HasOne("BDMS.Models.File", "File") - .WithMany("BoreholeFiles") - .HasForeignKey("FileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("BDMS.Models.File", "File") + .WithMany("BoreholeFiles") + .HasForeignKey("FileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("BDMS.Models.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); - b.HasOne("BDMS.Models.User", "User") - .WithMany() - .HasForeignKey("UserId"); + b.HasOne("BDMS.Models.User", "User") + .WithMany() + .HasForeignKey("UserId"); - b.Navigation("Borehole"); + b.Navigation("Borehole"); - b.Navigation("CreatedBy"); + b.Navigation("CreatedBy"); - b.Navigation("File"); + b.Navigation("File"); - b.Navigation("UpdatedBy"); + b.Navigation("UpdatedBy"); - b.Navigation("User"); - }); + b.Navigation("User"); + }); - modelBuilder.Entity("BDMS.Models.ChronostratigraphyLayer", b => - { - b.HasOne("BDMS.Models.Codelist", "Chronostratigraphy") - .WithMany() - .HasForeignKey("ChronostratigraphyId"); + modelBuilder.Entity("BDMS.Models.ChronostratigraphyLayer", b => + { + b.HasOne("BDMS.Models.Codelist", "Chronostratigraphy") + .WithMany() + .HasForeignKey("ChronostratigraphyId"); - b.HasOne("BDMS.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); - b.HasOne("BDMS.Models.Stratigraphy", "Stratigraphy") - .WithMany("ChronostratigraphyLayers") - .HasForeignKey("StratigraphyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("BDMS.Models.Stratigraphy", "Stratigraphy") + .WithMany("ChronostratigraphyLayers") + .HasForeignKey("StratigraphyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("BDMS.Models.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); - b.Navigation("Chronostratigraphy"); + b.Navigation("Chronostratigraphy"); - b.Navigation("CreatedBy"); + b.Navigation("CreatedBy"); - b.Navigation("Stratigraphy"); + b.Navigation("Stratigraphy"); - b.Navigation("UpdatedBy"); - }); + b.Navigation("UpdatedBy"); + }); - modelBuilder.Entity("BDMS.Models.FaciesDescription", b => - { - b.HasOne("BDMS.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); + modelBuilder.Entity("BDMS.Models.FaciesDescription", b => + { + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); - b.HasOne("BDMS.Models.Codelist", "QtDescription") - .WithMany() - .HasForeignKey("QtDescriptionId"); + b.HasOne("BDMS.Models.Codelist", "QtDescription") + .WithMany() + .HasForeignKey("QtDescriptionId"); - b.HasOne("BDMS.Models.Stratigraphy", "Stratigraphy") - .WithMany("FaciesDescriptions") - .HasForeignKey("StratigraphyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("BDMS.Models.Stratigraphy", "Stratigraphy") + .WithMany("FaciesDescriptions") + .HasForeignKey("StratigraphyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("BDMS.Models.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); - b.Navigation("CreatedBy"); + b.Navigation("CreatedBy"); - b.Navigation("QtDescription"); + b.Navigation("QtDescription"); - b.Navigation("Stratigraphy"); + b.Navigation("Stratigraphy"); - b.Navigation("UpdatedBy"); - }); + b.Navigation("UpdatedBy"); + }); - modelBuilder.Entity("BDMS.Models.File", b => - { - b.HasOne("BDMS.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); + modelBuilder.Entity("BDMS.Models.File", b => + { + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); - b.HasOne("BDMS.Models.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); - b.Navigation("CreatedBy"); + b.Navigation("CreatedBy"); - b.Navigation("UpdatedBy"); - }); + b.Navigation("UpdatedBy"); + }); - modelBuilder.Entity("BDMS.Models.HydrotestCodelist", b => - { - b.HasOne("BDMS.Models.Codelist", "Codelist") - .WithMany("HydrotestCodelists") - .HasForeignKey("CodelistId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + modelBuilder.Entity("BDMS.Models.HydrotestCodelist", b => + { + b.HasOne("BDMS.Models.Codelist", "Codelist") + .WithMany("HydrotestCodelists") + .HasForeignKey("CodelistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("BDMS.Models.Hydrotest", "Hydrotest") - .WithMany("HydrotestCodelists") - .HasForeignKey("HydrotestId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("BDMS.Models.Hydrotest", "Hydrotest") + .WithMany("HydrotestCodelists") + .HasForeignKey("HydrotestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Codelist"); + b.Navigation("Codelist"); - b.Navigation("Hydrotest"); - }); + b.Navigation("Hydrotest"); + }); - modelBuilder.Entity("BDMS.Models.HydrotestResult", b => - { - b.HasOne("BDMS.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); + modelBuilder.Entity("BDMS.Models.HydrotestResult", b => + { + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); - b.HasOne("BDMS.Models.Hydrotest", "Hydrotest") - .WithMany("HydrotestResults") - .HasForeignKey("HydrotestId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("BDMS.Models.Hydrotest", "Hydrotest") + .WithMany("HydrotestResults") + .HasForeignKey("HydrotestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("BDMS.Models.Codelist", "Parameter") - .WithMany() - .HasForeignKey("ParameterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("BDMS.Models.Codelist", "Parameter") + .WithMany() + .HasForeignKey("ParameterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("BDMS.Models.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); - b.Navigation("CreatedBy"); + b.Navigation("CreatedBy"); - b.Navigation("Hydrotest"); + b.Navigation("Hydrotest"); - b.Navigation("Parameter"); + b.Navigation("Parameter"); - b.Navigation("UpdatedBy"); - }); + b.Navigation("UpdatedBy"); + }); - modelBuilder.Entity("BDMS.Models.Layer", b => - { - b.HasOne("BDMS.Models.Codelist", "Alteration") - .WithMany() - .HasForeignKey("AlterationId"); + modelBuilder.Entity("BDMS.Models.Layer", b => + { + b.HasOne("BDMS.Models.Codelist", "Alteration") + .WithMany() + .HasForeignKey("AlterationId"); - b.HasOne("BDMS.Models.Codelist", "CasingKind") - .WithMany() - .HasForeignKey("CasingKindId"); + b.HasOne("BDMS.Models.Codelist", "CasingKind") + .WithMany() + .HasForeignKey("CasingKindId"); - b.HasOne("BDMS.Models.Codelist", "CasingMaterial") - .WithMany() - .HasForeignKey("CasingMaterialId"); + b.HasOne("BDMS.Models.Codelist", "CasingMaterial") + .WithMany() + .HasForeignKey("CasingMaterialId"); - b.HasOne("BDMS.Models.Codelist", "Cohesion") - .WithMany() - .HasForeignKey("CohesionId"); + b.HasOne("BDMS.Models.Codelist", "Cohesion") + .WithMany() + .HasForeignKey("CohesionId"); - b.HasOne("BDMS.Models.Codelist", "Compactness") - .WithMany() - .HasForeignKey("CompactnessId"); + b.HasOne("BDMS.Models.Codelist", "Compactness") + .WithMany() + .HasForeignKey("CompactnessId"); - b.HasOne("BDMS.Models.Codelist", "Consistance") - .WithMany() - .HasForeignKey("ConsistanceId"); + b.HasOne("BDMS.Models.Codelist", "Consistance") + .WithMany() + .HasForeignKey("ConsistanceId"); - b.HasOne("BDMS.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); - b.HasOne("BDMS.Models.Codelist", "FillKind") - .WithMany() - .HasForeignKey("FillKindId"); + b.HasOne("BDMS.Models.Codelist", "FillKind") + .WithMany() + .HasForeignKey("FillKindId"); - b.HasOne("BDMS.Models.Codelist", "FillMaterial") - .WithMany() - .HasForeignKey("FillMaterialId"); + b.HasOne("BDMS.Models.Codelist", "FillMaterial") + .WithMany() + .HasForeignKey("FillMaterialId"); - b.HasOne("BDMS.Models.Codelist", "Gradation") - .WithMany() - .HasForeignKey("GradationId"); + b.HasOne("BDMS.Models.Codelist", "Gradation") + .WithMany() + .HasForeignKey("GradationId"); - b.HasOne("BDMS.Models.Codelist", "GrainSize1") - .WithMany() - .HasForeignKey("GrainSize1Id"); + b.HasOne("BDMS.Models.Codelist", "GrainSize1") + .WithMany() + .HasForeignKey("GrainSize1Id"); - b.HasOne("BDMS.Models.Codelist", "GrainSize2") - .WithMany() - .HasForeignKey("GrainSize2Id"); + b.HasOne("BDMS.Models.Codelist", "GrainSize2") + .WithMany() + .HasForeignKey("GrainSize2Id"); - b.HasOne("BDMS.Models.Codelist", "Humidity") - .WithMany() - .HasForeignKey("HumidityId"); + b.HasOne("BDMS.Models.Codelist", "Humidity") + .WithMany() + .HasForeignKey("HumidityId"); - b.HasOne("BDMS.Models.Stratigraphy", "InstrumentCasing") - .WithMany() - .HasForeignKey("InstrumentCasingId"); + b.HasOne("BDMS.Models.Stratigraphy", "InstrumentCasing") + .WithMany() + .HasForeignKey("InstrumentCasingId"); - b.HasOne("BDMS.Models.Codelist", "InstrumentKind") - .WithMany() - .HasForeignKey("InstrumentKindId"); + b.HasOne("BDMS.Models.Codelist", "InstrumentKind") + .WithMany() + .HasForeignKey("InstrumentKindId"); - b.HasOne("BDMS.Models.Codelist", "InstrumentStatus") - .WithMany() - .HasForeignKey("InstrumentStatusId"); + b.HasOne("BDMS.Models.Codelist", "InstrumentStatus") + .WithMany() + .HasForeignKey("InstrumentStatusId"); - b.HasOne("BDMS.Models.Codelist", "Lithology") - .WithMany() - .HasForeignKey("LithologyId"); + b.HasOne("BDMS.Models.Codelist", "Lithology") + .WithMany() + .HasForeignKey("LithologyId"); - b.HasOne("BDMS.Models.Codelist", "LithologyTopBedrock") - .WithMany() - .HasForeignKey("LithologyTopBedrockId"); + b.HasOne("BDMS.Models.Codelist", "LithologyTopBedrock") + .WithMany() + .HasForeignKey("LithologyTopBedrockId"); - b.HasOne("BDMS.Models.Codelist", "Lithostratigraphy") - .WithMany() - .HasForeignKey("LithostratigraphyId"); + b.HasOne("BDMS.Models.Codelist", "Lithostratigraphy") + .WithMany() + .HasForeignKey("LithostratigraphyId"); - b.HasOne("BDMS.Models.Codelist", "Plasticity") - .WithMany() - .HasForeignKey("PlasticityId"); + b.HasOne("BDMS.Models.Codelist", "Plasticity") + .WithMany() + .HasForeignKey("PlasticityId"); - b.HasOne("BDMS.Models.Codelist", "QtDescription") - .WithMany() - .HasForeignKey("QtDescriptionId"); + b.HasOne("BDMS.Models.Codelist", "QtDescription") + .WithMany() + .HasForeignKey("QtDescriptionId"); - b.HasOne("BDMS.Models.Stratigraphy", "Stratigraphy") - .WithMany("Layers") - .HasForeignKey("StratigraphyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("BDMS.Models.Stratigraphy", "Stratigraphy") + .WithMany("Layers") + .HasForeignKey("StratigraphyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("BDMS.Models.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); - b.HasOne("BDMS.Models.Codelist", "Uscs1") - .WithMany() - .HasForeignKey("Uscs1Id"); + b.HasOne("BDMS.Models.Codelist", "Uscs1") + .WithMany() + .HasForeignKey("Uscs1Id"); - b.HasOne("BDMS.Models.Codelist", "Uscs2") - .WithMany() - .HasForeignKey("Uscs2Id"); + b.HasOne("BDMS.Models.Codelist", "Uscs2") + .WithMany() + .HasForeignKey("Uscs2Id"); - b.HasOne("BDMS.Models.Codelist", "UscsDetermination") - .WithMany() - .HasForeignKey("UscsDeterminationId"); + b.HasOne("BDMS.Models.Codelist", "UscsDetermination") + .WithMany() + .HasForeignKey("UscsDeterminationId"); - b.Navigation("Alteration"); + b.Navigation("Alteration"); - b.Navigation("CasingKind"); + b.Navigation("CasingKind"); - b.Navigation("CasingMaterial"); + b.Navigation("CasingMaterial"); - b.Navigation("Cohesion"); + b.Navigation("Cohesion"); - b.Navigation("Compactness"); + b.Navigation("Compactness"); - b.Navigation("Consistance"); + b.Navigation("Consistance"); - b.Navigation("CreatedBy"); + b.Navigation("CreatedBy"); - b.Navigation("FillKind"); + b.Navigation("FillKind"); - b.Navigation("FillMaterial"); + b.Navigation("FillMaterial"); - b.Navigation("Gradation"); + b.Navigation("Gradation"); - b.Navigation("GrainSize1"); + b.Navigation("GrainSize1"); - b.Navigation("GrainSize2"); + b.Navigation("GrainSize2"); - b.Navigation("Humidity"); + b.Navigation("Humidity"); - b.Navigation("InstrumentCasing"); + b.Navigation("InstrumentCasing"); - b.Navigation("InstrumentKind"); + b.Navigation("InstrumentKind"); - b.Navigation("InstrumentStatus"); + b.Navigation("InstrumentStatus"); - b.Navigation("Lithology"); + b.Navigation("Lithology"); - b.Navigation("LithologyTopBedrock"); + b.Navigation("LithologyTopBedrock"); - b.Navigation("Lithostratigraphy"); + b.Navigation("Lithostratigraphy"); - b.Navigation("Plasticity"); + b.Navigation("Plasticity"); - b.Navigation("QtDescription"); + b.Navigation("QtDescription"); - b.Navigation("Stratigraphy"); + b.Navigation("Stratigraphy"); - b.Navigation("UpdatedBy"); + b.Navigation("UpdatedBy"); - b.Navigation("Uscs1"); + b.Navigation("Uscs1"); - b.Navigation("Uscs2"); + b.Navigation("Uscs2"); - b.Navigation("UscsDetermination"); - }); + b.Navigation("UscsDetermination"); + }); - modelBuilder.Entity("BDMS.Models.LayerCodelist", b => - { - b.HasOne("BDMS.Models.Codelist", "Codelist") - .WithMany("LayerCodelists") - .HasForeignKey("CodelistId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + modelBuilder.Entity("BDMS.Models.LayerCodelist", b => + { + b.HasOne("BDMS.Models.Codelist", "Codelist") + .WithMany("LayerCodelists") + .HasForeignKey("CodelistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("BDMS.Models.Layer", "Layer") - .WithMany("LayerCodelists") - .HasForeignKey("LayerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("BDMS.Models.Layer", "Layer") + .WithMany("LayerCodelists") + .HasForeignKey("LayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Codelist"); + b.Navigation("Codelist"); - b.Navigation("Layer"); - }); + b.Navigation("Layer"); + }); - modelBuilder.Entity("BDMS.Models.LithologicalDescription", b => - { - b.HasOne("BDMS.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); + modelBuilder.Entity("BDMS.Models.LithologicalDescription", b => + { + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); - b.HasOne("BDMS.Models.Codelist", "QtDescription") - .WithMany() - .HasForeignKey("QtDescriptionId"); + b.HasOne("BDMS.Models.Codelist", "QtDescription") + .WithMany() + .HasForeignKey("QtDescriptionId"); - b.HasOne("BDMS.Models.Stratigraphy", "Stratigraphy") - .WithMany("LithologicalDescriptions") - .HasForeignKey("StratigraphyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("BDMS.Models.Stratigraphy", "Stratigraphy") + .WithMany("LithologicalDescriptions") + .HasForeignKey("StratigraphyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("BDMS.Models.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); - b.Navigation("CreatedBy"); + b.Navigation("CreatedBy"); - b.Navigation("QtDescription"); + b.Navigation("QtDescription"); - b.Navigation("Stratigraphy"); + b.Navigation("Stratigraphy"); - b.Navigation("UpdatedBy"); - }); + b.Navigation("UpdatedBy"); + }); - modelBuilder.Entity("BDMS.Models.LithostratigraphyLayer", b => - { - b.HasOne("BDMS.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); + modelBuilder.Entity("BDMS.Models.LithostratigraphyLayer", b => + { + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); - b.HasOne("BDMS.Models.Codelist", "Lithostratigraphy") - .WithMany() - .HasForeignKey("LithostratigraphyId"); + b.HasOne("BDMS.Models.Codelist", "Lithostratigraphy") + .WithMany() + .HasForeignKey("LithostratigraphyId"); - b.HasOne("BDMS.Models.Stratigraphy", "Stratigraphy") - .WithMany("LithostratigraphyLayers") - .HasForeignKey("StratigraphyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("BDMS.Models.Stratigraphy", "Stratigraphy") + .WithMany("LithostratigraphyLayers") + .HasForeignKey("StratigraphyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("BDMS.Models.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); - b.Navigation("CreatedBy"); + b.Navigation("CreatedBy"); - b.Navigation("Lithostratigraphy"); + b.Navigation("Lithostratigraphy"); - b.Navigation("Stratigraphy"); + b.Navigation("Stratigraphy"); - b.Navigation("UpdatedBy"); - }); + b.Navigation("UpdatedBy"); + }); - modelBuilder.Entity("BDMS.Models.Observation", b => - { - b.HasOne("BDMS.Models.Borehole", "Borehole") - .WithMany() - .HasForeignKey("BoreholeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + modelBuilder.Entity("BDMS.Models.Observation", b => + { + b.HasOne("BDMS.Models.Borehole", "Borehole") + .WithMany() + .HasForeignKey("BoreholeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("BDMS.Models.Stratigraphy", "Casing") - .WithMany() - .HasForeignKey("CasingId"); + b.HasOne("BDMS.Models.Stratigraphy", "Casing") + .WithMany() + .HasForeignKey("CasingId"); - b.HasOne("BDMS.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); - b.HasOne("BDMS.Models.Codelist", "Reliability") - .WithMany() - .HasForeignKey("ReliabilityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("BDMS.Models.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Borehole"); - - b.Navigation("Casing"); - - b.Navigation("CreatedBy"); - - b.Navigation("Reliability"); + b.HasOne("BDMS.Models.Codelist", "Reliability") + .WithMany() + .HasForeignKey("ReliabilityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("Borehole"); + + b.Navigation("Casing"); + + b.Navigation("CreatedBy"); + + b.Navigation("Reliability"); - b.Navigation("UpdatedBy"); - }); + b.Navigation("UpdatedBy"); + }); - modelBuilder.Entity("BDMS.Models.Stratigraphy", b => - { - b.HasOne("BDMS.Models.Borehole", "Borehole") - .WithMany("Stratigraphies") - .HasForeignKey("BoreholeId"); - - b.HasOne("BDMS.Models.User", "CreatedBy") - .WithMany() - .HasForeignKey("CreatedById"); - - b.HasOne("BDMS.Models.Stratigraphy", "FillCasing") - .WithMany() - .HasForeignKey("FillCasingId"); - - b.HasOne("BDMS.Models.Codelist", "Kind") - .WithMany() - .HasForeignKey("KindId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("BDMS.Models.User", "UpdatedBy") - .WithMany() - .HasForeignKey("UpdatedById"); - - b.Navigation("Borehole"); - - b.Navigation("CreatedBy"); - - b.Navigation("FillCasing"); - - b.Navigation("Kind"); - - b.Navigation("UpdatedBy"); - }); - - modelBuilder.Entity("BDMS.Models.UserEvent", b => - { - b.HasOne("BDMS.Models.User", "User") - .WithMany("BoringEvents") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("BDMS.Models.UserWorkgroupRole", b => - { - b.HasOne("BDMS.Models.User", null) - .WithMany("WorkgroupRoles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("BDMS.Models.Workflow", b => - { - b.HasOne("BDMS.Models.Borehole", "Borehole") - .WithMany("Workflows") - .HasForeignKey("BoreholeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("BDMS.Models.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Borehole"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("BDMS.Models.FieldMeasurement", b => - { - b.HasOne("BDMS.Models.Observation", null) - .WithOne() - .HasForeignKey("BDMS.Models.FieldMeasurement", "Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("BDMS.Models.Codelist", "Parameter") - .WithMany() - .HasForeignKey("ParameterId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + modelBuilder.Entity("BDMS.Models.Stratigraphy", b => + { + b.HasOne("BDMS.Models.Borehole", "Borehole") + .WithMany("Stratigraphies") + .HasForeignKey("BoreholeId"); + + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.Stratigraphy", "FillCasing") + .WithMany() + .HasForeignKey("FillCasingId"); + + b.HasOne("BDMS.Models.Codelist", "Kind") + .WithMany() + .HasForeignKey("KindId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("Borehole"); + + b.Navigation("CreatedBy"); + + b.Navigation("FillCasing"); + + b.Navigation("Kind"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("BDMS.Models.UserEvent", b => + { + b.HasOne("BDMS.Models.User", "User") + .WithMany("BoringEvents") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BDMS.Models.UserWorkgroupRole", b => + { + b.HasOne("BDMS.Models.User", null) + .WithMany("WorkgroupRoles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("BDMS.Models.Workflow", b => + { + b.HasOne("BDMS.Models.Borehole", "Borehole") + .WithMany("Workflows") + .HasForeignKey("BoreholeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Borehole"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("BDMS.Models.FieldMeasurement", b => + { + b.HasOne("BDMS.Models.Observation", null) + .WithOne() + .HasForeignKey("BDMS.Models.FieldMeasurement", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Codelist", "Parameter") + .WithMany() + .HasForeignKey("ParameterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("BDMS.Models.Codelist", "SampleType") - .WithMany() - .HasForeignKey("SampleTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Parameter"); - - b.Navigation("SampleType"); - }); - - modelBuilder.Entity("BDMS.Models.GroundwaterLevelMeasurement", b => - { - b.HasOne("BDMS.Models.Observation", null) - .WithOne() - .HasForeignKey("BDMS.Models.GroundwaterLevelMeasurement", "Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("BDMS.Models.Codelist", "Kind") - .WithMany() - .HasForeignKey("KindId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Kind"); - }); - - modelBuilder.Entity("BDMS.Models.Hydrotest", b => - { - b.HasOne("BDMS.Models.Observation", null) - .WithOne() - .HasForeignKey("BDMS.Models.Hydrotest", "Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("BDMS.Models.WaterIngress", b => - { - b.HasOne("BDMS.Models.Codelist", "Conditions") - .WithMany() - .HasForeignKey("ConditionsId"); - - b.HasOne("BDMS.Models.Observation", null) - .WithOne() - .HasForeignKey("BDMS.Models.WaterIngress", "Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("BDMS.Models.Codelist", "Quantity") - .WithMany() - .HasForeignKey("QuantityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Conditions"); - - b.Navigation("Quantity"); - }); - - modelBuilder.Entity("BDMS.Models.Borehole", b => - { - b.Navigation("BoreholeCodelists"); - - b.Navigation("BoreholeFiles"); - - b.Navigation("Stratigraphies"); - - b.Navigation("Workflows"); - }); - - modelBuilder.Entity("BDMS.Models.Codelist", b => - { - b.Navigation("BoreholeCodelists"); + b.HasOne("BDMS.Models.Codelist", "SampleType") + .WithMany() + .HasForeignKey("SampleTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Parameter"); + + b.Navigation("SampleType"); + }); + + modelBuilder.Entity("BDMS.Models.GroundwaterLevelMeasurement", b => + { + b.HasOne("BDMS.Models.Observation", null) + .WithOne() + .HasForeignKey("BDMS.Models.GroundwaterLevelMeasurement", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Codelist", "Kind") + .WithMany() + .HasForeignKey("KindId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Kind"); + }); + + modelBuilder.Entity("BDMS.Models.Hydrotest", b => + { + b.HasOne("BDMS.Models.Observation", null) + .WithOne() + .HasForeignKey("BDMS.Models.Hydrotest", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("BDMS.Models.WaterIngress", b => + { + b.HasOne("BDMS.Models.Codelist", "Conditions") + .WithMany() + .HasForeignKey("ConditionsId"); + + b.HasOne("BDMS.Models.Observation", null) + .WithOne() + .HasForeignKey("BDMS.Models.WaterIngress", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Codelist", "Quantity") + .WithMany() + .HasForeignKey("QuantityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Conditions"); + + b.Navigation("Quantity"); + }); + + modelBuilder.Entity("BDMS.Models.Borehole", b => + { + b.Navigation("BoreholeCodelists"); + + b.Navigation("BoreholeFiles"); + + b.Navigation("Stratigraphies"); + + b.Navigation("Workflows"); + }); + + modelBuilder.Entity("BDMS.Models.Codelist", b => + { + b.Navigation("BoreholeCodelists"); - b.Navigation("HydrotestCodelists"); - - b.Navigation("LayerCodelists"); - }); + b.Navigation("HydrotestCodelists"); + + b.Navigation("LayerCodelists"); + }); - modelBuilder.Entity("BDMS.Models.File", b => - { - b.Navigation("BoreholeFiles"); - }); - - modelBuilder.Entity("BDMS.Models.Layer", b => - { - b.Navigation("LayerCodelists"); - }); - - modelBuilder.Entity("BDMS.Models.Stratigraphy", b => - { - b.Navigation("ChronostratigraphyLayers"); + modelBuilder.Entity("BDMS.Models.File", b => + { + b.Navigation("BoreholeFiles"); + }); + + modelBuilder.Entity("BDMS.Models.Layer", b => + { + b.Navigation("LayerCodelists"); + }); + + modelBuilder.Entity("BDMS.Models.Stratigraphy", b => + { + b.Navigation("ChronostratigraphyLayers"); - b.Navigation("FaciesDescriptions"); + b.Navigation("FaciesDescriptions"); - b.Navigation("Layers"); + b.Navigation("Layers"); - b.Navigation("LithologicalDescriptions"); + b.Navigation("LithologicalDescriptions"); - b.Navigation("LithostratigraphyLayers"); - }); + b.Navigation("LithostratigraphyLayers"); + }); - modelBuilder.Entity("BDMS.Models.User", b => - { - b.Navigation("BoringEvents"); + modelBuilder.Entity("BDMS.Models.User", b => + { + b.Navigation("BoringEvents"); - b.Navigation("WorkgroupRoles"); - }); + b.Navigation("WorkgroupRoles"); + }); - modelBuilder.Entity("BDMS.Models.Workgroup", b => - { - b.Navigation("Boreholes"); - }); + modelBuilder.Entity("BDMS.Models.Workgroup", b => + { + b.Navigation("Boreholes"); + }); - modelBuilder.Entity("BDMS.Models.Hydrotest", b => - { - b.Navigation("HydrotestCodelists"); + modelBuilder.Entity("BDMS.Models.Hydrotest", b => + { + b.Navigation("HydrotestCodelists"); - b.Navigation("HydrotestResults"); - }); + b.Navigation("HydrotestResults"); + }); #pragma warning restore 612, 618 - } } } diff --git a/src/api/Models/Borehole.cs b/src/api/Models/Borehole.cs index 89e75c808..8b9ea6dc6 100644 --- a/src/api/Models/Borehole.cs +++ b/src/api/Models/Borehole.cs @@ -303,13 +303,8 @@ public class Borehole : IChangeTracking, IIdentifyable /// /// Gets or sets the 's QtTopBedrock id. /// - [Column("qt_top_bedrock_id_cli")] - public int? QtTopBedrockId { get; set; } - - /// - /// Gets or sets the 's QtTopBedrock. - /// - public Codelist? QtTopBedrock { get; set; } + [Column("qt_top_bedrock")] + public double? QtTopBedrock { get; set; } /// /// Gets or sets whether the has groundwater. @@ -377,13 +372,8 @@ public class Borehole : IChangeTracking, IIdentifyable /// /// Gets or sets the 's Qt top bedrock tvd id. /// - [Column("qt_top_bedrock_tvd_id_cli")] - public int? QtTopBedrockTvdId { get; set; } - - /// - /// Gets or sets the 's Qt top bedrock tvd. - /// - public Codelist? QtTopBedrockTvd { get; set; } + [Column("qt_top_bedrock_tvd")] + public double? QtTopBedrockTvd { get; set; } /// /// Gets or sets the 's reference elevation. From a14fb8f4cb2eb2dbdbc0fda748816821484e9f24 Mon Sep 17 00:00:00 2001 From: tschumpr Date: Mon, 4 Dec 2023 16:51:30 +0100 Subject: [PATCH 2/9] Replace dropdown with numeric input --- .../segments/boreholeDetailSegment.js | 38 ++++++++++++------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/src/client/src/commons/form/borehole/segments/boreholeDetailSegment.js b/src/client/src/commons/form/borehole/segments/boreholeDetailSegment.js index f3f85cc65..134add646 100644 --- a/src/client/src/commons/form/borehole/segments/boreholeDetailSegment.js +++ b/src/client/src/commons/form/borehole/segments/boreholeDetailSegment.js @@ -122,19 +122,24 @@ const BoreholeDetailSegment = props => { - { - updateChange("custom.qt_top_bedrock", selected.id, false); + { + updateNumber( + "custom.qt_top_bedrock", + e.target.value === "" ? null : parseIfString(e.target.value), + ); }} - schema="custom.qt_top_bedrock" - selected={borehole.data.custom.qt_top_bedrock} + spellCheck="false" + value={borehole.data.custom.qt_top_bedrock} + thousandSeparator="'" /> - + @@ -162,12 +167,19 @@ const BoreholeDetailSegment = props => { - { - updateChange("custom.qt_top_bedrock_tvd", selected.id, false); + { + updateNumber( + "custom.qt_top_bedrock_tvd", + e.target.value === "" ? null : parseIfString(e.target.value), + ); }} - schema="custom.qt_top_bedrock" - selected={borehole.data.custom.qt_top_bedrock_tvd} + spellCheck="false" + value={borehole.data.custom.qt_top_bedrock_tvd} + thousandSeparator="'" /> From 2a6ad7cba2cd90b05eebb765188c95fb3f5c8bfa Mon Sep 17 00:00:00 2001 From: tschumpr Date: Tue, 5 Dec 2023 09:35:05 +0100 Subject: [PATCH 3/9] Change from dropdown to range filter --- .../commons/search/components/listFilter.js | 6 +++ .../commons/search/data/boreholeSearchData.js | 52 ++++++++++++++----- .../search/editor/searchEditorState.js | 6 ++- src/client/src/commons/search/searchState.js | 6 ++- 4 files changed, 52 insertions(+), 18 deletions(-) diff --git a/src/client/src/commons/search/components/listFilter.js b/src/client/src/commons/search/components/listFilter.js index 0dc970473..7280f0732 100644 --- a/src/client/src/commons/search/components/listFilter.js +++ b/src/client/src/commons/search/components/listFilter.js @@ -158,6 +158,12 @@ const ListFilter = props => { updateChange("reference_elevation_to", "", false); } else if (item.value === "created_date_to") { resetCreatedDate(); + } else if (item.value === "qt_top_bedrock_to") { + updateChange("qt_top_bedrock_from", "", false); + updateChange("qt_top_bedrock_to", "", false); + } else if (item.value === "top_bedrock_tvd_to") { + updateChange("top_bedrock_tvd_from", "", false); + updateChange("top_bedrock_tvd_to", "", false); } }; diff --git a/src/client/src/commons/search/data/boreholeSearchData.js b/src/client/src/commons/search/data/boreholeSearchData.js index ddebe4e49..628c5c230 100644 --- a/src/client/src/commons/search/data/boreholeSearchData.js +++ b/src/client/src/commons/search/data/boreholeSearchData.js @@ -275,26 +275,50 @@ export const boreholeSearchData = [ }, { id: 26, - type: "Dropdown", + type: "Input", label: "qt_top_bedrock", - value: "qt_top_bedrock", - schema: "custom.qt_top_bedrock", - multiple: false, - search: false, + value: "qt_top_bedrock_from", + isNumber: true, + inputType: "number", + hasTwoFields: true, isVisibleValue: "qt_top_bedrock", + placeholder: "from", }, { id: 27, - type: "Dropdown", + type: "Input", + label: "", + value: "qt_top_bedrock_to", + isNumber: true, + inputType: "number", + hasTwoFields: true, + isVisibleValue: "qt_top_bedrock", + placeholder: "to", + }, + { + id: 28, + type: "Input", label: "top_bedrock_tvd_qt", - value: "qt_top_bedrock_tvd", - schema: "custom.qt_top_bedrock", - multiple: false, - search: false, + value: "qt_top_bedrock_tvd_from", + isNumber: true, + inputType: "number", + hasTwoFields: true, isVisibleValue: "top_bedrock_tvd_qt", + placeholder: "from", }, { - id: 28, + id: 29, + type: "Input", + label: "", + value: "qt_top_bedrock_tvd_to", + isNumber: true, + inputType: "number", + hasTwoFields: true, + isVisibleValue: "top_bedrock_tvd_qt", + placeholder: "to", + }, + { + id: 30, type: "Radio", label: "groundwater", value: "groundwater", @@ -303,7 +327,7 @@ export const boreholeSearchData = [ isVisibleValue: "extended.groundwater", }, { - id: 29, + id: 31, type: "DomainTree", label: "lithology_top_bedrock", value: "lithology_top_bedrock", @@ -316,7 +340,7 @@ export const boreholeSearchData = [ isVisibleValue: "custom.lit_pet_top_bedrock", }, { - id: 30, + id: 32, type: "DomainTree", label: "lithostratigraphy_top_bedrock", value: "lithostratigraphy_top_bedrock", @@ -331,7 +355,7 @@ export const boreholeSearchData = [ isVisibleValue: "custom.lit_str_top_bedrock", }, { - id: 31, + id: 33, type: "DomainTree", label: "chronostratigraphy_top_bedrock", value: "chronostratigraphy_top_bedrock", diff --git a/src/client/src/commons/search/editor/searchEditorState.js b/src/client/src/commons/search/editor/searchEditorState.js index fb6184520..ec2069f09 100644 --- a/src/client/src/commons/search/editor/searchEditorState.js +++ b/src/client/src/commons/search/editor/searchEditorState.js @@ -140,8 +140,10 @@ const initialState = { top_bedrock_tvd_to: "", qt_depth: null, qt_total_depth_tvd: null, - qt_top_bedrock: null, - qt_top_bedrock_tvd: null, + qt_top_bedrock_from: "", + qt_top_bedrock_to: "", + qt_top_bedrock_tvd_from: "", + qt_top_bedrock_tvd_to: "", reference_elevation_type: null, qt_reference_elevation: null, diff --git a/src/client/src/commons/search/searchState.js b/src/client/src/commons/search/searchState.js index cb0d85dd0..da1721610 100644 --- a/src/client/src/commons/search/searchState.js +++ b/src/client/src/commons/search/searchState.js @@ -134,8 +134,10 @@ const initialState = { top_bedrock_tvd_to: "", qt_depth: null, qt_total_depth_tvd: null, - qt_top_bedrock: null, - qt_top_bedrock_tvd: null, + qt_top_bedrock_from: "", + qt_top_bedrock_to: "", + qt_top_bedrock_tvd_from: "", + qt_top_bedrock_tvd_to: "", reference_elevation_type: null, qt_reference_elevation: null, From 8a9fa2136415558014fd532f0ff5e1405fc28e32 Mon Sep 17 00:00:00 2001 From: tschumpr Date: Tue, 5 Dec 2023 09:55:11 +0100 Subject: [PATCH 4/9] Update test expectation --- src/client/cypress/e2e/editor/boreholeform.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/cypress/e2e/editor/boreholeform.cy.js b/src/client/cypress/e2e/editor/boreholeform.cy.js index 916167478..ee75eb62d 100644 --- a/src/client/cypress/e2e/editor/boreholeform.cy.js +++ b/src/client/cypress/e2e/editor/boreholeform.cy.js @@ -31,7 +31,7 @@ describe("Test for the borehole form.", () => { // fill all dropdowns on borehole tab cy.get('[data-cy="borehole-menu-item"]').click(); cy.get('[data-cy="domain-dropdown"]') - .should("have.length", 10) + .should("have.length", 8) .each((el, index, list) => cy.wrap(el).click().find('[role="option"]').eq(1).click(), ); From 229fc7beb9d12bcaff0c440737d4f3d38f5fabdd Mon Sep 17 00:00:00 2001 From: tschumpr Date: Tue, 5 Dec 2023 10:07:04 +0100 Subject: [PATCH 5/9] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0968bdf57..d5315cf5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Upgraded to OpenLayers 8. - Upgraded to .NET 8. - Upgraded to Node 20. +- Use numeric input instead of dropdown for top bedrock quality fields. ## v2.0.452 - 2023-07-05 From c0366549c713be8342ceb35ead1084e62346ed0e Mon Sep 17 00:00:00 2001 From: tschumpr Date: Tue, 5 Dec 2023 10:07:29 +0100 Subject: [PATCH 6/9] Fix name --- src/client/src/commons/search/components/listFilter.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/src/commons/search/components/listFilter.js b/src/client/src/commons/search/components/listFilter.js index 7280f0732..7e9bcd577 100644 --- a/src/client/src/commons/search/components/listFilter.js +++ b/src/client/src/commons/search/components/listFilter.js @@ -161,9 +161,9 @@ const ListFilter = props => { } else if (item.value === "qt_top_bedrock_to") { updateChange("qt_top_bedrock_from", "", false); updateChange("qt_top_bedrock_to", "", false); - } else if (item.value === "top_bedrock_tvd_to") { - updateChange("top_bedrock_tvd_from", "", false); - updateChange("top_bedrock_tvd_to", "", false); + } else if (item.value === "qt_top_bedrock_tvd_to") { + updateChange("qt_top_bedrock_tvd_from", "", false); + updateChange("qt_top_bedrock_tvd_to", "", false); } }; From ed1a3741a8dd1dc656ffb20c9b2c9a4c2128f344 Mon Sep 17 00:00:00 2001 From: tschumpr Date: Tue, 5 Dec 2023 10:11:44 +0100 Subject: [PATCH 7/9] Filter range --- src/api-legacy/v1/action.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/api-legacy/v1/action.py b/src/api-legacy/v1/action.py index bb839a314..b7d1aed31 100644 --- a/src/api-legacy/v1/action.py +++ b/src/api-legacy/v1/action.py @@ -1039,11 +1039,16 @@ def filterBorehole(self, filter={}): top_bedrock_bho <= %s """ % self.getIdx()) - if 'qt_top_bedrock' in keys and filter[ - 'qt_top_bedrock'] not in ['', None]: - params.append(int(filter['qt_top_bedrock'])) + if 'qt_top_bedrock_from' in keys and filter['qt_top_bedrock_from'] not in ['', None]: + params.append(float(filter['qt_top_bedrock_from'])) where.append(""" - qt_top_bedrock = %s + qt_top_bedrock >= %s + """ % self.getIdx()) + + if 'qt_top_bedrock_to' in keys and filter['qt_top_bedrock_to'] not in ['', None]: + params.append(float(filter['qt_top_bedrock_to'])) + where.append(""" + qt_top_bedrock <= %s """ % self.getIdx()) if 'top_bedrock_tvd_from' in keys and filter['top_bedrock_tvd_from'] not in ['', None]: @@ -1058,11 +1063,16 @@ def filterBorehole(self, filter={}): top_bedrock_tvd_bho <= %s """ % self.getIdx()) - if 'qt_top_bedrock_tvd' in keys and filter[ - 'qt_top_bedrock_tvd'] not in ['', None]: - params.append(int(filter['qt_top_bedrock_tvd'])) + if 'qt_top_bedrock_tvd_from' in keys and filter['qt_top_bedrock_tvd_from'] not in ['', None]: + params.append(float(filter['qt_top_bedrock_tvd_from'])) + where.append(""" + qt_top_bedrock_tvd >= %s + """ % self.getIdx()) + + if 'qt_top_bedrock_tvd_to' in keys and filter['qt_top_bedrock_tvd_to'] not in ['', None]: + params.append(float(filter['qt_top_bedrock_tvd_to'])) where.append(""" - qt_top_bedrock_tvd = %s + qt_top_bedrock_tvd <= %s """ % self.getIdx()) if 'lithology_top_bedrock' in keys and filter[ From 742025e3807469b364fdfb96a8425b68280175d7 Mon Sep 17 00:00:00 2001 From: tschumpr Date: Tue, 5 Dec 2023 10:21:58 +0100 Subject: [PATCH 8/9] Show correct values in viewer --- .../src/commons/detail/meta/metaComponent.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/client/src/commons/detail/meta/metaComponent.js b/src/client/src/commons/detail/meta/metaComponent.js index a04e7d935..70271804b 100644 --- a/src/client/src/commons/detail/meta/metaComponent.js +++ b/src/client/src/commons/detail/meta/metaComponent.js @@ -411,15 +411,17 @@ class MetaComponent extends React.Component { data.qt_total_depth_tvd, "total_depth_tvd_qt", )} - {this.getDomainRow( - "custom.qt_top_bedrock", - data.custom.qt_top_bedrock, + {this.getNumericTextRow( "qt_top_bedrock", + data.custom.qt_top_bedrock !== null + ? data.custom.qt_top_bedrock + : null, )} - {this.getDomainRow( - "custom.qt_top_bedrock", - data.custom.qt_top_bedrock_tvd, + {this.getNumericTextRow( "top_bedrock_tvd_qt", + data.custom.qt_top_bedrock_tvd !== null + ? data.custom.qt_top_bedrock_tvd + : null, )} {this.getDomainRow( "custom.lithology_top_bedrock", From 76b0ab0a3c1a7bebcb971cb40b9730299e56e9bb Mon Sep 17 00:00:00 2001 From: tschumpr Date: Wed, 6 Dec 2023 14:03:38 +0100 Subject: [PATCH 9/9] Fix spacing --- src/api/BdmsContextExtensions.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/BdmsContextExtensions.cs b/src/api/BdmsContextExtensions.cs index 26768380b..be4605a69 100644 --- a/src/api/BdmsContextExtensions.cs +++ b/src/api/BdmsContextExtensions.cs @@ -159,9 +159,9 @@ public static void SeedData(this BdmsContext context) .RuleFor(o => o.Inclination, f => f.Random.Double(0, 5).OrNull(f, .05f)) .RuleFor(o => o.InclinationDirection, f => f.Random.Double(0, 360).OrNull(f, .05f)) .RuleFor(o => o.QtDepthId, f => f.PickRandom(qtDepthIds).OrNull(f, .05f)) - .RuleFor(o => o.QtDepth, _ => default!) + .RuleFor(o => o.QtDepth, _ => default!) .RuleFor(o => o.TopBedrock, f => f.Random.Double(0, 1000).OrNull(f, .05f)) - .RuleFor(o => o.QtTopBedrock, f => f.Random.Double(0, 2).OrNull(f, .05f)) + .RuleFor(o => o.QtTopBedrock, f => f.Random.Double(0, 2).OrNull(f, .05f)) .RuleFor(o => o.HasGroundwater, f => f.Random.Bool().OrNull(f, .2f)) .RuleFor(o => o.Remarks, f => f.Rant.Review().OrNull(f, .05f)) .RuleFor(o => o.LithologyTopBedrockId, f => f.PickRandom(lithologyTopBedrockIds).OrNull(f, .05f)) @@ -172,7 +172,7 @@ public static void SeedData(this BdmsContext context) .RuleFor(o => o.Chronostratigraphy, _ => default!) .RuleFor(o => o.SpudDate, f => f.Date.Past().ToUniversalTime().OrNull(f, .05f)) .RuleFor(o => o.TopBedrockTvd, f => f.Random.Double(0, 1000).OrNull(f, .05f)) - .RuleFor(o => o.QtTopBedrockTvd, f => f.Random.Double(0, 2).OrNull(f, .05f)) + .RuleFor(o => o.QtTopBedrockTvd, f => f.Random.Double(0, 2).OrNull(f, .05f)) .RuleFor(o => o.ReferenceElevation, f => f.Random.Double(0, 4500).OrNull(f, .05f)) .RuleFor(o => o.QtReferenceElevationId, f => f.PickRandom(qtElevationIds).OrNull(f, .05f)) .RuleFor(o => o.QtReferenceElevation, _ => default!) @@ -182,7 +182,7 @@ public static void SeedData(this BdmsContext context) .RuleFor(o => o.ReferenceElevationType, _ => default!) .RuleFor(o => o.TotalDepthTvd, f => f.Random.Double(0, 4500).OrNull(f, .05f)) .RuleFor(o => o.QtTotalDepthTvdId, f => f.PickRandom(qtDepthIds).OrNull(f, .05f)) - .RuleFor(o => o.QtTotalDepthTvd, _ => default!) + .RuleFor(o => o.QtTotalDepthTvd, _ => default!) .RuleFor(o => o.BoreholeCodelists, _ => new Collection()) .RuleFor(o => o.Codelists, _ => new Collection()) .RuleFor(o => o.Geometry, f =>