//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using vendorApproverBackend.Data;
#nullable disable
namespace vendorApproverBackend.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20250925132220_AddAttributesToUser")]
partial class AddAttributesToUser
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.9")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("vendorApproverBackend.Entities.FileModel", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Description")
.HasColumnType("text")
.HasColumnName("description");
b.Property("Name")
.HasColumnType("text")
.HasColumnName("file_name");
b.Property("Range")
.HasColumnType("integer")
.HasColumnName("range");
b.Property("Share")
.HasColumnType("boolean")
.HasColumnName("share");
b.Property("Size")
.HasColumnType("bigint")
.HasColumnName("file_size");
b.Property("Timestamp")
.HasColumnType("timestamp with time zone")
.HasColumnName("timestmp");
b.Property("Type")
.HasColumnType("text")
.HasColumnName("file_type");
b.Property("Url")
.IsRequired()
.HasColumnType("text")
.HasColumnName("file_url");
b.HasKey("Id");
b.ToTable("File_model");
});
modelBuilder.Entity("vendorApproverBackend.Entities.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnName("user_id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Active")
.HasColumnType("boolean")
.HasColumnName("active");
b.Property("City")
.HasColumnType("text")
.HasColumnName("city");
b.Property("Country")
.HasColumnType("text")
.HasColumnName("country");
b.Property("Deleted")
.HasColumnType("boolean")
.HasColumnName("deleted");
b.Property("Email")
.IsRequired()
.HasColumnType("text")
.HasColumnName("email");
b.Property("LastOtp")
.HasColumnType("text")
.HasColumnName("otp");
b.Property("Name")
.IsRequired()
.HasColumnType("text")
.HasColumnName("name");
b.Property("Password")
.IsRequired()
.HasColumnType("text")
.HasColumnName("password");
b.Property("PhoneNumber")
.IsRequired()
.HasColumnType("text")
.HasColumnName("phone_number");
b.Property("Role")
.HasColumnType("integer")
.HasColumnName("role");
b.Property("Status")
.HasColumnType("boolean")
.HasColumnName("blocked");
b.Property("Timestamp")
.HasColumnType("timestamp with time zone")
.HasColumnName("timestmp");
b.Property("Username")
.IsRequired()
.HasColumnType("text")
.HasColumnName("user_name");
b.Property("user_device")
.HasColumnType("bigint");
b.Property("users_profile_media")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("Email")
.IsUnique();
b.HasIndex("PhoneNumber")
.IsUnique();
b.HasIndex("Username")
.IsUnique();
b.HasIndex("user_device")
.IsUnique();
b.HasIndex("users_profile_media")
.IsUnique();
b.ToTable("users_table", (string)null);
});
modelBuilder.Entity("vendorApproverBackend.Entities.UserDevice", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("DeviceId")
.HasColumnType("text")
.HasColumnName("device_Id");
b.Property("DeviceType")
.HasColumnType("text")
.HasColumnName("deviceType");
b.Property("Ip")
.HasColumnType("text")
.HasColumnName("ip");
b.Property("LastJwt")
.HasColumnType("text")
.HasColumnName("token");
b.Property("PushNotificationToken")
.HasColumnType("text")
.HasColumnName("tokendevice");
b.Property("Timestamp")
.HasColumnType("timestamp with time zone")
.HasColumnName("timestmp");
b.HasKey("Id");
b.ToTable("UserDevice");
});
modelBuilder.Entity("vendorApproverBackend.Entities.Vendor", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CommercialRegistrationNo")
.HasColumnType("text")
.HasColumnName("Commercial_registratio_no");
b.Property("LocalAgentName")
.HasColumnType("text")
.HasColumnName("Local_agent_name");
b.Property("LocalAgentPhone")
.HasColumnType("text")
.HasColumnName("Local_agent_phone");
b.Property("ManifactoryName")
.HasColumnType("text")
.HasColumnName("manifactory_name");
b.Property("PartnerCompany")
.HasColumnType("text")
.HasColumnName("partner_company");
b.Property("Position")
.HasColumnType("text")
.HasColumnName("position");
b.Property("RepresentativeEmail")
.HasColumnType("text")
.HasColumnName("representative_email");
b.Property("RepresentativeName")
.HasColumnType("text")
.HasColumnName("representative_name");
b.Property("Timestamp")
.HasColumnType("timestamp with time zone")
.HasColumnName("timestmp");
b.Property("UserId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("UserId")
.IsUnique();
b.ToTable("Vendors");
});
modelBuilder.Entity("vendorApproverBackend.Entities.User", b =>
{
b.HasOne("vendorApproverBackend.Entities.UserDevice", "Device")
.WithOne()
.HasForeignKey("vendorApproverBackend.Entities.User", "user_device")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("vendorApproverBackend.Entities.FileModel", "Image")
.WithOne()
.HasForeignKey("vendorApproverBackend.Entities.User", "users_profile_media")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("Device");
b.Navigation("Image");
});
modelBuilder.Entity("vendorApproverBackend.Entities.Vendor", b =>
{
b.HasOne("vendorApproverBackend.Entities.User", "User")
.WithOne("Vendor")
.HasForeignKey("vendorApproverBackend.Entities.Vendor", "UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("vendorApproverBackend.Entities.User", b =>
{
b.Navigation("Vendor");
});
#pragma warning restore 612, 618
}
}
}