// using System; using FarmatikoData; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace FarmatikoData.Migrations { [DbContext(typeof(FarmatikoDataContext))] [Migration("20201105055526_NewMigration")] partial class NewMigration { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn) .HasAnnotation("ProductVersion", "3.1.6") .HasAnnotation("Relational:MaxIdentifierLength", 63); modelBuilder.Entity("FarmatikoData.Models.HealthFacility", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("Address") .IsRequired() .HasColumnType("text"); b.Property("CreatedOn") .HasColumnType("timestamp without time zone"); b.Property("DeletedOn") .HasColumnType("timestamp without time zone"); b.Property("Email") .HasColumnType("text"); b.Property("Municipality") .IsRequired() .HasColumnType("text"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("Phone") .HasColumnType("text"); b.Property("Type") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.ToTable("HealthFacilities"); }); modelBuilder.Entity("FarmatikoData.Models.HealthcareWorker", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("Branch") .IsRequired() .HasColumnType("text"); b.Property("CreatedOn") .HasColumnType("timestamp without time zone"); b.Property("DeletedOn") .HasColumnType("timestamp without time zone"); b.Property("FacilityId") .HasColumnType("integer"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("Title") .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("FacilityId"); b.ToTable("HealthcareWorkers"); }); modelBuilder.Entity("FarmatikoData.Models.Medicine", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("CreatedOn") .HasColumnType("timestamp without time zone"); b.Property("DeletedOn") .HasColumnType("timestamp without time zone"); b.Property("Form") .HasColumnType("text"); b.Property("Manufacturer") .IsRequired() .HasColumnType("text"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("Packaging") .HasColumnType("text"); b.Property("Price") .HasColumnType("real"); b.Property("Strength") .IsRequired() .HasColumnType("text"); b.Property("WayOfIssuing") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.ToTable("Medicines"); }); modelBuilder.Entity("FarmatikoData.Models.MedicineList", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("CreatedOn") .HasColumnType("timestamp without time zone"); b.Property("DeletedOn") .HasColumnType("timestamp without time zone"); b.Property("HasMedicine") .HasColumnType("boolean"); b.Property("MedicineId") .HasColumnType("integer"); b.Property("PharmacyHeadId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("MedicineId"); b.HasIndex("PharmacyHeadId"); b.ToTable("MedicineLists"); }); modelBuilder.Entity("FarmatikoData.Models.Pandemic", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("ActiveGlobal") .HasColumnType("bigint"); b.Property("ActiveMK") .HasColumnType("integer"); b.Property("CreatedOn") .HasColumnType("timestamp without time zone"); b.Property("DeathsGlobal") .HasColumnType("bigint"); b.Property("DeathsMK") .HasColumnType("integer"); b.Property("DeletedOn") .HasColumnType("timestamp without time zone"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("NewMK") .HasColumnType("integer"); b.Property("TotalGlobal") .HasColumnType("bigint"); b.Property("TotalMK") .HasColumnType("integer"); b.HasKey("Id"); b.ToTable("Pandemics"); }); modelBuilder.Entity("FarmatikoData.Models.Pharmacy", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("Address") .IsRequired() .HasColumnType("text"); b.Property("CreatedOn") .HasColumnType("timestamp without time zone"); b.Property("DeletedOn") .HasColumnType("timestamp without time zone"); b.Property("Location") .IsRequired() .HasColumnType("text"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("PharmacyHeadId") .HasColumnType("integer"); b.Property("WorkAllTime") .HasColumnType("boolean"); b.HasKey("Id"); b.HasIndex("PharmacyHeadId"); b.ToTable("Pharmacies"); }); modelBuilder.Entity("FarmatikoData.Models.PharmacyHead", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("CreatedOn") .HasColumnType("timestamp without time zone"); b.Property("DeletedOn") .HasColumnType("timestamp without time zone"); b.Property("Email") .IsRequired() .HasColumnType("text"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("Password") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.ToTable("PharmacyHeads"); }); modelBuilder.Entity("FarmatikoData.Models.RequestPharmacyHead", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("CreatedOn") .HasColumnType("timestamp without time zone"); b.Property("DeletedOn") .HasColumnType("timestamp without time zone"); b.Property("HeadId") .HasColumnType("integer"); b.Property("PharmacyId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("HeadId"); b.HasIndex("PharmacyId"); b.ToTable("PHRequests"); }); modelBuilder.Entity("FarmatikoData.Models.User", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("CreatedOn") .HasColumnType("timestamp without time zone"); b.Property("DeletedOn") .HasColumnType("timestamp without time zone"); b.Property("Email") .HasColumnType("text"); b.Property("Name") .HasColumnType("text"); b.Property("Password") .HasColumnType("text"); b.Property("UserRole") .HasColumnType("integer"); b.HasKey("Id"); b.ToTable("Users"); }); modelBuilder.Entity("FarmatikoData.Models.HealthcareWorker", b => { b.HasOne("FarmatikoData.Models.HealthFacility", "Facility") .WithMany() .HasForeignKey("FacilityId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("FarmatikoData.Models.MedicineList", b => { b.HasOne("FarmatikoData.Models.Medicine", "Medicine") .WithMany() .HasForeignKey("MedicineId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("FarmatikoData.Models.PharmacyHead", null) .WithMany("MedicineLists") .HasForeignKey("PharmacyHeadId"); }); modelBuilder.Entity("FarmatikoData.Models.Pharmacy", b => { b.HasOne("FarmatikoData.Models.PharmacyHead", null) .WithMany("PharmaciesList") .HasForeignKey("PharmacyHeadId"); }); modelBuilder.Entity("FarmatikoData.Models.RequestPharmacyHead", b => { b.HasOne("FarmatikoData.Models.PharmacyHead", "Head") .WithMany() .HasForeignKey("HeadId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("FarmatikoData.Models.Pharmacy", "Pharmacy") .WithMany() .HasForeignKey("PharmacyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); #pragma warning restore 612, 618 } } }