contact-management-system / ContactManagementAPI /Migrations /20260209052719_AddSampleData.Designer.cs
deploy
Deploy restore contacts feature
fc06b79
// <auto-generated />
using System;
using ContactManagementAPI.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace ContactManagementAPI.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20260209052719_AddSampleData")]
partial class AddSampleData
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("ContactManagementAPI.Models.Contact", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Address")
.HasColumnType("nvarchar(max)");
b.Property<string>("City")
.HasColumnType("nvarchar(max)");
b.Property<string>("Country")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("Email")
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("GroupId")
.HasColumnType("int");
b.Property<string>("LastName")
.HasColumnType("nvarchar(max)");
b.Property<string>("Mobile1")
.HasColumnType("nvarchar(max)");
b.Property<string>("Mobile2")
.HasColumnType("nvarchar(max)");
b.Property<string>("Mobile3")
.HasColumnType("nvarchar(max)");
b.Property<string>("NickName")
.HasColumnType("nvarchar(max)");
b.Property<string>("OtherDetails")
.HasColumnType("nvarchar(max)");
b.Property<string>("PhotoPath")
.HasColumnType("nvarchar(max)");
b.Property<string>("PostalCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("State")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime2");
b.Property<string>("WhatsAppNumber")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("GroupId");
b.ToTable("Contacts");
});
modelBuilder.Entity("ContactManagementAPI.Models.ContactDocument", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("ContactId")
.HasColumnType("int");
b.Property<string>("ContentType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DocumentPath")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DocumentType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<long>("FileSize")
.HasColumnType("bigint");
b.Property<DateTime>("UploadedAt")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("ContactId");
b.ToTable("ContactDocuments");
});
modelBuilder.Entity("ContactManagementAPI.Models.ContactGroup", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("ContactGroups");
b.HasData(
new
{
Id = 1,
CreatedAt = new DateTime(2026, 2, 9, 10, 57, 18, 734, DateTimeKind.Local).AddTicks(8518),
Description = "Family members",
Name = "Family"
},
new
{
Id = 2,
CreatedAt = new DateTime(2026, 2, 9, 10, 57, 18, 734, DateTimeKind.Local).AddTicks(8531),
Description = "Friends",
Name = "Friends"
},
new
{
Id = 3,
CreatedAt = new DateTime(2026, 2, 9, 10, 57, 18, 734, DateTimeKind.Local).AddTicks(8533),
Description = "Business contacts",
Name = "Business"
},
new
{
Id = 4,
CreatedAt = new DateTime(2026, 2, 9, 10, 57, 18, 734, DateTimeKind.Local).AddTicks(8535),
Description = "School contacts",
Name = "School"
},
new
{
Id = 5,
CreatedAt = new DateTime(2026, 2, 9, 10, 57, 18, 734, DateTimeKind.Local).AddTicks(8537),
Description = "Church members",
Name = "Church"
},
new
{
Id = 6,
CreatedAt = new DateTime(2026, 2, 9, 10, 57, 18, 734, DateTimeKind.Local).AddTicks(8538),
Description = "Other contacts",
Name = "Others"
});
});
modelBuilder.Entity("ContactManagementAPI.Models.ContactPhoto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("ContactId")
.HasColumnType("int");
b.Property<string>("ContentType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<long>("FileSize")
.HasColumnType("bigint");
b.Property<bool>("IsProfilePhoto")
.HasColumnType("bit");
b.Property<string>("PhotoPath")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("UploadedAt")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("ContactId");
b.ToTable("ContactPhotos");
});
modelBuilder.Entity("ContactManagementAPI.Models.Contact", b =>
{
b.HasOne("ContactManagementAPI.Models.ContactGroup", "Group")
.WithMany("Contacts")
.HasForeignKey("GroupId")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("Group");
});
modelBuilder.Entity("ContactManagementAPI.Models.ContactDocument", b =>
{
b.HasOne("ContactManagementAPI.Models.Contact", "Contact")
.WithMany("Documents")
.HasForeignKey("ContactId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Contact");
});
modelBuilder.Entity("ContactManagementAPI.Models.ContactPhoto", b =>
{
b.HasOne("ContactManagementAPI.Models.Contact", "Contact")
.WithMany("Photos")
.HasForeignKey("ContactId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Contact");
});
modelBuilder.Entity("ContactManagementAPI.Models.Contact", b =>
{
b.Navigation("Documents");
b.Navigation("Photos");
});
modelBuilder.Entity("ContactManagementAPI.Models.ContactGroup", b =>
{
b.Navigation("Contacts");
});
#pragma warning restore 612, 618
}
}
}