// using System; using JobsMedical.Web.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace JobsMedical.Web.Migrations { [DbContext(typeof(AppDbContext))] [Migration("20260602202926_InitialCreate")] partial class InitialCreate { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "10.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("JobsMedical.Web.Models.Application", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("DoctorId") .HasColumnType("integer"); b.Property("Message") .HasMaxLength(500) .HasColumnType("character varying(500)"); b.Property("ShiftId") .HasColumnType("integer"); b.Property("Status") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("DoctorId"); b.HasIndex("ShiftId", "DoctorId") .IsUnique(); b.ToTable("Applications"); }); modelBuilder.Entity("JobsMedical.Web.Models.City", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("IsActive") .HasColumnType("boolean"); b.Property("Name") .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("Province") .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); b.HasKey("Id"); b.ToTable("Cities"); }); modelBuilder.Entity("JobsMedical.Web.Models.DoctorProfile", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Bio") .HasMaxLength(1000) .HasColumnType("character varying(1000)"); b.Property("CityId") .HasColumnType("integer"); b.Property("IsVerified") .HasColumnType("boolean"); b.Property("LicenseNo") .HasMaxLength(20) .HasColumnType("character varying(20)"); b.Property("Specialty") .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("UserId") .HasColumnType("integer"); b.Property("YearsExperience") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("CityId"); b.HasIndex("UserId") .IsUnique(); b.ToTable("DoctorProfiles"); }); modelBuilder.Entity("JobsMedical.Web.Models.Facility", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Address") .HasMaxLength(500) .HasColumnType("character varying(500)"); b.Property("BaleId") .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("CityId") .HasColumnType("integer"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("IsVerified") .HasColumnType("boolean"); b.Property("Lat") .HasColumnType("double precision"); b.Property("Lng") .HasColumnType("double precision"); b.Property("Name") .IsRequired() .HasMaxLength(200) .HasColumnType("character varying(200)"); b.Property("OwnerUserId") .HasColumnType("integer"); b.Property("Phone") .HasMaxLength(20) .HasColumnType("character varying(20)"); b.Property("Type") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("CityId"); b.HasIndex("OwnerUserId"); b.ToTable("Facilities"); }); modelBuilder.Entity("JobsMedical.Web.Models.RawListing", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("FetchedAt") .HasColumnType("timestamp with time zone"); b.Property("LinkedShiftId") .HasColumnType("integer"); b.Property("ParsedJson") .HasColumnType("text"); b.Property("RawText") .IsRequired() .HasColumnType("text"); b.Property("SourceChannel") .IsRequired() .HasMaxLength(200) .HasColumnType("character varying(200)"); b.Property("SourceUrl") .HasMaxLength(500) .HasColumnType("character varying(500)"); b.Property("Status") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("LinkedShiftId"); b.ToTable("RawListings"); }); modelBuilder.Entity("JobsMedical.Web.Models.Shift", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("Date") .HasColumnType("date"); b.Property("Description") .HasMaxLength(1500) .HasColumnType("character varying(1500)"); b.Property("EndTime") .HasColumnType("time without time zone"); b.Property("FacilityId") .HasColumnType("integer"); b.Property("PayAmount") .HasColumnType("bigint"); b.Property("PayType") .HasColumnType("integer"); b.Property("ShiftType") .HasColumnType("integer"); b.Property("Source") .HasColumnType("integer"); b.Property("SourceUrl") .HasMaxLength(500) .HasColumnType("character varying(500)"); b.Property("SpecialtyRequired") .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("StartTime") .HasColumnType("time without time zone"); b.Property("Status") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("FacilityId"); b.HasIndex("Date", "Status"); b.ToTable("Shifts"); }); modelBuilder.Entity("JobsMedical.Web.Models.User", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("FullName") .HasMaxLength(150) .HasColumnType("character varying(150)"); b.Property("IsPhoneVerified") .HasColumnType("boolean"); b.Property("Phone") .IsRequired() .HasMaxLength(20) .HasColumnType("character varying(20)"); b.Property("Role") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("Phone") .IsUnique(); b.ToTable("Users"); }); modelBuilder.Entity("JobsMedical.Web.Models.Application", b => { b.HasOne("JobsMedical.Web.Models.User", "Doctor") .WithMany("Applications") .HasForeignKey("DoctorId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("JobsMedical.Web.Models.Shift", "Shift") .WithMany("Applications") .HasForeignKey("ShiftId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Doctor"); b.Navigation("Shift"); }); modelBuilder.Entity("JobsMedical.Web.Models.DoctorProfile", b => { b.HasOne("JobsMedical.Web.Models.City", "City") .WithMany() .HasForeignKey("CityId"); b.HasOne("JobsMedical.Web.Models.User", "User") .WithOne("DoctorProfile") .HasForeignKey("JobsMedical.Web.Models.DoctorProfile", "UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("City"); b.Navigation("User"); }); modelBuilder.Entity("JobsMedical.Web.Models.Facility", b => { b.HasOne("JobsMedical.Web.Models.City", "City") .WithMany("Facilities") .HasForeignKey("CityId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("JobsMedical.Web.Models.User", "OwnerUser") .WithMany() .HasForeignKey("OwnerUserId") .OnDelete(DeleteBehavior.SetNull); b.Navigation("City"); b.Navigation("OwnerUser"); }); modelBuilder.Entity("JobsMedical.Web.Models.RawListing", b => { b.HasOne("JobsMedical.Web.Models.Shift", "LinkedShift") .WithMany() .HasForeignKey("LinkedShiftId"); b.Navigation("LinkedShift"); }); modelBuilder.Entity("JobsMedical.Web.Models.Shift", b => { b.HasOne("JobsMedical.Web.Models.Facility", "Facility") .WithMany("Shifts") .HasForeignKey("FacilityId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Facility"); }); modelBuilder.Entity("JobsMedical.Web.Models.City", b => { b.Navigation("Facilities"); }); modelBuilder.Entity("JobsMedical.Web.Models.Facility", b => { b.Navigation("Shifts"); }); modelBuilder.Entity("JobsMedical.Web.Models.Shift", b => { b.Navigation("Applications"); }); modelBuilder.Entity("JobsMedical.Web.Models.User", b => { b.Navigation("Applications"); b.Navigation("DoctorProfile"); }); #pragma warning restore 612, 618 } } }