diff --git a/CHANGELOG.md b/CHANGELOG.md index 73e262824..ae9715caf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Changed + +- Renamed technical attributes `kind_id_cli` to `borehole_type_id`, `top_bedrock` to `top_bedrock_fresh` and `qt_top_bedrock` to `top_bedrock_weathered`. + ## v2.1.772 - 2024-06-27 ### Added diff --git a/src/api-legacy/v1/action.py b/src/api-legacy/v1/action.py index 718985efc..f225de367 100644 --- a/src/api-legacy/v1/action.py +++ b/src/api-legacy/v1/action.py @@ -51,7 +51,7 @@ def getordering(self, orderby, direction): _orderby = 'total_depth' elif orderby == 'borehole_type': - _orderby = 'kind_id_cli' + _orderby = 'borehole_type_id' elif orderby == 'restriction_until': _orderby = 'restriction_until_bho' @@ -75,7 +75,7 @@ def getordering(self, orderby, direction): _orderby = 'purpose_id_cli' elif orderby == 'elevation_z': - _orderby = 'elevation_z_bho' + _orderby = 'elevation_z_bho' # there are inconsitencies in the client code, that sometimes the translation key is send to the api. Therefore some duplicate keys are mapped here. elif orderby == 'boreholestatus': @@ -86,13 +86,13 @@ def getordering(self, orderby, direction): elif orderby == 'creationdate': _orderby = 'created_bho' - + elif orderby == 'totaldepth': _orderby = 'total_depth' - - elif orderby == 'top_bedrock': - _orderby = 'top_bedrock_bho' - + + elif orderby == 'top_bedrock_fresh_md': + _orderby = 'top_bedrock_fresh_md' + else: orderby = 'original_name' @@ -141,7 +141,7 @@ def filterProfileLayers(self, filter={}): keys = filter.keys() - + key_to_table_column = { 'grain_shape': {'table': 'bdms.layer_grain_shape_codelist', 'column': 'grain_shape_id'}, 'grain_granularity': {'table': 'bdms.layer_grain_angularity_codelist', 'column': 'grain_angularity_id'}, @@ -368,7 +368,7 @@ def filterBorehole(self, filter={}): """ % self.getIdx()) if 'borehole_identifier' in keys: - if filter['borehole_identifier'] == 0: + if filter['borehole_identifier'] == 0: if 'identifier_value' in keys and filter['identifier_value'] not in ['', None]: params.append(int(filter['identifier_value'])) where.append(""" @@ -434,7 +434,7 @@ def filterBorehole(self, filter={}): if 'borehole_type' in keys and filter['borehole_type'] not in ['', None]: params.append(int(filter['borehole_type'])) where.append(""" - kind_id_cli = %s + borehole_type_id = %s """ % self.getIdx()) if 'restriction' in keys and filter[ @@ -596,28 +596,28 @@ def filterBorehole(self, filter={}): total_depth_bho <= %s """ % self.getIdx()) - if 'top_bedrock_from' in keys and filter['top_bedrock_from'] not in ['', None]: - params.append(float(filter['top_bedrock_from'])) + if 'top_bedrock_fresh_md_from' in keys and filter['top_bedrock_fresh_md_from'] not in ['', None]: + params.append(float(filter['top_bedrock_fresh_md_from'])) where.append(""" - top_bedrock_bho >= %s + top_bedrock_fresh_md >= %s """ % self.getIdx()) - if 'top_bedrock_to' in keys and filter['top_bedrock_to'] not in ['', None]: - params.append(float(filter['top_bedrock_to'])) + if 'top_bedrock_fresh_md_to' in keys and filter['top_bedrock_fresh_md_to'] not in ['', None]: + params.append(float(filter['top_bedrock_fresh_md_to'])) where.append(""" - top_bedrock_bho <= %s + top_bedrock_fresh_md <= %s """ % self.getIdx()) - if 'qt_top_bedrock_from' in keys and filter['qt_top_bedrock_from'] not in ['', None]: - params.append(float(filter['qt_top_bedrock_from'])) + if 'top_bedrock_weathered_md_from' in keys and filter['top_bedrock_weathered_md_from'] not in ['', None]: + params.append(float(filter['top_bedrock_weathered_md_from'])) where.append(""" - qt_top_bedrock >= %s + top_bedrock_weathered_md >= %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'])) + if 'top_bedrock_weathered_md_to' in keys and filter['top_bedrock_weathered_md_to'] not in ['', None]: + params.append(float(filter['top_bedrock_weathered_md_to'])) where.append(""" - qt_top_bedrock <= %s + top_bedrock_weathered_md <= %s """ % self.getIdx()) if 'lithology_top_bedrock' in keys and filter[ @@ -703,4 +703,4 @@ def filterLithostratigraphy(self, filter={}): lithostratigraphy_id = %s """ % self.getIdx()) - return where, params, joins \ No newline at end of file + return where, params, joins diff --git a/src/api-legacy/v1/borehole/editinglist.py b/src/api-legacy/v1/borehole/editinglist.py index 087e62594..b85b0a7b0 100644 --- a/src/api-legacy/v1/borehole/editinglist.py +++ b/src/api-legacy/v1/borehole/editinglist.py @@ -83,7 +83,7 @@ async def execute( ) END AS lock, original_name_bho as original_name, - kind_id_cli as borehole_type, + borehole_type_id as borehole_type, restriction_id_cli as restriction, to_char( restriction_until_bho, diff --git a/src/api-legacy/v1/borehole/geojson.py b/src/api-legacy/v1/borehole/geojson.py index c12e7e1e9..1032eb794 100644 --- a/src/api-legacy/v1/borehole/geojson.py +++ b/src/api-legacy/v1/borehole/geojson.py @@ -224,7 +224,7 @@ async def execute(self, filter={}, user=None): LEFT JOIN bdms.codelist kd ON - kind_id_cli = kd.id_cli + borehole_type_id = kd.id_cli LEFT JOIN bdms.codelist rs diff --git a/src/api-legacy/v1/borehole/get.py b/src/api-legacy/v1/borehole/get.py index 5ad1f81cb..839d19cba 100644 --- a/src/api-legacy/v1/borehole/get.py +++ b/src/api-legacy/v1/borehole/get.py @@ -41,7 +41,7 @@ def get_sql(sql_lock='', file_permission=''): ) t2 ) as creator, {sql_lock} - kind_id_cli as borehole_type, + borehole_type_id as borehole_type, restriction_id_cli as restriction, to_char( restriction_until_bho, @@ -76,7 +76,7 @@ def get_sql(sql_lock='', file_permission=''): ) as original_name, purpose_id_cli as purpose, status_id_cli as status, - top_bedrock_bho as top_bedrock, + top_bedrock_fresh_md as top_bedrock_fresh_md, groundwater_bho as groundwater ) t ) as extended, @@ -95,7 +95,7 @@ def get_sql(sql_lock='', file_permission=''): canton_bho as canton, municipality_bho as municipality, qt_depth_id_cli as qt_depth, - qt_top_bedrock, + top_bedrock_weathered_md, lithology_top_bedrock_id_cli as lithology_top_bedrock, lithostrat_id_cli as lithostratigraphy_top_bedrock, chronostrat_id_cli AS chronostratigraphy_top_bedrock, @@ -156,7 +156,7 @@ def get_sql(sql_lock='', file_permission=''): id_fil_fk = id_fil {file_permission} - + GROUP BY id_bho_fk ) AS atc @@ -271,7 +271,7 @@ def get_sql(sql_lock='', file_permission=''): FROM bdms.stratigraphy - + LEFT JOIN bdms.layer ON layer.id_sty_fk = id_sty @@ -289,7 +289,7 @@ async def execute(self, id, with_lock = True, user=None): permission = '' file_permission = '' - + if user is not None: permission = """ @@ -297,7 +297,7 @@ async def execute(self, id, with_lock = True, user=None): """.format( self.filterPermission(user) ) - + if ( user['workgroups'] is None or len(user['workgroups']) == 0 diff --git a/src/api-legacy/v1/borehole/list.py b/src/api-legacy/v1/borehole/list.py index c724b6029..b8782d475 100644 --- a/src/api-legacy/v1/borehole/list.py +++ b/src/api-legacy/v1/borehole/list.py @@ -46,7 +46,7 @@ def get_sql_geolcode(cols=None, join=None, where=None): precision_location_x_lv03, precision_location_y_lv03, srd.geolcode as spatial_reference_system, - + qtloc.geolcode as location_precision, elevation_z_bho as elevation_z, height_reference_system.geolcode as height_reference_system, @@ -64,11 +64,11 @@ def get_sql_geolcode(cols=None, join=None, where=None): total_depth_bho as total_depth, qt_len.geolcode as qt_depth, - top_bedrock_bho as top_bedrock, - qt_tbed.geolcode as qt_top_bedrock, + top_bedrock_fresh_md as top_bedrock_fresh_md, + qt_tbed.geolcode as top_bedrock_weathered_md, groundwater_bho as groundwater, - + ids.identifiers, ids.identifiers_value, remarks_bho as remarks, @@ -93,7 +93,7 @@ def get_sql_geolcode(cols=None, join=None, where=None): ) as ids ON ids.borehole_id = id_bho - + LEFT JOIN ( SELECT borehole_id, @@ -118,7 +118,7 @@ def get_sql_geolcode(cols=None, join=None, where=None): ON rest.id_cli = restriction_id_cli LEFT JOIN bdms.codelist as knd - ON knd.id_cli = kind_id_cli + ON knd.id_cli = borehole_type_id LEFT JOIN bdms.codelist as srd ON srd.id_cli = srs_id_cli @@ -170,7 +170,7 @@ def get_sql(): ) t ) as creator, original_name_bho as original_name, - kind_id_cli as borehole_type, + borehole_type_id as borehole_type, restriction_id_cli as restriction, to_char( restriction_until_bho, @@ -195,7 +195,7 @@ def get_sql(): SELECT status_id_cli as status, purpose_id_cli as purpose, - top_bedrock_bho as top_bedrock + top_bedrock_fresh_md as top_bedrock_fresh_md ) t ) as extended, status[array_length(status, 1)] as workflow, @@ -208,7 +208,7 @@ def get_sql(): ) t ) as custom - + FROM bdms.borehole @@ -391,18 +391,18 @@ async def execute( FROM bdms.stratigraphy - + INNER JOIN bdms.layer ON id_sty_fk = id_sty {} - + {} ) as strt2 - ON + ON borehole.id_bho = strt2.id_bho_fk """.format( joins_string, where_string diff --git a/src/api-legacy/v1/borehole/patch.py b/src/api-legacy/v1/borehole/patch.py index 55bea1e1e..8104654e2 100644 --- a/src/api-legacy/v1/borehole/patch.py +++ b/src/api-legacy/v1/borehole/patch.py @@ -12,7 +12,7 @@ class PatchBorehole(Action): @staticmethod def get_column(field): column = None - + if field == 'extended.original_name': column = 'original_name_bho' @@ -24,15 +24,15 @@ def get_column(field): elif field == 'custom.project_name': column = 'project_name_bho' - + elif field == 'workgroup': column = 'id_wgp_fk' elif field in [ 'location_x', - 'location_y', - 'location_x_lv03', - 'location_y_lv03', - 'location', + 'location_y', + 'location_x_lv03', + 'location_y_lv03', + 'location', 'precision_location_x', 'precision_location_y', 'precision_location_x_lv03', @@ -43,7 +43,7 @@ def get_column(field): elif field == 'location_y': column = 'location_y_bho' - + elif field == 'location_x_lv03': column = 'location_x_lv03_bho' @@ -51,16 +51,16 @@ def get_column(field): column = 'location_y_lv03_bho' elif field == 'precision_location_x': - column = 'precision_location_x' + column = 'precision_location_x' elif field == 'precision_location_y': - column = 'precision_location_y' + column = 'precision_location_y' elif field == 'precision_location_x_lv03': - column = 'precision_location_x_lv03' + column = 'precision_location_x_lv03' elif field == 'precision_location_y_lv03': - column = 'precision_location_y_lv03' + column = 'precision_location_y_lv03' elif field == 'location': column = [ @@ -87,8 +87,8 @@ def get_column(field): elif field == 'total_depth': column = 'total_depth_bho' - elif field == 'extended.top_bedrock': - column = 'top_bedrock_bho' + elif field == 'extended.top_bedrock_fresh_md': + column = 'top_bedrock_fresh_md' elif field == 'extended.groundwater': column = 'groundwater_bho' @@ -109,7 +109,7 @@ def get_column(field): column = 'national_interest' elif field == 'borehole_type': - column = 'kind_id_cli' + column = 'borehole_type_id' elif field == 'spatial_reference_system': column = 'srs_id_cli' @@ -144,8 +144,8 @@ def get_column(field): elif field == 'depth_precision': column = 'qt_depth_id_cli' - elif field == 'custom.qt_top_bedrock': - column = 'qt_top_bedrock' + elif field == 'custom.top_bedrock_weathered_md': + column = 'top_bedrock_weathered_md' elif field == 'custom.lithology_top_bedrock': column = 'lithology_top_bedrock_id_cli' @@ -168,7 +168,7 @@ async def execute(self, id, field, value, user): try: column = PatchBorehole.get_column(field) - + # Updating character varing, numeric, boolean fields if field in [ 'visible', @@ -193,8 +193,8 @@ async def execute(self, id, field, value, user): 'drill_diameter', 'custom.drill_diameter', 'total_depth', - 'extended.top_bedrock', - 'custom.qt_top_bedrock', + 'extended.top_bedrock_fresh_md', + 'custom.top_bedrock_weathered_md', 'extended.groundwater', 'custom.mistakes', 'custom.remarks', @@ -230,7 +230,7 @@ async def execute(self, id, field, value, user): updated_by_bho = $2 WHERE id_bho = $3 """ % column, value, user['id'], id) - + if field in ['location_x', 'location_y', 'location']: geom = PatchGeom(self.conn) @@ -292,7 +292,7 @@ async def execute(self, id, field, value, user): elif field == 'reference_elevation_type': schema = 'reference_elevation_type' - + elif field == 'custom.qt_depth': schema = 'depth_precision' diff --git a/src/api-legacy/v1/borehole/profile/validate.py b/src/api-legacy/v1/borehole/profile/validate.py index 261bdf40f..0ef3daa3c 100644 --- a/src/api-legacy/v1/borehole/profile/validate.py +++ b/src/api-legacy/v1/borehole/profile/validate.py @@ -11,7 +11,7 @@ async def execute(self, profile, borehole, layers, user=None): result = {} if ( - borehole["extended"]["top_bedrock"] is not None + borehole["extended"]["top_bedrock_fresh_md"] is not None ): validators.append(ValidateGeologyLayer(borehole)) @@ -37,7 +37,7 @@ async def execute(self, profile, borehole, layers, user=None): if validator_result: result.update(validator_result) - + # Is the last layer if borehole["total_depth"] is not None and idx == len(layers) - 1: if borehole["total_depth"] and layer["depth_to"] != borehole["total_depth"]: @@ -112,8 +112,8 @@ async def execute(self, layer, borehole, layers, idx): # result["wrongDepth"] = True is_bedrock = (layer["depth_from"] == - self.borehole["extended"]["top_bedrock"]) - + self.borehole["extended"]["top_bedrock_fresh_md"]) + if is_bedrock is True: if "missingBedrock" in self.validation.keys(): diff --git a/src/api-legacy/v1/borehole/stratigraphy/layer/create.py b/src/api-legacy/v1/borehole/stratigraphy/layer/create.py index 31d8f6c83..022b039d5 100644 --- a/src/api-legacy/v1/borehole/stratigraphy/layer/create.py +++ b/src/api-legacy/v1/borehole/stratigraphy/layer/create.py @@ -37,9 +37,9 @@ async def execute(self, id, user_id): AND s.id_bho_fk = b.id_bho AND - l.depth_from_lay = b.top_bedrock_bho + l.depth_from_lay = b.top_bedrock_fresh_md AND - b.top_bedrock_bho IS NOT NULL + b.top_bedrock_fresh_md IS NOT NULL """, id) # Bedrock is not inserted @@ -57,7 +57,7 @@ async def execute(self, id, user_id): depth_to_lay DESC NULLS LAST LIMIT 1 """, id) - + # Only Bedrock is inserted and start from the surface elif cnt == 1 and bedrock[0] == 0: @@ -81,7 +81,7 @@ async def execute(self, id, user_id): AND s.id_bho_fk = b.id_bho AND - depth_to_lay <= top_bedrock_bho + depth_to_lay <= top_bedrock_fresh_md ORDER BY depth_to_lay DESC NULLS LAST LIMIT 1 @@ -113,7 +113,7 @@ async def execute(self, id, user_id): AND s.id_bho_fk = b.id_bho AND - depth_to_lay >= top_bedrock_bho + depth_to_lay >= top_bedrock_fresh_md ORDER BY depth_to_lay DESC LIMIT 1 diff --git a/src/api/BdmsContextExtensions.cs b/src/api/BdmsContextExtensions.cs index e3d24f44a..988c3e42c 100644 --- a/src/api/BdmsContextExtensions.cs +++ b/src/api/BdmsContextExtensions.cs @@ -159,8 +159,8 @@ public static void SeedData(this BdmsContext context) .RuleFor(o => o.Status, _ => default!) .RuleFor(o => o.QtDepthId, f => f.PickRandom(qtDepthIds).OrNull(f, .05f)) .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.TopBedrockFresh, f => f.Random.Double(0, 1000).OrNull(f, .05f)) + .RuleFor(o => o.TopBedrockWeathered, 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)) diff --git a/src/api/Controllers/StratigraphyController.cs b/src/api/Controllers/StratigraphyController.cs index 0de512192..e76fad874 100644 --- a/src/api/Controllers/StratigraphyController.cs +++ b/src/api/Controllers/StratigraphyController.cs @@ -217,9 +217,9 @@ public async Task> AddBedrockLayerAsync([Required] int id) return Problem("The borehole is locked by another user or you are missing permissions."); } - // Check if associated borehole has a TopBedrock value + // Check if associated borehole has a TopBedrockFresh value var borehole = await Context.Boreholes.FindAsync(stratigraphy.BoreholeId).ConfigureAwait(false); - if (!borehole.TopBedrock.HasValue) + if (!borehole.TopBedrockFresh.HasValue) { return Problem("Bedrock not yet defined."); } @@ -228,7 +228,7 @@ public async Task> AddBedrockLayerAsync([Required] int id) var bedrockLayer = new Layer { StratigraphyId = stratigraphy.Id, - FromDepth = borehole.TopBedrock.Value, + FromDepth = borehole.TopBedrockFresh.Value, LithologyTopBedrockId = borehole.LithologyTopBedrockId, LithostratigraphyId = borehole.LithostratigraphyId, IsLast = false, diff --git a/src/api/Controllers/UploadController.cs b/src/api/Controllers/UploadController.cs index 40ab5d4ec..8b15a09fb 100644 --- a/src/api/Controllers/UploadController.cs +++ b/src/api/Controllers/UploadController.cs @@ -527,8 +527,8 @@ public CsvImportBoreholeMap() Map(m => m.PurposeId).Optional(); Map(m => m.StatusId).Optional(); Map(m => m.QtDepthId).Optional(); - Map(m => m.TopBedrock).Optional(); - Map(m => m.QtTopBedrock).Optional(); + Map(m => m.TopBedrockFresh).Optional(); + Map(m => m.TopBedrockWeathered).Optional(); Map(m => m.HasGroundwater).Optional(); Map(m => m.Remarks).Optional(); Map(m => m.LithologyTopBedrockId).Optional(); diff --git a/src/api/Migrations/20240716160022_RenameAttributes.Designer.cs b/src/api/Migrations/20240716160022_RenameAttributes.Designer.cs new file mode 100644 index 000000000..ac91a047e --- /dev/null +++ b/src/api/Migrations/20240716160022_RenameAttributes.Designer.cs @@ -0,0 +1,3275 @@ +// +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("20240716160022_RenameAttributes")] + partial class RenameAttributes + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasDefaultSchema("bdms") + .HasAnnotation("ProductVersion", "8.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "ltree"); + NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "postgis"); + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("BDMS.Models.Backfill", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CasingId") + .HasColumnType("integer") + .HasColumnName("casing_id"); + + b.Property("CompletionId") + .HasColumnType("integer") + .HasColumnName("completion_id"); + + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation"); + + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("creator"); + + b.Property("FromDepth") + .HasColumnType("double precision") + .HasColumnName("from_depth"); + + b.Property("IsOpenBorehole") + .HasColumnType("boolean") + .HasColumnName("is_open_borehole"); + + b.Property("KindId") + .HasColumnType("integer") + .HasColumnName("kind_id"); + + b.Property("MaterialId") + .HasColumnType("integer") + .HasColumnName("material_id"); + + b.Property("Notes") + .HasColumnType("text") + .HasColumnName("notes"); + + b.Property("ToDepth") + .HasColumnType("double precision") + .HasColumnName("to_depth"); + + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("update"); + + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updater"); + + b.HasKey("Id"); + + b.HasIndex("CasingId"); + + b.HasIndex("CompletionId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("KindId"); + + b.HasIndex("MaterialId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("backfill", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.Borehole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_bho"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AlternateName") + .HasColumnType("text") + .HasColumnName("alternate_name_bho"); + + b.Property("Canton") + .HasColumnType("text") + .HasColumnName("canton_bho"); + + b.Property("ChronostratigraphyId") + .HasColumnType("integer") + .HasColumnName("chronostrat_id_cli"); + + b.Property("Country") + .HasColumnType("text") + .HasColumnName("country_bho"); + + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("created_bho"); + + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("created_by_bho"); + + b.Property("ElevationPrecisionId") + .HasColumnType("integer") + .HasColumnName("qt_elevation_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("IsPublic") + .HasColumnType("boolean") + .HasColumnName("public_bho"); + + b.Property("LithologyTopBedrockId") + .HasColumnType("integer") + .HasColumnName("lithology_top_bedrock_id_cli"); + + b.Property("LithostratigraphyId") + .HasColumnType("integer") + .HasColumnName("lithostrat_id_cli"); + + b.Property("LocationPrecisionId") + .HasColumnType("integer") + .HasColumnName("qt_location_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("PrecisionLocationX") + .HasColumnType("integer") + .HasColumnName("precision_location_x"); + + b.Property("PrecisionLocationXLV03") + .HasColumnType("integer") + .HasColumnName("precision_location_x_lv03"); + + b.Property("PrecisionLocationY") + .HasColumnType("integer") + .HasColumnName("precision_location_y"); + + b.Property("PrecisionLocationYLV03") + .HasColumnType("integer") + .HasColumnName("precision_location_y_lv03"); + + 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("QtReferenceElevationId") + .HasColumnType("integer") + .HasColumnName("qt_reference_elevation_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("StatusId") + .HasColumnType("integer") + .HasColumnName("status_id_cli"); + + b.Property("TopBedrockFresh") + .HasColumnType("double precision") + .HasColumnName("top_bedrock_fresh_md"); + + b.Property("TopBedrockWeathered") + .HasColumnType("double precision") + .HasColumnName("top_bedrock_weathered_md"); + + b.Property("TotalDepth") + .HasColumnType("double precision") + .HasColumnName("total_depth_bho"); + + b.Property("TypeId") + .HasColumnType("integer") + .HasColumnName("borehole_type_id"); + + 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("ElevationPrecisionId"); + + b.HasIndex("HrsId"); + + b.HasIndex("LithologyTopBedrockId"); + + b.HasIndex("LithostratigraphyId"); + + b.HasIndex("LocationPrecisionId"); + + b.HasIndex("LockedById"); + + b.HasIndex("PurposeId"); + + b.HasIndex("QtDepthId"); + + b.HasIndex("QtReferenceElevationId"); + + b.HasIndex("ReferenceElevationTypeId"); + + b.HasIndex("RestrictionId"); + + b.HasIndex("StatusId"); + + b.HasIndex("TypeId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("WorkgroupId"); + + b.ToTable("borehole", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.BoreholeCodelist", b => + { + b.Property("BoreholeId") + .HasColumnType("integer") + .HasColumnName("borehole_id"); + + b.Property("CodelistId") + .HasColumnType("integer") + .HasColumnName("identifier_id"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text") + .HasColumnName("identifier_value"); + + b.HasKey("BoreholeId", "CodelistId"); + + b.HasIndex("CodelistId"); + + b.ToTable("borehole_identifiers_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.BoreholeGeometryElement", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BoreholeId") + .HasColumnType("integer") + .HasColumnName("borehole_id"); + + b.Property("DEVI") + .HasColumnType("double precision"); + + b.Property("HAZI") + .HasColumnType("double precision"); + + b.Property("MD") + .HasColumnType("double precision"); + + b.Property("X") + .HasColumnType("double precision"); + + b.Property("Y") + .HasColumnType("double precision"); + + b.Property("Z") + .HasColumnType("double precision"); + + b.HasKey("Id"); + + b.HasIndex("BoreholeId"); + + b.ToTable("borehole_geometry", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.Casing", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CompletionId") + .HasColumnType("integer") + .HasColumnName("completion_id"); + + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation"); + + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("creator"); + + b.Property("DateFinish") + .HasColumnType("date") + .HasColumnName("date_finish"); + + b.Property("DateStart") + .HasColumnType("date") + .HasColumnName("date_start"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name"); + + b.Property("Notes") + .HasColumnType("text") + .HasColumnName("notes"); + + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("update"); + + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updater"); + + b.HasKey("Id"); + + b.HasIndex("CompletionId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("UpdatedById"); + + b.ToTable("casing", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.CasingElement", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CasingId") + .HasColumnType("integer") + .HasColumnName("casing_id"); + + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation"); + + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("creator"); + + b.Property("FromDepth") + .HasColumnType("double precision") + .HasColumnName("from_depth"); + + b.Property("InnerDiameter") + .HasColumnType("double precision") + .HasColumnName("inner_diameter"); + + b.Property("KindId") + .HasColumnType("integer") + .HasColumnName("kind_id"); + + b.Property("MaterialId") + .HasColumnType("integer") + .HasColumnName("material_id"); + + b.Property("OuterDiameter") + .HasColumnType("double precision") + .HasColumnName("outer_diameter"); + + b.Property("ToDepth") + .HasColumnType("double precision") + .HasColumnName("to_depth"); + + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("update"); + + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updater"); + + b.HasKey("Id"); + + b.HasIndex("CasingId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("KindId"); + + b.HasIndex("MaterialId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("casing_element", "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("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("En") + .IsRequired() + .HasColumnType("text") + .HasColumnName("text_cli_en"); + + b.Property("Fr") + .HasColumnType("text") + .HasColumnName("text_cli_fr"); + + b.Property("Geolcode") + .HasColumnType("integer") + .HasColumnName("geolcode"); + + b.Property("IsDefault") + .HasColumnType("boolean") + .HasColumnName("default_cli"); + + b.Property("It") + .HasColumnType("text") + .HasColumnName("text_cli_it"); + + b.Property("Order") + .HasColumnType("integer") + .HasColumnName("order_cli"); + + b.Property("Path") + .HasColumnType("ltree") + .HasColumnName("path_cli"); + + b.Property("Ro") + .HasColumnType("text") + .HasColumnName("text_cli_ro"); + + b.Property("Schema") + .HasColumnType("text") + .HasColumnName("schema_cli"); + + b.HasKey("Id"); + + b.ToTable("codelist", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.Completion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AbandonDate") + .HasColumnType("date") + .HasColumnName("abandon_date"); + + b.Property("BoreholeId") + .HasColumnType("integer") + .HasColumnName("borehole_id"); + + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation"); + + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("creator"); + + b.Property("IsPrimary") + .HasColumnType("boolean") + .HasColumnName("is_primary"); + + b.Property("KindId") + .HasColumnType("integer") + .HasColumnName("kind_id"); + + b.Property("Name") + .HasColumnType("text") + .HasColumnName("name"); + + b.Property("Notes") + .HasColumnType("text") + .HasColumnName("notes"); + + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("update"); + + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updater"); + + b.HasKey("Id"); + + b.HasIndex("BoreholeId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("KindId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("completion", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.Config", b => + { + b.Property("Name") + .HasColumnType("text") + .HasColumnName("name_cfg"); + + b.Property("Value") + .HasColumnType("text") + .HasColumnName("value_cfg"); + + b.HasKey("Name"); + + b.ToTable("config", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.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("DescriptionQualityId") + .HasColumnType("integer") + .HasColumnName("qt_description_id"); + + b.Property("FromDepth") + .HasColumnType("double precision") + .HasColumnName("depth_from"); + + 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("DescriptionQualityId"); + + b.HasIndex("StratigraphyId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("facies_description", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.FieldMeasurementResult", 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("FieldMeasurementId") + .HasColumnType("integer") + .HasColumnName("fieldmeasurement_id"); + + b.Property("ParameterId") + .HasColumnType("integer") + .HasColumnName("parameter"); + + b.Property("SampleTypeId") + .HasColumnType("integer") + .HasColumnName("sample_type"); + + 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("FieldMeasurementId"); + + b.HasIndex("ParameterId"); + + b.HasIndex("SampleTypeId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("fieldmeasurement_result", "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.HydrotestEvaluationMethodCode", b => + { + b.Property("HydrotestId") + .HasColumnType("integer") + .HasColumnName("hydrotest_id"); + + b.Property("CodelistId") + .HasColumnType("integer") + .HasColumnName("codelist_id"); + + b.HasKey("HydrotestId", "CodelistId"); + + b.HasIndex("CodelistId"); + + b.ToTable("hydrotest_evaluationmethod_codelist", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.HydrotestFlowDirectionCode", b => + { + b.Property("HydrotestId") + .HasColumnType("integer") + .HasColumnName("hydrotest_id"); + + b.Property("CodelistId") + .HasColumnType("integer") + .HasColumnName("codelist_id"); + + b.HasKey("HydrotestId", "CodelistId"); + + b.HasIndex("CodelistId"); + + b.ToTable("hydrotest_flowdirection_codelist", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.HydrotestKindCode", b => + { + b.Property("HydrotestId") + .HasColumnType("integer") + .HasColumnName("hydrotest_id"); + + b.Property("CodelistId") + .HasColumnType("integer") + .HasColumnName("codelist_id"); + + b.HasKey("HydrotestId", "CodelistId"); + + b.HasIndex("CodelistId"); + + b.ToTable("hydrotest_kind_codelist", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.HydrotestResult", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation"); + + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("creator"); + + b.Property("HydrotestId") + .HasColumnType("integer") + .HasColumnName("hydrotest_id"); + + b.Property("MaxValue") + .HasColumnType("double precision") + .HasColumnName("max_value"); + + b.Property("MinValue") + .HasColumnType("double precision") + .HasColumnName("min_value"); + + b.Property("ParameterId") + .HasColumnType("integer") + .HasColumnName("parameter"); + + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("update"); + + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updater"); + + b.Property("Value") + .HasColumnType("double precision") + .HasColumnName("value"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("HydrotestId"); + + b.HasIndex("ParameterId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("hydrotest_result", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.Instrumentation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CasingId") + .HasColumnType("integer") + .HasColumnName("casing_id"); + + b.Property("CompletionId") + .HasColumnType("integer") + .HasColumnName("completion_id"); + + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation"); + + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("creator"); + + b.Property("FromDepth") + .HasColumnType("double precision") + .HasColumnName("from_depth"); + + b.Property("IsOpenBorehole") + .HasColumnType("boolean") + .HasColumnName("is_open_borehole"); + + b.Property("KindId") + .HasColumnType("integer") + .HasColumnName("kind_id"); + + b.Property("Name") + .HasColumnType("text") + .HasColumnName("name"); + + b.Property("Notes") + .HasColumnType("text") + .HasColumnName("notes"); + + b.Property("StatusId") + .HasColumnType("integer") + .HasColumnName("status_id"); + + b.Property("ToDepth") + .HasColumnType("double precision") + .HasColumnName("to_depth"); + + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("update"); + + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updater"); + + b.HasKey("Id"); + + b.HasIndex("CasingId"); + + b.HasIndex("CompletionId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("KindId"); + + b.HasIndex("StatusId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("instrumentation", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.Layer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id_lay"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AlterationId") + .HasColumnType("integer") + .HasColumnName("alteration_id_cli"); + + b.Property("CohesionId") + .HasColumnType("integer") + .HasColumnName("cohesion_id_cli"); + + b.Property("CompactnessId") + .HasColumnType("integer") + .HasColumnName("compactness_id_cli"); + + b.Property("ConsistanceId") + .HasColumnType("integer") + .HasColumnName("consistance_id_cli"); + + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation_lay"); + + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("creator_lay"); + + b.Property("DescriptionQualityId") + .HasColumnType("integer") + .HasColumnName("qt_description_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("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("StratigraphyId") + .HasColumnType("integer") + .HasColumnName("id_sty_fk"); + + b.Property("ToDepth") + .HasColumnType("double precision") + .HasColumnName("depth_to_lay"); + + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("update_lay"); + + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updater_lay"); + + b.Property("Uscs1Id") + .HasColumnType("integer") + .HasColumnName("uscs_1_id_cli"); + + b.Property("Uscs2Id") + .HasColumnType("integer") + .HasColumnName("uscs_2_id_cli"); + + b.Property("UscsDeterminationId") + .HasColumnType("integer") + .HasColumnName("uscs_determination_id_cli"); + + b.HasKey("Id"); + + b.HasIndex("AlterationId"); + + b.HasIndex("CohesionId"); + + b.HasIndex("CompactnessId"); + + b.HasIndex("ConsistanceId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("DescriptionQualityId"); + + b.HasIndex("GradationId"); + + b.HasIndex("GrainSize1Id"); + + b.HasIndex("GrainSize2Id"); + + b.HasIndex("HumidityId"); + + b.HasIndex("LithologyId"); + + b.HasIndex("LithologyTopBedrockId"); + + b.HasIndex("LithostratigraphyId"); + + b.HasIndex("PlasticityId"); + + b.HasIndex("StratigraphyId"); + + b.HasIndex("UpdatedById"); + + b.HasIndex("Uscs1Id"); + + b.HasIndex("Uscs2Id"); + + b.HasIndex("UscsDeterminationId"); + + b.ToTable("layer", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.LayerColorCode", b => + { + b.Property("LayerId") + .HasColumnType("integer") + .HasColumnName("layer_id"); + + b.Property("CodelistId") + .HasColumnType("integer") + .HasColumnName("color_id"); + + b.HasKey("LayerId", "CodelistId"); + + b.HasIndex("CodelistId"); + + b.ToTable("layer_color_codelist", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.LayerDebrisCode", b => + { + b.Property("LayerId") + .HasColumnType("integer") + .HasColumnName("layer_id"); + + b.Property("CodelistId") + .HasColumnType("integer") + .HasColumnName("debris_id"); + + b.HasKey("LayerId", "CodelistId"); + + b.HasIndex("CodelistId"); + + b.ToTable("layer_debris_codelist", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.LayerGrainAngularityCode", b => + { + b.Property("LayerId") + .HasColumnType("integer") + .HasColumnName("layer_id"); + + b.Property("CodelistId") + .HasColumnType("integer") + .HasColumnName("grain_angularity_id"); + + b.HasKey("LayerId", "CodelistId"); + + b.HasIndex("CodelistId"); + + b.ToTable("layer_grain_angularity_codelist", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.LayerGrainShapeCode", b => + { + b.Property("LayerId") + .HasColumnType("integer") + .HasColumnName("layer_id"); + + b.Property("CodelistId") + .HasColumnType("integer") + .HasColumnName("grain_shape_id"); + + b.HasKey("LayerId", "CodelistId"); + + b.HasIndex("CodelistId"); + + b.ToTable("layer_grain_shape_codelist", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.LayerOrganicComponentCode", b => + { + b.Property("LayerId") + .HasColumnType("integer") + .HasColumnName("layer_id"); + + b.Property("CodelistId") + .HasColumnType("integer") + .HasColumnName("organic_components_id"); + + b.HasKey("LayerId", "CodelistId"); + + b.HasIndex("CodelistId"); + + b.ToTable("layer_organic_component_codelist", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.LayerUscs3Code", b => + { + b.Property("LayerId") + .HasColumnType("integer") + .HasColumnName("layer_id"); + + b.Property("CodelistId") + .HasColumnType("integer") + .HasColumnName("uscs3_id"); + + b.HasKey("LayerId", "CodelistId"); + + b.HasIndex("CodelistId"); + + b.ToTable("layer_uscs3_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("DescriptionQualityId") + .HasColumnType("integer") + .HasColumnName("qt_description_id"); + + b.Property("FromDepth") + .HasColumnType("double precision") + .HasColumnName("depth_from"); + + 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("DescriptionQualityId"); + + 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("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_id"); + + b.Property("Comment") + .HasColumnType("text") + .HasColumnName("comment"); + + 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("IsOpenBorehole") + .HasColumnType("boolean") + .HasColumnName("is_open_borehole"); + + 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.Section", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BoreholeId") + .HasColumnType("integer") + .HasColumnName("borehole_id"); + + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("creation"); + + b.Property("CreatedById") + .HasColumnType("integer") + .HasColumnName("creator"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text") + .HasColumnName("name"); + + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("update"); + + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updater"); + + b.HasKey("Id"); + + b.HasIndex("BoreholeId"); + + b.HasIndex("CreatedById"); + + b.HasIndex("UpdatedById"); + + b.ToTable("section", "bdms"); + }); + + modelBuilder.Entity("BDMS.Models.SectionElement", 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("CuttingsId") + .HasColumnType("integer") + .HasColumnName("cuttings_id"); + + b.Property("DrillingCoreDiameter") + .HasColumnType("double precision") + .HasColumnName("drilling_core_diameter"); + + b.Property("DrillingDiameter") + .HasColumnType("double precision") + .HasColumnName("drilling_diameter"); + + b.Property("DrillingEndDate") + .HasColumnType("date") + .HasColumnName("drilling_end_date"); + + b.Property("DrillingMethodId") + .HasColumnType("integer") + .HasColumnName("drilling_method_id"); + + b.Property("DrillingMudSubtypeId") + .HasColumnType("integer") + .HasColumnName("mud_subtype_id"); + + b.Property("DrillingMudTypeId") + .HasColumnType("integer") + .HasColumnName("mud_type_id"); + + b.Property("DrillingStartDate") + .HasColumnType("date") + .HasColumnName("drilling_start_date"); + + b.Property("FromDepth") + .HasColumnType("double precision") + .HasColumnName("from_depth"); + + b.Property("Order") + .HasColumnType("integer") + .HasColumnName("order"); + + b.Property("SectionId") + .HasColumnType("integer") + .HasColumnName("section_id"); + + b.Property("ToDepth") + .HasColumnType("double precision") + .HasColumnName("to_depth"); + + b.Property("Updated") + .HasColumnType("timestamp with time zone") + .HasColumnName("update"); + + b.Property("UpdatedById") + .HasColumnType("integer") + .HasColumnName("updater"); + + b.HasKey("Id"); + + b.HasIndex("CreatedById"); + + b.HasIndex("CuttingsId"); + + b.HasIndex("DrillingMethodId"); + + b.HasIndex("DrillingMudSubtypeId"); + + b.HasIndex("DrillingMudTypeId"); + + b.HasIndex("SectionId"); + + b.HasIndex("UpdatedById"); + + b.ToTable("section_element", "bdms"); + }); + + 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("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("IsPrimary") + .HasColumnType("boolean") + .HasColumnName("primary_sty"); + + b.Property("Name") + .HasColumnType("text") + .HasColumnName("name_sty"); + + b.Property("Notes") + .HasColumnType("text") + .HasColumnName("notes_sty"); + + b.Property("QualityId") + .HasColumnType("integer") + .HasColumnName("quality_id"); + + 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("QualityId"); + + 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.Property("SubjectId") + .IsRequired() + .HasColumnType("text") + .HasColumnName("subject_id"); + + 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.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.Backfill", b => + { + b.HasOne("BDMS.Models.Casing", "Casing") + .WithMany("Backfills") + .HasForeignKey("CasingId"); + + b.HasOne("BDMS.Models.Completion", "Completion") + .WithMany("Backfills") + .HasForeignKey("CompletionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.Codelist", "Kind") + .WithMany() + .HasForeignKey("KindId"); + + b.HasOne("BDMS.Models.Codelist", "Material") + .WithMany() + .HasForeignKey("MaterialId"); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("Casing"); + + b.Navigation("Completion"); + + b.Navigation("CreatedBy"); + + b.Navigation("Kind"); + + b.Navigation("Material"); + + b.Navigation("UpdatedBy"); + }); + + 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", "ElevationPrecision") + .WithMany() + .HasForeignKey("ElevationPrecisionId"); + + b.HasOne("BDMS.Models.Codelist", "Hrs") + .WithMany() + .HasForeignKey("HrsId"); + + b.HasOne("BDMS.Models.Codelist", "LithologyTopBedrock") + .WithMany() + .HasForeignKey("LithologyTopBedrockId"); + + b.HasOne("BDMS.Models.Codelist", "Lithostratigraphy") + .WithMany() + .HasForeignKey("LithostratigraphyId"); + + b.HasOne("BDMS.Models.Codelist", "LocationPrecision") + .WithMany() + .HasForeignKey("LocationPrecisionId"); + + 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", "QtReferenceElevation") + .WithMany() + .HasForeignKey("QtReferenceElevationId"); + + 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.Codelist", "Type") + .WithMany() + .HasForeignKey("TypeId"); + + 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("ElevationPrecision"); + + b.Navigation("Hrs"); + + b.Navigation("LithologyTopBedrock"); + + b.Navigation("Lithostratigraphy"); + + b.Navigation("LocationPrecision"); + + b.Navigation("LockedBy"); + + b.Navigation("Purpose"); + + b.Navigation("QtDepth"); + + b.Navigation("QtReferenceElevation"); + + b.Navigation("ReferenceElevationType"); + + b.Navigation("Restriction"); + + b.Navigation("Status"); + + b.Navigation("Type"); + + 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.BoreholeGeometryElement", b => + { + b.HasOne("BDMS.Models.Borehole", "Borehole") + .WithMany("BoreholeGeometry") + .HasForeignKey("BoreholeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Borehole"); + }); + + modelBuilder.Entity("BDMS.Models.Casing", b => + { + b.HasOne("BDMS.Models.Completion", "Completion") + .WithMany("Casings") + .HasForeignKey("CompletionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("Completion"); + + b.Navigation("CreatedBy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("BDMS.Models.CasingElement", b => + { + b.HasOne("BDMS.Models.Casing", "Casing") + .WithMany("CasingElements") + .HasForeignKey("CasingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.Codelist", "Kind") + .WithMany() + .HasForeignKey("KindId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("BDMS.Models.Codelist", "Material") + .WithMany() + .HasForeignKey("MaterialId"); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("Casing"); + + b.Navigation("CreatedBy"); + + b.Navigation("Kind"); + + b.Navigation("Material"); + + b.Navigation("UpdatedBy"); + }); + + 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.Completion", b => + { + b.HasOne("BDMS.Models.Borehole", "Borehole") + .WithMany("Completions") + .HasForeignKey("BoreholeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.Codelist", "Kind") + .WithMany() + .HasForeignKey("KindId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("Borehole"); + + b.Navigation("CreatedBy"); + + b.Navigation("Kind"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("BDMS.Models.FaciesDescription", b => + { + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.Codelist", "DescriptionQuality") + .WithMany() + .HasForeignKey("DescriptionQualityId"); + + 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("DescriptionQuality"); + + b.Navigation("Stratigraphy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("BDMS.Models.FieldMeasurementResult", b => + { + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.FieldMeasurement", "FieldMeasurement") + .WithMany("FieldMeasurementResults") + .HasForeignKey("FieldMeasurementId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Codelist", "Parameter") + .WithMany() + .HasForeignKey("ParameterId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("BDMS.Models.Codelist", "SampleType") + .WithMany() + .HasForeignKey("SampleTypeId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("CreatedBy"); + + b.Navigation("FieldMeasurement"); + + b.Navigation("Parameter"); + + b.Navigation("SampleType"); + + 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.HydrotestEvaluationMethodCode", b => + { + b.HasOne("BDMS.Models.Codelist", "Codelist") + .WithMany("HydrotestEvaluationMethodCodes") + .HasForeignKey("CodelistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Hydrotest", "Hydrotest") + .WithMany("HydrotestEvaluationMethodCodes") + .HasForeignKey("HydrotestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Codelist"); + + b.Navigation("Hydrotest"); + }); + + modelBuilder.Entity("BDMS.Models.HydrotestFlowDirectionCode", b => + { + b.HasOne("BDMS.Models.Codelist", "Codelist") + .WithMany("HydrotestFlowDirectionCodes") + .HasForeignKey("CodelistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Hydrotest", "Hydrotest") + .WithMany("HydrotestFlowDirectionCodes") + .HasForeignKey("HydrotestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Codelist"); + + b.Navigation("Hydrotest"); + }); + + modelBuilder.Entity("BDMS.Models.HydrotestKindCode", b => + { + b.HasOne("BDMS.Models.Codelist", "Codelist") + .WithMany("HydrotestKindCodes") + .HasForeignKey("CodelistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Hydrotest", "Hydrotest") + .WithMany("HydrotestKindCodes") + .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.NoAction) + .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.Instrumentation", b => + { + b.HasOne("BDMS.Models.Casing", "Casing") + .WithMany("Instrumentations") + .HasForeignKey("CasingId"); + + b.HasOne("BDMS.Models.Completion", "Completion") + .WithMany("Instrumentations") + .HasForeignKey("CompletionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.Codelist", "Kind") + .WithMany() + .HasForeignKey("KindId"); + + b.HasOne("BDMS.Models.Codelist", "Status") + .WithMany() + .HasForeignKey("StatusId"); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("Casing"); + + b.Navigation("Completion"); + + b.Navigation("CreatedBy"); + + b.Navigation("Kind"); + + b.Navigation("Status"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("BDMS.Models.Layer", b => + { + b.HasOne("BDMS.Models.Codelist", "Alteration") + .WithMany() + .HasForeignKey("AlterationId"); + + 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", "DescriptionQuality") + .WithMany() + .HasForeignKey("DescriptionQualityId"); + + 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.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.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("Cohesion"); + + b.Navigation("Compactness"); + + b.Navigation("Consistance"); + + b.Navigation("CreatedBy"); + + b.Navigation("DescriptionQuality"); + + b.Navigation("Gradation"); + + b.Navigation("GrainSize1"); + + b.Navigation("GrainSize2"); + + b.Navigation("Humidity"); + + b.Navigation("Lithology"); + + b.Navigation("LithologyTopBedrock"); + + b.Navigation("Lithostratigraphy"); + + b.Navigation("Plasticity"); + + b.Navigation("Stratigraphy"); + + b.Navigation("UpdatedBy"); + + b.Navigation("Uscs1"); + + b.Navigation("Uscs2"); + + b.Navigation("UscsDetermination"); + }); + + modelBuilder.Entity("BDMS.Models.LayerColorCode", b => + { + b.HasOne("BDMS.Models.Codelist", "Codelist") + .WithMany("LayerColorCodes") + .HasForeignKey("CodelistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Layer", "Layer") + .WithMany("LayerColorCodes") + .HasForeignKey("LayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Codelist"); + + b.Navigation("Layer"); + }); + + modelBuilder.Entity("BDMS.Models.LayerDebrisCode", b => + { + b.HasOne("BDMS.Models.Codelist", "Codelist") + .WithMany("LayerDebrisCodes") + .HasForeignKey("CodelistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Layer", "Layer") + .WithMany("LayerDebrisCodes") + .HasForeignKey("LayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Codelist"); + + b.Navigation("Layer"); + }); + + modelBuilder.Entity("BDMS.Models.LayerGrainAngularityCode", b => + { + b.HasOne("BDMS.Models.Codelist", "Codelist") + .WithMany("LayerGrainAngularityCodes") + .HasForeignKey("CodelistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Layer", "Layer") + .WithMany("LayerGrainAngularityCodes") + .HasForeignKey("LayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Codelist"); + + b.Navigation("Layer"); + }); + + modelBuilder.Entity("BDMS.Models.LayerGrainShapeCode", b => + { + b.HasOne("BDMS.Models.Codelist", "Codelist") + .WithMany("LayerGrainShapeCodes") + .HasForeignKey("CodelistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Layer", "Layer") + .WithMany("LayerGrainShapeCodes") + .HasForeignKey("LayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Codelist"); + + b.Navigation("Layer"); + }); + + modelBuilder.Entity("BDMS.Models.LayerOrganicComponentCode", b => + { + b.HasOne("BDMS.Models.Codelist", "Codelist") + .WithMany("LayerOrganicComponentCodes") + .HasForeignKey("CodelistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Layer", "Layer") + .WithMany("LayerOrganicComponentCodes") + .HasForeignKey("LayerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Codelist"); + + b.Navigation("Layer"); + }); + + modelBuilder.Entity("BDMS.Models.LayerUscs3Code", b => + { + b.HasOne("BDMS.Models.Codelist", "Codelist") + .WithMany("LayerUscs3Codes") + .HasForeignKey("CodelistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Layer", "Layer") + .WithMany("LayerUscs3Codes") + .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", "DescriptionQuality") + .WithMany() + .HasForeignKey("DescriptionQualityId"); + + 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("DescriptionQuality"); + + 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("Observations") + .HasForeignKey("BoreholeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.Casing", "Casing") + .WithMany("Observations") + .HasForeignKey("CasingId"); + + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.Codelist", "Reliability") + .WithMany() + .HasForeignKey("ReliabilityId") + .OnDelete(DeleteBehavior.NoAction) + .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.Section", b => + { + b.HasOne("BDMS.Models.Borehole", "Borehole") + .WithMany("Sections") + .HasForeignKey("BoreholeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "CreatedBy") + .WithMany() + .HasForeignKey("CreatedById"); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("Borehole"); + + b.Navigation("CreatedBy"); + + b.Navigation("UpdatedBy"); + }); + + modelBuilder.Entity("BDMS.Models.SectionElement", b => + { + 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", "DrillingMudSubtype") + .WithMany() + .HasForeignKey("DrillingMudSubtypeId"); + + b.HasOne("BDMS.Models.Codelist", "DrillingMudType") + .WithMany() + .HasForeignKey("DrillingMudTypeId"); + + b.HasOne("BDMS.Models.Section", "Section") + .WithMany("SectionElements") + .HasForeignKey("SectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("CreatedBy"); + + b.Navigation("Cuttings"); + + b.Navigation("DrillingMethod"); + + b.Navigation("DrillingMudSubtype"); + + b.Navigation("DrillingMudType"); + + b.Navigation("Section"); + + 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.Codelist", "Quality") + .WithMany() + .HasForeignKey("QualityId"); + + b.HasOne("BDMS.Models.User", "UpdatedBy") + .WithMany() + .HasForeignKey("UpdatedById"); + + b.Navigation("Borehole"); + + b.Navigation("CreatedBy"); + + b.Navigation("Quality"); + + 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(); + }); + + 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.NoAction) + .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.NoAction) + .IsRequired(); + + b.Navigation("Conditions"); + + b.Navigation("Quantity"); + }); + + modelBuilder.Entity("BDMS.Models.Borehole", b => + { + b.Navigation("BoreholeCodelists"); + + b.Navigation("BoreholeFiles"); + + b.Navigation("BoreholeGeometry"); + + b.Navigation("Completions"); + + b.Navigation("Observations"); + + b.Navigation("Sections"); + + b.Navigation("Stratigraphies"); + + b.Navigation("Workflows"); + }); + + modelBuilder.Entity("BDMS.Models.Casing", b => + { + b.Navigation("Backfills"); + + b.Navigation("CasingElements"); + + b.Navigation("Instrumentations"); + + b.Navigation("Observations"); + }); + + modelBuilder.Entity("BDMS.Models.Codelist", b => + { + b.Navigation("BoreholeCodelists"); + + b.Navigation("HydrotestEvaluationMethodCodes"); + + b.Navigation("HydrotestFlowDirectionCodes"); + + b.Navigation("HydrotestKindCodes"); + + b.Navigation("LayerColorCodes"); + + b.Navigation("LayerDebrisCodes"); + + b.Navigation("LayerGrainAngularityCodes"); + + b.Navigation("LayerGrainShapeCodes"); + + b.Navigation("LayerOrganicComponentCodes"); + + b.Navigation("LayerUscs3Codes"); + }); + + modelBuilder.Entity("BDMS.Models.Completion", b => + { + b.Navigation("Backfills"); + + b.Navigation("Casings"); + + b.Navigation("Instrumentations"); + }); + + modelBuilder.Entity("BDMS.Models.File", b => + { + b.Navigation("BoreholeFiles"); + }); + + modelBuilder.Entity("BDMS.Models.Layer", b => + { + b.Navigation("LayerColorCodes"); + + b.Navigation("LayerDebrisCodes"); + + b.Navigation("LayerGrainAngularityCodes"); + + b.Navigation("LayerGrainShapeCodes"); + + b.Navigation("LayerOrganicComponentCodes"); + + b.Navigation("LayerUscs3Codes"); + }); + + modelBuilder.Entity("BDMS.Models.Section", b => + { + b.Navigation("SectionElements"); + }); + + 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.FieldMeasurement", b => + { + b.Navigation("FieldMeasurementResults"); + }); + + modelBuilder.Entity("BDMS.Models.Hydrotest", b => + { + b.Navigation("HydrotestEvaluationMethodCodes"); + + b.Navigation("HydrotestFlowDirectionCodes"); + + b.Navigation("HydrotestKindCodes"); + + b.Navigation("HydrotestResults"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/api/Migrations/20240716160022_RenameAttributes.cs b/src/api/Migrations/20240716160022_RenameAttributes.cs new file mode 100644 index 000000000..cf6b788eb --- /dev/null +++ b/src/api/Migrations/20240716160022_RenameAttributes.cs @@ -0,0 +1,54 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BDMS.Migrations; +#pragma warning disable CA1505 + +/// +public partial class RenameAttributes : Migration +{ + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "borehole_kind_id_cli_fkey", + schema: "bdms", + table: "borehole"); + + migrationBuilder.RenameColumn( + name: "kind_id_cli", + schema: "bdms", + table: "borehole", + newName: "borehole_type_id"); + + migrationBuilder.RenameColumn( + name: "top_bedrock_bho", + schema: "bdms", + table: "borehole", + newName: "top_bedrock_weathered_md"); + + migrationBuilder.RenameColumn( + name: "qt_top_bedrock", + schema: "bdms", + table: "borehole", + newName: "top_bedrock_fresh_md"); + + migrationBuilder.RenameIndex( + name: "IX_borehole_kind_id_cli_fkey", + schema: "bdms", + table: "borehole", + newName: "IX_borehole_borehole_type_id_fkey"); + + migrationBuilder.AddForeignKey( + name: "borehole_borehole_type_id_fkey", + schema: "bdms", + table: "borehole", + column: "borehole_type_id", + principalSchema: "bdms", + principalTable: "codelist", + principalColumn: "id_cli"); + } +} + +#pragma warning restore CA1505 diff --git a/src/api/Migrations/BdmsContextModelSnapshot.cs b/src/api/Migrations/BdmsContextModelSnapshot.cs index 51b78a0a1..f8c4e6ae3 100644 --- a/src/api/Migrations/BdmsContextModelSnapshot.cs +++ b/src/api/Migrations/BdmsContextModelSnapshot.cs @@ -241,10 +241,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("integer") .HasColumnName("qt_reference_elevation_id_cli"); - b.Property("QtTopBedrock") - .HasColumnType("double precision") - .HasColumnName("qt_top_bedrock"); - b.Property("ReferenceElevation") .HasColumnType("double precision") .HasColumnName("reference_elevation_bho"); @@ -269,9 +265,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("integer") .HasColumnName("status_id_cli"); - b.Property("TopBedrock") + b.Property("TopBedrockFresh") + .HasColumnType("double precision") + .HasColumnName("top_bedrock_fresh_md"); + + b.Property("TopBedrockWeathered") .HasColumnType("double precision") - .HasColumnName("top_bedrock_bho"); + .HasColumnName("top_bedrock_weathered_md"); b.Property("TotalDepth") .HasColumnType("double precision") @@ -279,7 +279,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("TypeId") .HasColumnType("integer") - .HasColumnName("kind_id_cli"); + .HasColumnName("borehole_type_id"); b.Property("Updated") .HasColumnType("timestamp with time zone") diff --git a/src/api/Models/Borehole.cs b/src/api/Models/Borehole.cs index 48d5fd12a..43a0027be 100644 --- a/src/api/Models/Borehole.cs +++ b/src/api/Models/Borehole.cs @@ -73,7 +73,7 @@ public class Borehole : IChangeTracking, IIdentifyable /// /// Gets or sets the 's type id. /// - [Column("kind_id_cli")] + [Column("borehole_type_id")] public int? TypeId { get; set; } /// @@ -264,14 +264,14 @@ public class Borehole : IChangeTracking, IIdentifyable /// /// Gets or sets the 's top bedrock. /// - [Column("top_bedrock_bho")] - public double? TopBedrock { get; set; } + [Column("top_bedrock_fresh_md")] + public double? TopBedrockFresh { get; set; } /// - /// Gets or sets the 's QtTopBedrock id. + /// Gets or sets the 's weathered top bedrock. /// - [Column("qt_top_bedrock")] - public double? QtTopBedrock { get; set; } + [Column("top_bedrock_weathered_md")] + public double? TopBedrockWeathered { get; set; } /// /// Gets or sets whether the has groundwater. diff --git a/src/client/docs/import.md b/src/client/docs/import.md index 6786841d2..d966dfb9a 100644 --- a/src/client/docs/import.md +++ b/src/client/docs/import.md @@ -86,8 +86,8 @@ Die zu importierenden Daten müssen gemäss obigen Anforderungen im CSV-Format v | remarks | Text | Nein | Bemerkungen | | total_depth | Dezimalzahl | Nein | Bohrlochlänge [m MD] | | qt_depth_id | ID (Codeliste) | Nein | +/- Bohrlochlänge [m MD] | -| top_bedrock | Dezimalzahl | Nein | Top Fels (frisch) [m MD] | -| qt_top_bedrock | Dezimalzahl | Nein | Top Fels (verwittert) [m MD] | +| top_bedrock_fresh_md | Dezimalzahl | Nein | Top Fels (frisch) [m MD] | +| top_bedrock_weathered_md | Dezimalzahl | Nein | Top Fels (verwittert) [m MD] | | has_groundwater | True/False | Nein | Grundwasser | | lithology_top_bedrock_id | ID (Codeliste) | Nein | Lithologie Top Fels | | chronostratigraphy_id | ID (Codeliste) | Nein | Chronostratigraphie Top Fels | diff --git a/src/client/public/locale/de/common.json b/src/client/public/locale/de/common.json index 4cfa60914..247a53479 100644 --- a/src/client/public/locale/de/common.json +++ b/src/client/public/locale/de/common.json @@ -343,11 +343,6 @@ "publish": "Veröffentlichen", "purpose": "Bohrzweck", "qt_depth": "+/- Bohrlochlänge [m MD]", - "qt_top_bedrock": "Top Fels (verwittert) [m MD]", - "qt_top_bedrock_from": "Top Fels (verwittert) [m MD] (von)", - "qt_top_bedrock_to": "Top Fels (verwittert) [m MD] (bis)", - "qt_top_bedrock_tvd_from": "Top Fels (verwittert) [m TVD] (von)", - "qt_top_bedrock_tvd_to": "Top Fels (verwittert) [m TVD] (bis)", "qt_total_depth_tvd": "+/- Bohrendteufe [m TVD]", "quantity": "Menge", "reference_elevation": "Referenz Ansatzhöhe [m ü.M.]", @@ -417,13 +412,18 @@ "todiameter": "bis Durchmesser", "toelevation": "bis Höhe", "topView": "Aufsicht", - "top_bedrock": "Top Fels (frisch) [m MD]", - "top_bedrock_from": "Top Fels (frisch) [m MD] (von)", - "top_bedrock_to": "Top Fels (frisch) [m MD] (bis)", - "top_bedrock_tvd": "Top Fels (frisch) [m TVD]", - "top_bedrock_tvd_from": "Top Fels (frisch) [m TVD] (von)", - "top_bedrock_tvd_qt": "Top Fels (verwittert) [m TVD]", - "top_bedrock_tvd_to": "Top Fels (frisch) [m TVD] (bis)", + "top_bedrock_fresh_md": "Top Fels (frisch) [m MD]", + "top_bedrock_fresh_md_from": "Top Fels (frisch) [m MD] (von)", + "top_bedrock_fresh_md_to": "Top Fels (frisch) [m MD] (bis)", + "top_bedrock_fresh_tvd": "Top Fels (frisch) [m TVD]", + "top_bedrock_fresh_tvd_from": "Top Fels (frisch) [m TVD] (von)", + "top_bedrock_fresh_tvd_to": "Top Fels (frisch) [m TVD] (bis)", + "top_bedrock_weathered_md": "Top Fels (verwittert) [m MD]", + "top_bedrock_weathered_md_from": "Top Fels (verwittert) [m MD] (von)", + "top_bedrock_weathered_md_to": "Top Fels (verwittert) [m MD] (bis)", + "top_bedrock_weathered_tvd": "Top Fels (verwittert) [m TVD]", + "top_bedrock_weathered_tvd_from": "Top Fels (verwittert) [m TVD] (von)", + "top_bedrock_weathered_tvd_to": "Top Fels (verwittert) [m TVD] (bis)", "total_depth_tvd": "Bohrendteufe [m TVD]", "total_depth_tvd_from": "Bohrendteufe (von)", "total_depth_tvd_to": "Bohrendteufe (bis)", diff --git a/src/client/public/locale/en/common.json b/src/client/public/locale/en/common.json index b9b16260f..8b09c1035 100644 --- a/src/client/public/locale/en/common.json +++ b/src/client/public/locale/en/common.json @@ -141,6 +141,7 @@ "enableWorkgroup": "Enable workgroup", "enabled": "Enabled", "enabling": "Enabling {{what}}", + "endEditing": "Stop editing", "endTime": "End", "english": "English", "eon": "Eon", @@ -343,11 +344,6 @@ "publish": "Publish", "purpose": "Drilling purpose", "qt_depth": "+/- Borehole length [m MD]", - "qt_top_bedrock": "Top bedrock (weathered) [m MD]", - "qt_top_bedrock_from": "Top Bedrock (weathered) [m MD] (from)", - "qt_top_bedrock_to": "Top Bedrock (weathered) [m MD] (to)", - "qt_top_bedrock_tvd_from": "Top Bedrock (weathered) [m TVD] (from)", - "qt_top_bedrock_tvd_to": "Top Bedrock (weathered) [m TVD] (to)", "qt_total_depth_tvd": "+/- Total Depth [m TVD]", "quantity": "Quantity", "reference_elevation": "Reference elevation [m a.s.l.]", @@ -417,13 +413,18 @@ "todiameter": "to diameter", "toelevation": "to elevation", "topView": "Top view", - "top_bedrock": "Top bedrock (fresh) [m MD]", - "top_bedrock_from": "Top Bedrock (fresh) [m MD] (from)", - "top_bedrock_to": "Top Bedrock (fresh) [m MD] (to)", - "top_bedrock_tvd": "Top bedrock (fresh) [m TVD]", - "top_bedrock_tvd_from": "Top Bedrock (fresh) [m TVD] (from)", - "top_bedrock_tvd_qt": "Top bedrock (weathered) [m TVD]", - "top_bedrock_tvd_to": "Top Bedrock (fresh) [m TVD] (to)", + "top_bedrock_fresh_md": "Top bedrock (fresh) [m MD]", + "top_bedrock_fresh_md_from": "Top Bedrock (fresh) [m MD] (from)", + "top_bedrock_fresh_md_to": "Top Bedrock (fresh) [m MD] (to)", + "top_bedrock_fresh_tvd": "Top bedrock (fresh) [m TVD]", + "top_bedrock_fresh_tvd_from": "Top Bedrock (fresh) [m TVD] (from)", + "top_bedrock_fresh_tvd_to": "Top Bedrock (fresh) [m TVD] (to)", + "top_bedrock_weathered_md": "Top bedrock (weathered) [m MD]", + "top_bedrock_weathered_md_from": "Top Bedrock (weathered) [m MD] (from)", + "top_bedrock_weathered_md_to": "Top Bedrock (weathered) [m MD] (to)", + "top_bedrock_weathered_tvd": "Top bedrock (weathered) [m TVD]", + "top_bedrock_weathered_tvd_from": "Top Bedrock (weathered) [m TVD] (from)", + "top_bedrock_weathered_tvd_to": "Top Bedrock (weathered) [m TVD] (to)", "total_depth_tvd": "Total depth [m TVD]", "total_depth_tvd_from": "Total Depth [m TVD] (from)", "total_depth_tvd_to": "Total Depth [m TVD] (to)", diff --git a/src/client/public/locale/fr/common.json b/src/client/public/locale/fr/common.json index 2ef1cca17..c5eed6015 100644 --- a/src/client/public/locale/fr/common.json +++ b/src/client/public/locale/fr/common.json @@ -343,11 +343,6 @@ "publish": "Publier", "purpose": "But du forage", "qt_depth": "+/- Longueur du forage [m MD]", - "qt_top_bedrock": "Toit du rocher (altéré) [m MD]", - "qt_top_bedrock_from": "Toit du rocher (altéré) [m MD] (de)", - "qt_top_bedrock_to": "Toit du rocher (altéré) [m MD] (à)", - "qt_top_bedrock_tvd_from": "Toit du rocher (altéré) [m TVD] (de)", - "qt_top_bedrock_tvd_to": "Toit du rocher (altéré) [m TVD] (à)", "qt_total_depth_tvd": "+/- Profondeur totale [m TVD]", "quantity": "Quantité", "reference_elevation": "Référence altitudinale [m s.m.]", @@ -417,13 +412,18 @@ "todiameter": "jusqu'au diamètre", "toelevation": "jusqu'à l'altitude", "topView": "Vue en plan", - "top_bedrock": "Toit du rocher (sain) [m MD]", - "top_bedrock_from": "Toit du rocher (sain) [m MD] (de)", - "top_bedrock_to": "Toit du rocher (sain) [m MD] (à)", - "top_bedrock_tvd": "Toit du rocher (sain) [m TVD]", - "top_bedrock_tvd_from": "Toit du rocher (sain) [m TVD] (de)", - "top_bedrock_tvd_qt": "Toit du rocher (altéré) [m TVD]", - "top_bedrock_tvd_to": "Toit du rocher (sain) [m TVD] (à)", + "top_bedrock_fresh_md": "Toit du rocher (sain) [m MD]", + "top_bedrock_fresh_md_from": "Toit du rocher (sain) [m MD] (de)", + "top_bedrock_fresh_md_to": "Toit du rocher (sain) [m MD] (à)", + "top_bedrock_fresh_tvd": "Toit du rocher (sain) [m TVD]", + "top_bedrock_fresh_tvd_from": "Toit du rocher (sain) [m TVD] (de)", + "top_bedrock_fresh_tvd_to": "Toit du rocher (sain) [m TVD] (à)", + "top_bedrock_weathered_md": "Toit du rocher (altéré) [m MD]", + "top_bedrock_weathered_md_from": "Toit du rocher (altéré) [m MD] (de)", + "top_bedrock_weathered_md_to": "Toit du rocher (altéré) [m MD] (à)", + "top_bedrock_weathered_tvd": "Toit du rocher (altéré) [m TVD]", + "top_bedrock_weathered_tvd_from": "Toit du rocher (altéré) [m TVD] (de)", + "top_bedrock_weathered_tvd_to": "Toit du rocher (altéré) [m TVD] (à)", "total_depth_tvd": "Profondeur totale [m TVD]", "total_depth_tvd_from": "Profondeur totale [m TVD] (de)", "total_depth_tvd_to": "Profondeur totale [m TVD] (à)", diff --git a/src/client/public/locale/it/common.json b/src/client/public/locale/it/common.json index fb3c04d2c..427634a7a 100644 --- a/src/client/public/locale/it/common.json +++ b/src/client/public/locale/it/common.json @@ -343,11 +343,6 @@ "publish": "Pubblicare", "purpose": "Scopo della perforazione", "qt_depth": "+/- Lunghezza della perforazione [m MD]", - "qt_top_bedrock": "Top del substrato roccioso (alterato) [m MD]", - "qt_top_bedrock_from": "Top del substrato roccioso (alterato) [m MD] (da)", - "qt_top_bedrock_to": "Top del substrato roccioso (alterato) [m MD] (a)", - "qt_top_bedrock_tvd_from": "Top del substrato roccioso (alterato) [m TVD] (da)", - "qt_top_bedrock_tvd_to": "Top del substrato roccioso (alterato) [m TVD] (a)", "qt_total_depth_tvd": "+/- Profondità totale [m TVD]", "quantity": "Quantità", "reference_elevation": "Riferimento della quota [m s.l.m.]", @@ -417,13 +412,18 @@ "todiameter": "fino al diametro", "toelevation": "fino alla quota", "topView": "Vista dall'alto", - "top_bedrock": "Top substrato (fresco) [m MD]", - "top_bedrock_from": "Top substrato (fresco) [m MD] (da)", - "top_bedrock_to": "Top substrato (fresco) [m MD] (a)", - "top_bedrock_tvd": "Top substrato (fresco) [m TVD]", - "top_bedrock_tvd_from": "Top substrato (fresco) [m TVD] (da)", - "top_bedrock_tvd_qt": "Top del substrato roccioso (alterato) [m TVD]", - "top_bedrock_tvd_to": "Top substrato (fresco) [m TVD] (a)", + "top_bedrock_fresh_md": "Top substrato (fresco) [m MD]", + "top_bedrock_fresh_md_from": "Top substrato (fresco) [m MD] (da)", + "top_bedrock_fresh_md_to": "Top substrato (fresco) [m MD] (a)", + "top_bedrock_fresh_tvd": "Top substrato (fresco) [m TVD]", + "top_bedrock_fresh_tvd_from": "Top substrato (fresco) [m TVD] (da)", + "top_bedrock_fresh_tvd_to": "Top substrato (fresco) [m TVD] (a)", + "top_bedrock_weathered_md": "Top del substrato roccioso (alterato) [m MD]", + "top_bedrock_weathered_md_from": "Top del substrato roccioso (alterato) [m MD] (da)", + "top_bedrock_weathered_md_to": "Top del substrato roccioso (alterato) [m MD] (a)", + "top_bedrock_weathered_tvd": "Top del substrato roccioso (alterato) [m TVD]", + "top_bedrock_weathered_tvd_from": "Top del substrato roccioso (alterato) [m TVD] (da)", + "top_bedrock_weathered_tvd_to": "Top del substrato roccioso (alterato) [m TVD] (a)", "total_depth_tvd": "Profondità totale [m TVD]", "total_depth_tvd_from": "Profondità totale [m TVD] (da)", "total_depth_tvd_to": "Profondità totale [m TVD] (a)", diff --git a/src/client/src/api-lib/reducers/index.js b/src/client/src/api-lib/reducers/index.js index a10b32ff2..eec7111ae 100644 --- a/src/client/src/api-lib/reducers/index.js +++ b/src/client/src/api-lib/reducers/index.js @@ -1,4 +1,4 @@ -import { combineReducers, createStore, applyMiddleware, compose } from "redux"; +import { applyMiddleware, combineReducers, compose, createStore } from "redux"; import thunkMiddleware from "redux-thunk"; export function user() { @@ -324,7 +324,7 @@ export function borehole() { method: null, purpose: null, status: null, - top_bedrock: null, + top_bedrock_fresh_md: null, groundwater: null, }, }, @@ -341,7 +341,7 @@ export function borehole() { cuttings: null, drill_diameter: "", qt_depth: null, - qt_top_bedrock: null, + top_bedrock_weathered_md: null, lithology_top_bedrock: null, lit_str_top_bedrock: null, chro_str_top_bedrock: null, diff --git a/src/client/src/commons/form/borehole/segments/boreholeDetailSegment.jsx b/src/client/src/commons/form/borehole/segments/boreholeDetailSegment.jsx index 430851786..9fcb4b987 100644 --- a/src/client/src/commons/form/borehole/segments/boreholeDetailSegment.jsx +++ b/src/client/src/commons/form/borehole/segments/boreholeDetailSegment.jsx @@ -40,12 +40,12 @@ const BoreholeDetailSegment = props => { }, [borehole.data.total_depth, updateTVD]); useEffect(() => { - updateTVD("extended.top_bedrock", borehole.data.extended.top_bedrock); - }, [borehole.data.extended.top_bedrock, updateTVD]); + updateTVD("extended.top_bedrock_fresh_md", borehole.data.extended.top_bedrock_fresh_md); + }, [borehole.data.extended.top_bedrock_fresh_md, updateTVD]); useEffect(() => { - updateTVD("custom.qt_top_bedrock", borehole.data.custom.qt_top_bedrock); - }, [borehole.data.custom.qt_top_bedrock, updateTVD]); + updateTVD("custom.top_bedrock_weathered_md", borehole.data.custom.top_bedrock_weathered_md); + }, [borehole.data.custom.top_bedrock_weathered_md, updateTVD]); const updateNumericField = (fieldNameMD, event) => { const value = event.target.value === "" ? null : parseIfString(event.target.value); @@ -111,15 +111,17 @@ const BoreholeDetailSegment = props => { updateNumericField("extended.top_bedrock", e)} + onChange={e => updateNumericField("extended.top_bedrock_fresh_md", e)} spellCheck="false" - value={_.isNil(borehole.data.extended.top_bedrock) ? "" : borehole.data.extended.top_bedrock} + value={ + _.isNil(borehole.data.extended.top_bedrock_fresh_md) ? "" : borehole.data.extended.top_bedrock_fresh_md + } thousandSeparator="'" readOnly={!isEditable} /> @@ -130,14 +132,14 @@ const BoreholeDetailSegment = props => { pointerEvents: "none", }}> @@ -146,15 +148,15 @@ const BoreholeDetailSegment = props => { updateNumericField("custom.qt_top_bedrock", e)} + onChange={e => updateNumericField("custom.top_bedrock_weathered_md", e)} spellCheck="false" - value={borehole.data.custom.qt_top_bedrock} + value={borehole.data.custom.top_bedrock_weathered_md} thousandSeparator="'" readOnly={!isEditable} /> @@ -165,14 +167,14 @@ const BoreholeDetailSegment = props => { pointerEvents: "none", }}> diff --git a/src/client/src/commons/form/multiple/multipleForm.jsx b/src/client/src/commons/form/multiple/multipleForm.jsx index d0a5c2487..1e170c949 100644 --- a/src/client/src/commons/form/multiple/multipleForm.jsx +++ b/src/client/src/commons/form/multiple/multipleForm.jsx @@ -10,8 +10,8 @@ import DomainTree from "../domain/tree/domainTree"; import DateField from "../dateField"; import TranslationText from "../translationText"; -import { Header, Input, Button, Form } from "semantic-ui-react"; -import { FormControl, RadioGroup, FormControlLabel, Radio } from "@mui/material"; +import { Button, Form, Header, Input } from "semantic-ui-react"; +import { FormControl, FormControlLabel, Radio, RadioGroup } from "@mui/material"; import { patchBoreholes } from "../../../api-lib/index"; @@ -54,8 +54,8 @@ class MultipleForm extends React.Component { boreholestatus: { api: "extended.status", value: null }, totaldepth: { api: "total_depth", value: null }, qt_depth: { api: "depth_precision", value: null }, - top_bedrock: { api: "extended.top_bedrock", value: null }, - qt_top_bedrock: { api: "custom.qt_top_bedrock", value: null }, + top_bedrock_fresh_md: { api: "extended.top_bedrock_fresh_md", value: null }, + top_bedrock_weathered_md: { api: "custom.top_bedrock_weathered_md", value: null }, groundwater: { api: "extended.groundwater", value: null }, lithology_top_bedrock: { api: "custom.lithology_top_bedrock", @@ -378,7 +378,10 @@ class MultipleForm extends React.Component { this.getDomain("boreholestatus"), ])} {this.getGroup([this.getInput("totaldepth", "number"), this.getDomain("qt_depth")])} - {this.getGroup([this.getInput("top_bedrock", "number"), this.getInput("qt_top_bedrock", "number")])} + {this.getGroup([ + this.getInput("top_bedrock_fresh_md", "number"), + this.getInput("top_bedrock_weathered_md", "number"), + ])} {this.getRadio("groundwater")} {this.getDomain("lithology_top_bedrock", "custom.lithology_top_bedrock")} {this.getDomain("lithostratigraphy_top_bedrock", "custom.lithostratigraphy_top_bedrock")} diff --git a/src/client/src/commons/menu/mainView/actions/importer/importModalContent.tsx b/src/client/src/commons/menu/mainView/actions/importer/importModalContent.tsx index 7121a98ce..645a57c2c 100644 --- a/src/client/src/commons/menu/mainView/actions/importer/importModalContent.tsx +++ b/src/client/src/commons/menu/mainView/actions/importer/importModalContent.tsx @@ -84,8 +84,8 @@ const ImportModalContent = ({ "location_precision;elevation_z;elevation_precision_id;" + "reference_elevation;reference_elevation_type_id;" + "qt_reference_elevation_id;hrs_id;type_id;purpose_id;" + - "status_id;remarks;total_depth;qt_depth_id;top_bedrock;" + - "qt_top_bedrock_id;" + + "status_id;remarks;total_depth;qt_depth_id;top_bedrock_fresh_md;" + + "top_bedrock_weathered_md;" + "has_groundwater;lithology_top_bedrock_id;" + "chronostratigraphy_id;lithostratigraphy_id;attachments;", )} diff --git a/src/client/src/commons/search/data/boreholeSearchData.js b/src/client/src/commons/search/data/boreholeSearchData.js index fd9cec113..b50d0d77e 100644 --- a/src/client/src/commons/search/data/boreholeSearchData.js +++ b/src/client/src/commons/search/data/boreholeSearchData.js @@ -56,23 +56,23 @@ export const boreholeSearchData = [ { id: 20, type: "Input", - label: "top_bedrock", - value: "top_bedrock_from", + label: "top_bedrock_fresh_md", + value: "top_bedrock_fresh_md_from", isNumber: true, inputType: "number", hasTwoFields: true, - isVisibleValue: "extended.top_bedrock", + isVisibleValue: "extended.top_bedrock_fresh_md", placeholder: "from", }, { id: 21, type: "Input", label: "", - value: "top_bedrock_to", + value: "top_bedrock_fresh_md_to", isNumber: true, inputType: "number", hasTwoFields: true, - isVisibleValue: "extended.top_bedrock", + isVisibleValue: "extended.top_bedrock_fresh_md", placeholder: "to", }, { @@ -88,23 +88,23 @@ export const boreholeSearchData = [ { id: 26, type: "Input", - label: "qt_top_bedrock", - value: "qt_top_bedrock_from", + label: "top_bedrock_weathered_md", + value: "top_bedrock_weathered_md_from", isNumber: true, inputType: "number", hasTwoFields: true, - isVisibleValue: "qt_top_bedrock", + isVisibleValue: "top_bedrock_weathered_md", placeholder: "from", }, { id: 27, type: "Input", label: "", - value: "qt_top_bedrock_to", + value: "top_bedrock_weathered_md_to", isNumber: true, inputType: "number", hasTwoFields: true, - isVisibleValue: "qt_top_bedrock", + isVisibleValue: "top_bedrock_weathered_md", placeholder: "to", }, { diff --git a/src/client/src/commons/search/editor/filterState.js b/src/client/src/commons/search/editor/filterState.js index 871340d06..011070406 100644 --- a/src/client/src/commons/search/editor/filterState.js +++ b/src/client/src/commons/search/editor/filterState.js @@ -22,8 +22,8 @@ const initialState = { length_from: "", length_to: "", groundwater: -1, - top_bedrock_from: "", - top_bedrock_to: "", + top_bedrock_fresh_md_from: "", + top_bedrock_fresh_md_to: "", status: null, purpose: null, lithology_top_bedrock: null, @@ -85,8 +85,8 @@ const initialState = { layer_gradation: null, qt_depth: null, - qt_top_bedrock_from: "", - qt_top_bedrock_to: "", + top_bedrock_weathered_md_from: "", + top_bedrock_weathered_md_to: "", reference_elevation_type: null, qt_reference_elevation: null, @@ -173,8 +173,8 @@ const filters = ( ...state.filter, }, }; - copy.filter.top_bedrock_from = ""; - copy.filter.top_bedrock_to = ""; + copy.filter.top_bedrock_fresh_md_from = ""; + copy.filter.top_bedrock_fresh_md_to = ""; return copy; } case "SEARCH_EDITOR_FILTER_REFRESH": { diff --git a/src/client/src/pages/settings/data/boreholeEditorData.js b/src/client/src/pages/settings/data/boreholeEditorData.js index 17838c70d..abac6edf3 100644 --- a/src/client/src/pages/settings/data/boreholeEditorData.js +++ b/src/client/src/pages/settings/data/boreholeEditorData.js @@ -21,8 +21,8 @@ export const boreholeEditorData = [ }, { id: 13, - label: "top_bedrock", - value: "extended.top_bedrock", + label: "top_bedrock_fresh_md", + value: "extended.top_bedrock_fresh_md", }, { id: 15, @@ -31,8 +31,8 @@ export const boreholeEditorData = [ }, { id: 17, - label: "qt_top_bedrock", - value: "qt_top_bedrock", + label: "top_bedrock_weathered_md", + value: "top_bedrock_weathered_md", }, { id: 19, diff --git a/src/client/src/pages/settings/settingState.js b/src/client/src/pages/settings/settingState.js index 310ca51ca..3009c9f06 100644 --- a/src/client/src/pages/settings/settingState.js +++ b/src/client/src/pages/settings/settingState.js @@ -56,7 +56,7 @@ const initialState = { original_name: true, purpose: true, status: true, - top_bedrock: true, + top_bedrock_fresh_md: true, groundwater: true, }, custom: { @@ -114,7 +114,7 @@ const initialState = { original_name: true, purpose: true, status: true, - top_bedrock: true, + top_bedrock_fresh_md: true, groundwater: true, }, custom: { diff --git a/tests/Controllers/StratigraphyControllerTest.cs b/tests/Controllers/StratigraphyControllerTest.cs index 41c3f2328..410da5d72 100644 --- a/tests/Controllers/StratigraphyControllerTest.cs +++ b/tests/Controllers/StratigraphyControllerTest.cs @@ -322,7 +322,7 @@ public async Task CreateForLockedBorehole() public async Task AddBedrockLayer() { // Prepare stratigraphy to add the bedrock layer for. - var boreholeWithBedrock = await context.Boreholes.FirstAsync(x => x.TopBedrock.HasValue); + var boreholeWithBedrock = await context.Boreholes.FirstAsync(x => x.TopBedrockFresh.HasValue); var stratigraphyWithoutBedrockLayer = new Stratigraphy { BoreholeId = boreholeWithBedrock.Id, @@ -341,7 +341,7 @@ public async Task AddBedrockLayer() var bedrockLayerId = (int)((OkObjectResult?)addBedrockResult.Result)?.Value!; var bedrockLayer = await context.Layers.FindAsync(bedrockLayerId); Assert.AreEqual(stratigraphyWithoutBedrockLayer.Id, bedrockLayer.StratigraphyId); - Assert.AreEqual(boreholeWithBedrock.TopBedrock.Value, bedrockLayer.FromDepth); + Assert.AreEqual(boreholeWithBedrock.TopBedrockFresh.Value, bedrockLayer.FromDepth); Assert.AreEqual(boreholeWithBedrock.LithologyTopBedrockId, bedrockLayer.LithologyTopBedrockId); Assert.AreEqual(boreholeWithBedrock.LithostratigraphyId, bedrockLayer.LithostratigraphyId); Assert.AreEqual(false, bedrockLayer.IsLast); @@ -351,7 +351,7 @@ public async Task AddBedrockLayer() public async Task AddBedrockLayerForBoreholeWithoutTopBedrockValue() { // Prepare stratigraphy to add the bedrock layer for. - var boreholeWithoutBedrock = await context.Boreholes.FirstAsync(x => !x.TopBedrock.HasValue); + var boreholeWithoutBedrock = await context.Boreholes.FirstAsync(x => !x.TopBedrockFresh.HasValue); var stratigraphyWithoutBedrockLayer = new Stratigraphy { BoreholeId = boreholeWithoutBedrock.Id, diff --git a/tests/TestData/testdata.csv b/tests/TestData/testdata.csv index 35f940fa6..ba8d9329a 100644 --- a/tests/TestData/testdata.csv +++ b/tests/TestData/testdata.csv @@ -1,4 +1,4 @@ -import_id;id_geodin_shortname;id_info_geol;id_original;id_canton;id_geo_quat;id_geo_mol;id_geo_therm;id_top_fels;id_geodin;id_kernlager;original_name;project_name;alternate_name;date;restriction_id;restriction_until;original_reference_system;location_x;location_y;location_x_lv_03;location_y_lv_03;location_precision_id;elevation_z;elevation_precision_id;reference_elevation;reference_elevation_type_id;qt_reference_elevation_id;hrs_id;type_id;purpose_id;status_id;remarks;total_depth;qt_depth_id;top_bedrock;qt_top_bedrock_id;has_groundwater;lithology_top_bedrock_id;chronostratigraphy_id;lithostratigraphy_id +import_id;id_geodin_shortname;id_info_geol;id_original;id_canton;id_geo_quat;id_geo_mol;id_geo_therm;id_top_fels;id_geodin;id_kernlager;original_name;project_name;alternate_name;date;restriction_id;restriction_until;original_reference_system;location_x;location_y;location_x_lv_03;location_y_lv_03;location_precision_id;elevation_z;elevation_precision_id;reference_elevation;reference_elevation_type_id;qt_reference_elevation_id;hrs_id;type_id;purpose_id;status_id;remarks;total_depth;qt_depth_id;top_bedrock_fresh_md;top_bedrock_weathered_md;has_groundwater;lithology_top_bedrock_id;chronostratigraphy_id;lithostratigraphy_id 545;Id_1;Id_2;;;;;Id_3;;;kernlager AETHERMAGIC;Unit_Test_1;Projekt 1 ;Unit_Test_1_a;2021-08-06 00:36:21.991827+00;20111002;;20104001;2618962;1144995;;;20113005;640.7726659;20114001;317.9010264;20114006;20114004;20106001;20101001;22103001;22104003;this product is top-notch.;4232.711946;22108003;398.8529283;22108004;TRUE;15104669;15001073;15300261 8787;Id_4;;Id_5;Id_6;;;;;;;Unit_Test_2;Projekt 2;Unit_Test_2_a;2021-03-31 12:20:10.341393+00;;;20104001;2631690;1170516;;;20113002;3430.769638;20114005;2016.314814;20114001;20114004;20106001;20101001;22103001;22104008;This product works certainly well. It perfectly improves my tennis by a lot.;794.1547194;22108005;958.2378855;22108005;;15104670;15001009;15302009 5454;;;Id_7;Id_8;;;;Id_9;;;Unit_Test_3;Projekt 3;Unit_Test_3_a;;20111002;01.12.2023;20104001;2614834;1178661;;;20113005;1720.766609;20114003;1829.812475;20114003;20114002;20106001;20101001;;22104002;This is a really good product.;2429.747725;22108002;759.7574008;22108005;TRUE;15104671;15001007;15302339