386 lines
14 KiB
C#
386 lines
14 KiB
C#
|
// <auto-generated />
|
|||
|
using System;
|
|||
|
using Microsoft.EntityFrameworkCore;
|
|||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||
|
using NetTopologySuite.Geometries;
|
|||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||
|
using labdb.Models;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace labdb.Migrations
|
|||
|
{
|
|||
|
[DbContext(typeof(AppDbContext))]
|
|||
|
[Migration("20221115170737_Initial")]
|
|||
|
partial class Initial
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|||
|
{
|
|||
|
#pragma warning disable 612, 618
|
|||
|
modelBuilder
|
|||
|
.HasAnnotation("ProductVersion", "7.0.0")
|
|||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|||
|
|
|||
|
NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "postgis");
|
|||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|||
|
|
|||
|
modelBuilder.Entity("labdb.Models.Country", b =>
|
|||
|
{
|
|||
|
b.Property<Guid>("Id")
|
|||
|
.HasColumnType("uuid")
|
|||
|
.HasColumnName("id");
|
|||
|
|
|||
|
b.Property<string>("Code")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("code");
|
|||
|
|
|||
|
b.Property<string>("EnglishName")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("english_name");
|
|||
|
|
|||
|
b.Property<string>("Name")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("name");
|
|||
|
|
|||
|
b.HasKey("Id")
|
|||
|
.HasName("pk_country");
|
|||
|
|
|||
|
b.HasIndex(new[] { "Name" }, "name")
|
|||
|
.IsUnique()
|
|||
|
.HasDatabaseName("ix_country_name");
|
|||
|
|
|||
|
b.HasIndex(new[] { "Name" }, "name_trgm")
|
|||
|
.HasDatabaseName("ix_country_name1");
|
|||
|
|
|||
|
NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Name" }, "name_trgm"), "gin");
|
|||
|
NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex(new[] { "Name" }, "name_trgm"), new[] { "gin_trgm_ops" });
|
|||
|
|
|||
|
b.ToTable("country", (string)null);
|
|||
|
|
|||
|
b.HasData(
|
|||
|
new
|
|||
|
{
|
|||
|
Id = new Guid("50de594a-9828-4c50-8ec0-3803cc359dc0"),
|
|||
|
Code = "DE",
|
|||
|
EnglishName = "Germany",
|
|||
|
Name = "Deutschland"
|
|||
|
},
|
|||
|
new
|
|||
|
{
|
|||
|
Id = new Guid("b7fb8044-148f-41e6-aedc-2d982cacc4fe"),
|
|||
|
Code = "TEST",
|
|||
|
EnglishName = "TEST COUNTRY",
|
|||
|
Name = "TEST"
|
|||
|
});
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("labdb.Models.Lab", b =>
|
|||
|
{
|
|||
|
b.Property<Guid>("Id")
|
|||
|
.HasColumnType("uuid")
|
|||
|
.HasColumnName("id");
|
|||
|
|
|||
|
b.Property<string>("AddressCity")
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("address_city");
|
|||
|
|
|||
|
b.Property<string>("AddressLine1")
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("address_line1");
|
|||
|
|
|||
|
b.Property<string>("AddressLine2")
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("address_line2");
|
|||
|
|
|||
|
b.Property<string>("AddressPostcode")
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("address_postcode");
|
|||
|
|
|||
|
b.Property<decimal>("BasicFee")
|
|||
|
.HasColumnType("numeric")
|
|||
|
.HasColumnName("basic_fee");
|
|||
|
|
|||
|
b.Property<Guid>("CountryId")
|
|||
|
.HasColumnType("uuid")
|
|||
|
.HasColumnName("country_id");
|
|||
|
|
|||
|
b.Property<decimal>("DrawFee")
|
|||
|
.HasColumnType("numeric")
|
|||
|
.HasColumnName("draw_fee");
|
|||
|
|
|||
|
b.Property<string>("Email")
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("email");
|
|||
|
|
|||
|
b.Property<Point>("Location")
|
|||
|
.HasColumnType("geometry")
|
|||
|
.HasColumnName("location");
|
|||
|
|
|||
|
b.Property<string>("Name")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("name");
|
|||
|
|
|||
|
b.Property<string>("Notes")
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("notes");
|
|||
|
|
|||
|
b.Property<string>("Phone")
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("phone");
|
|||
|
|
|||
|
b.Property<bool>("RequiresAppointment")
|
|||
|
.HasColumnType("boolean")
|
|||
|
.HasColumnName("requires_appointment");
|
|||
|
|
|||
|
b.Property<bool>("SelfDraw")
|
|||
|
.HasColumnType("boolean")
|
|||
|
.HasColumnName("self_draw");
|
|||
|
|
|||
|
b.Property<string>("Website")
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("website");
|
|||
|
|
|||
|
b.HasKey("Id")
|
|||
|
.HasName("pk_lab");
|
|||
|
|
|||
|
b.HasIndex("AddressPostcode")
|
|||
|
.HasDatabaseName("ix_lab_address_postcode");
|
|||
|
|
|||
|
b.HasIndex("BasicFee")
|
|||
|
.HasDatabaseName("ix_lab_basic_fee");
|
|||
|
|
|||
|
b.HasIndex("CountryId")
|
|||
|
.HasDatabaseName("ix_lab_country_id");
|
|||
|
|
|||
|
b.HasIndex("DrawFee")
|
|||
|
.HasDatabaseName("ix_lab_draw_fee");
|
|||
|
|
|||
|
b.HasIndex("RequiresAppointment")
|
|||
|
.HasDatabaseName("ix_lab_requires_appointment");
|
|||
|
|
|||
|
b.HasIndex("SelfDraw")
|
|||
|
.HasDatabaseName("ix_lab_self_draw");
|
|||
|
|
|||
|
b.HasIndex(new[] { "Name" }, "name")
|
|||
|
.HasDatabaseName("ix_lab_name");
|
|||
|
|
|||
|
b.HasIndex(new[] { "Name" }, "name_trgm")
|
|||
|
.HasDatabaseName("ix_lab_name");
|
|||
|
|
|||
|
NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Name" }, "name_trgm"), "gin");
|
|||
|
NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex(new[] { "Name" }, "name_trgm"), new[] { "gin_trgm_ops" });
|
|||
|
|
|||
|
b.ToTable("lab", (string)null);
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("labdb.Models.Test", b =>
|
|||
|
{
|
|||
|
b.Property<Guid>("Id")
|
|||
|
.HasColumnType("uuid")
|
|||
|
.HasColumnName("id");
|
|||
|
|
|||
|
b.Property<string>("Abbreviation")
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("abbreviation");
|
|||
|
|
|||
|
b.Property<string>("Description")
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("description");
|
|||
|
|
|||
|
b.Property<string>("Name")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("name");
|
|||
|
|
|||
|
b.Property<string>("PubchemLink")
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("pubchem_link");
|
|||
|
|
|||
|
b.HasKey("Id")
|
|||
|
.HasName("pk_test");
|
|||
|
|
|||
|
b.HasIndex(new[] { "Abbreviation" }, "abbreviation")
|
|||
|
.IsUnique()
|
|||
|
.HasDatabaseName("ix_test_abbreviation");
|
|||
|
|
|||
|
b.HasIndex(new[] { "Abbreviation" }, "abbreviation_trgm")
|
|||
|
.HasDatabaseName("ix_test_abbreviation1");
|
|||
|
|
|||
|
NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Abbreviation" }, "abbreviation_trgm"), "gin");
|
|||
|
NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex(new[] { "Abbreviation" }, "abbreviation_trgm"), new[] { "gin_trgm_ops" });
|
|||
|
|
|||
|
b.HasIndex(new[] { "Name" }, "name")
|
|||
|
.IsUnique()
|
|||
|
.HasDatabaseName("ix_test_name");
|
|||
|
|
|||
|
b.HasIndex(new[] { "Name" }, "name_trgm")
|
|||
|
.HasDatabaseName("ix_test_name1");
|
|||
|
|
|||
|
NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Name" }, "name_trgm"), "gin");
|
|||
|
NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex(new[] { "Name" }, "name_trgm"), new[] { "gin_trgm_ops" });
|
|||
|
|
|||
|
b.ToTable("test", (string)null);
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("labdb.Models.TestOffer", b =>
|
|||
|
{
|
|||
|
b.Property<Guid>("Id")
|
|||
|
.HasColumnType("uuid")
|
|||
|
.HasColumnName("id");
|
|||
|
|
|||
|
b.Property<decimal>("BloodVolume")
|
|||
|
.HasColumnType("numeric")
|
|||
|
.HasColumnName("blood_volume");
|
|||
|
|
|||
|
b.Property<Guid>("LabId")
|
|||
|
.HasColumnType("uuid")
|
|||
|
.HasColumnName("lab_id");
|
|||
|
|
|||
|
b.Property<string>("Notes")
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("notes");
|
|||
|
|
|||
|
b.Property<decimal>("Price")
|
|||
|
.HasColumnType("numeric")
|
|||
|
.HasColumnName("price");
|
|||
|
|
|||
|
b.Property<string>("ServiceDirectoryLink")
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("service_directory_link");
|
|||
|
|
|||
|
b.Property<Guid>("TestId")
|
|||
|
.HasColumnType("uuid")
|
|||
|
.HasColumnName("test_id");
|
|||
|
|
|||
|
b.Property<string>("TestMethod")
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("test_method");
|
|||
|
|
|||
|
b.HasKey("Id")
|
|||
|
.HasName("pk_test_offer");
|
|||
|
|
|||
|
b.HasIndex("BloodVolume")
|
|||
|
.HasDatabaseName("ix_test_offer_blood_volume");
|
|||
|
|
|||
|
b.HasIndex("LabId")
|
|||
|
.HasDatabaseName("ix_test_offer_lab_id");
|
|||
|
|
|||
|
b.HasIndex("Price")
|
|||
|
.HasDatabaseName("ix_test_offer_price");
|
|||
|
|
|||
|
b.HasIndex("TestId")
|
|||
|
.HasDatabaseName("ix_test_offer_test_id");
|
|||
|
|
|||
|
b.HasIndex("TestMethod")
|
|||
|
.HasDatabaseName("ix_test_offer_test_method");
|
|||
|
|
|||
|
b.ToTable("test_offer", (string)null);
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("labdb.Models.TestSynonym", b =>
|
|||
|
{
|
|||
|
b.Property<Guid>("Id")
|
|||
|
.HasColumnType("uuid")
|
|||
|
.HasColumnName("id");
|
|||
|
|
|||
|
b.Property<string>("Name")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("text")
|
|||
|
.HasColumnName("name");
|
|||
|
|
|||
|
b.Property<Guid>("TestId")
|
|||
|
.HasColumnType("uuid")
|
|||
|
.HasColumnName("test_id");
|
|||
|
|
|||
|
b.HasKey("Id")
|
|||
|
.HasName("pk_test_synonym");
|
|||
|
|
|||
|
b.HasIndex("TestId")
|
|||
|
.HasDatabaseName("ix_test_synonym_test_id");
|
|||
|
|
|||
|
b.HasIndex(new[] { "Name" }, "name")
|
|||
|
.IsUnique()
|
|||
|
.HasDatabaseName("ix_test_synonym_name");
|
|||
|
|
|||
|
b.HasIndex(new[] { "Name" }, "name_trgm")
|
|||
|
.HasDatabaseName("ix_test_synonym_name1");
|
|||
|
|
|||
|
NpgsqlIndexBuilderExtensions.HasMethod(b.HasIndex(new[] { "Name" }, "name_trgm"), "gin");
|
|||
|
NpgsqlIndexBuilderExtensions.HasOperators(b.HasIndex(new[] { "Name" }, "name_trgm"), new[] { "gin_trgm_ops" });
|
|||
|
|
|||
|
b.ToTable("test_synonym", (string)null);
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("labdb.Models.Lab", b =>
|
|||
|
{
|
|||
|
b.HasOne("labdb.Models.Country", "Country")
|
|||
|
.WithMany("Labs")
|
|||
|
.HasForeignKey("CountryId")
|
|||
|
.OnDelete(DeleteBehavior.Cascade)
|
|||
|
.IsRequired()
|
|||
|
.HasConstraintName("fk_lab_country_country_temp_id");
|
|||
|
|
|||
|
b.Navigation("Country");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("labdb.Models.TestOffer", b =>
|
|||
|
{
|
|||
|
b.HasOne("labdb.Models.Lab", "Lab")
|
|||
|
.WithMany("TestOffers")
|
|||
|
.HasForeignKey("LabId")
|
|||
|
.OnDelete(DeleteBehavior.Cascade)
|
|||
|
.IsRequired()
|
|||
|
.HasConstraintName("fk_test_offer_lab_lab_temp_id");
|
|||
|
|
|||
|
b.HasOne("labdb.Models.Test", "Test")
|
|||
|
.WithMany("TestOffers")
|
|||
|
.HasForeignKey("TestId")
|
|||
|
.OnDelete(DeleteBehavior.Cascade)
|
|||
|
.IsRequired()
|
|||
|
.HasConstraintName("fk_test_offer_test_test_temp_id");
|
|||
|
|
|||
|
b.Navigation("Lab");
|
|||
|
|
|||
|
b.Navigation("Test");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("labdb.Models.TestSynonym", b =>
|
|||
|
{
|
|||
|
b.HasOne("labdb.Models.Test", "Test")
|
|||
|
.WithMany("Synonyms")
|
|||
|
.HasForeignKey("TestId")
|
|||
|
.OnDelete(DeleteBehavior.Cascade)
|
|||
|
.IsRequired()
|
|||
|
.HasConstraintName("fk_test_synonym_test_test_temp_id1");
|
|||
|
|
|||
|
b.Navigation("Test");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("labdb.Models.Country", b =>
|
|||
|
{
|
|||
|
b.Navigation("Labs");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("labdb.Models.Lab", b =>
|
|||
|
{
|
|||
|
b.Navigation("TestOffers");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("labdb.Models.Test", b =>
|
|||
|
{
|
|||
|
b.Navigation("Synonyms");
|
|||
|
|
|||
|
b.Navigation("TestOffers");
|
|||
|
});
|
|||
|
#pragma warning restore 612, 618
|
|||
|
}
|
|||
|
}
|
|||
|
}
|