//
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("20200722131856_Initial migration")]
partial class Initialmigration
{
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.HealthFacilities", 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.HealthcareWorkers", 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")
.HasColumnType("text");
b.Property("MedicineListId")
.HasColumnType("integer");
b.Property("Name")
.HasColumnType("text");
b.Property("Packaging")
.HasColumnType("text");
b.Property("Price")
.HasColumnType("real");
b.Property("Strength")
.HasColumnType("text");
b.Property("WayOfIssuing")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("MedicineListId");
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("MedicinesId")
.HasColumnType("integer");
b.Property("PharmacyHeadId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("MedicinesId");
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("integer");
b.Property("ActiveMK")
.HasColumnType("integer");
b.Property("CreatedOn")
.HasColumnType("timestamp without time zone");
b.Property("DeathsGlobal")
.HasColumnType("integer");
b.Property("DeathsMK")
.HasColumnType("integer");
b.Property("DeletedOn")
.HasColumnType("timestamp without time zone");
b.Property("Name")
.HasColumnType("text");
b.Property("NewMK")
.HasColumnType("integer");
b.Property("TotalGlobal")
.HasColumnType("integer");
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")
.HasColumnType("text");
b.Property("CreatedOn")
.HasColumnType("timestamp without time zone");
b.Property("DeletedOn")
.HasColumnType("timestamp without time zone");
b.Property("Location")
.HasColumnType("text");
b.Property("Name")
.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")
.HasColumnType("text");
b.Property("Name")
.HasColumnType("text");
b.Property("Password")
.HasColumnType("text");
b.Property("PharmacyId")
.HasColumnType("integer");
b.Property("PharmacyMedicinesId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("PharmacyId");
b.HasIndex("PharmacyMedicinesId");
b.ToTable("PharmacyHeads");
});
modelBuilder.Entity("FarmatikoData.Models.HealthcareWorkers", b =>
{
b.HasOne("FarmatikoData.Models.HealthFacilities", "Facility")
.WithMany()
.HasForeignKey("FacilityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("FarmatikoData.Models.Medicine", b =>
{
b.HasOne("FarmatikoData.Models.MedicineList", null)
.WithMany("MedicinesList")
.HasForeignKey("MedicineListId");
});
modelBuilder.Entity("FarmatikoData.Models.MedicineList", b =>
{
b.HasOne("FarmatikoData.Models.Medicine", "Medicines")
.WithMany()
.HasForeignKey("MedicinesId");
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.PharmacyHead", b =>
{
b.HasOne("FarmatikoData.Models.Pharmacy", "Pharmacy")
.WithMany()
.HasForeignKey("PharmacyId");
b.HasOne("FarmatikoData.Models.MedicineList", "PharmacyMedicines")
.WithMany()
.HasForeignKey("PharmacyMedicinesId");
});
#pragma warning restore 612, 618
}
}
}