//
using System;
using Infrastructure;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Infrastructure.Migrations
{
[DbContext(typeof(MyDbContext))]
partial class MyDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "9.0.9");
modelBuilder.Entity("Entities.Models.AdminKey", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("CreatedByAdminId")
.HasColumnType("INTEGER");
b.Property("Description")
.HasColumnType("TEXT");
b.Property("ExpiresAt")
.HasColumnType("TEXT");
b.Property("IsUsed")
.HasColumnType("INTEGER");
b.Property("KeyCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property("UsedAt")
.HasColumnType("TEXT");
b.Property("UsedByUserId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("CreatedByAdminId");
b.HasIndex("KeyCode")
.IsUnique();
b.HasIndex("UsedByUserId");
b.ToTable("AdminKeys");
});
modelBuilder.Entity("Entities.Models.File", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("ContentType")
.IsRequired()
.HasColumnType("TEXT");
b.Property("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property("FilePath")
.IsRequired()
.HasColumnType("TEXT");
b.Property("FileSize")
.HasColumnType("INTEGER");
b.Property("OrderId")
.HasColumnType("INTEGER");
b.Property("UploadedAt")
.HasColumnType("TEXT");
b.Property("UserId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("OrderId");
b.ToTable("Files");
});
modelBuilder.Entity("Entities.Models.Friendship", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("FriendId")
.HasColumnType("INTEGER");
b.Property("Status")
.HasColumnType("INTEGER");
b.Property("UserId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("FriendId");
b.HasIndex("UserId", "FriendId")
.IsUnique();
b.ToTable("Friendships");
});
modelBuilder.Entity("Entities.Models.Node", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("Latitude")
.HasColumnType("REAL");
b.Property("Longitude")
.HasColumnType("REAL");
b.Property("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Type")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("Nodes");
});
modelBuilder.Entity("Entities.Models.Order", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("CompletedAt")
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("DeliveryPayer")
.HasColumnType("INTEGER");
b.Property("DeliveryPrice")
.HasColumnType("TEXT");
b.Property("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property("DropoffNodeId")
.HasColumnType("INTEGER");
b.Property("IsDeliveryPaid")
.HasColumnType("INTEGER");
b.Property("IsProductPaid")
.HasColumnType("INTEGER");
b.Property("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property("PickupNodeId")
.HasColumnType("INTEGER");
b.Property("ProductPrice")
.HasColumnType("TEXT");
b.Property("RecipientId")
.HasColumnType("INTEGER");
b.Property("RobotId")
.HasColumnType("INTEGER");
b.Property("SenderId")
.HasColumnType("INTEGER");
b.Property("Status")
.HasColumnType("INTEGER");
b.Property("Weight")
.HasColumnType("REAL");
b.HasKey("Id");
b.HasIndex("DropoffNodeId");
b.HasIndex("PickupNodeId");
b.HasIndex("RecipientId");
b.HasIndex("RobotId");
b.HasIndex("SenderId");
b.ToTable("Orders");
});
modelBuilder.Entity("Entities.Models.Robot", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("AccessKeyHash")
.HasColumnType("TEXT");
b.Property("BatteryCapacityJoules")
.HasColumnType("REAL");
b.Property("BatteryLevel")
.HasColumnType("REAL");
b.Property("CurrentLatitude")
.HasColumnType("REAL");
b.Property("CurrentLongitude")
.HasColumnType("REAL");
b.Property("CurrentNodeId")
.HasColumnType("INTEGER");
b.Property("EnergyConsumptionPerMeterJoules")
.HasColumnType("REAL");
b.Property("HoverConsumptionPerSecondJoules")
.HasColumnType("REAL");
b.Property("IpAddress")
.HasColumnType("TEXT");
b.Property("Model")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Port")
.HasColumnType("INTEGER");
b.Property("SerialNumber")
.HasColumnType("TEXT");
b.Property("Status")
.HasColumnType("INTEGER");
b.Property("TargetNodeId")
.HasColumnType("INTEGER");
b.Property("Type")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("CurrentNodeId");
b.HasIndex("SerialNumber")
.IsUnique();
b.HasIndex("TargetNodeId");
b.ToTable("Robots");
});
modelBuilder.Entity("Entities.Models.SystemSetting", b =>
{
b.Property("Key")
.HasColumnType("TEXT");
b.Property("Description")
.HasColumnType("TEXT");
b.Property("UpdatedAt")
.HasColumnType("TEXT");
b.Property("Value")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Key");
b.ToTable("SystemSettings");
});
modelBuilder.Entity("Entities.Models.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("Balance")
.HasColumnType("TEXT");
b.Property("Email")
.IsRequired()
.HasColumnType("TEXT");
b.Property("GoogleId")
.HasColumnType("TEXT");
b.Property("PasswordHash")
.IsRequired()
.HasColumnType("TEXT");
b.Property("PersonalNodeId")
.HasColumnType("INTEGER");
b.Property("PhoneNumber")
.HasColumnType("TEXT");
b.Property("ProfilePhotoId")
.HasColumnType("INTEGER");
b.Property("Role")
.HasColumnType("INTEGER");
b.Property("UserName")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("PersonalNodeId");
b.HasIndex("ProfilePhotoId")
.IsUnique();
b.ToTable("Users");
});
modelBuilder.Entity("Entities.Models.AdminKey", b =>
{
b.HasOne("Entities.Models.User", "CreatedByAdmin")
.WithMany()
.HasForeignKey("CreatedByAdminId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("Entities.Models.User", "UsedByUser")
.WithMany()
.HasForeignKey("UsedByUserId")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedByAdmin");
b.Navigation("UsedByUser");
});
modelBuilder.Entity("Entities.Models.File", b =>
{
b.HasOne("Entities.Models.Order", "Order")
.WithMany("Images")
.HasForeignKey("OrderId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("Order");
});
modelBuilder.Entity("Entities.Models.Friendship", b =>
{
b.HasOne("Entities.Models.User", "Friend")
.WithMany("ReceivedFriendRequests")
.HasForeignKey("FriendId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("Entities.Models.User", "User")
.WithMany("SentFriendRequests")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Friend");
b.Navigation("User");
});
modelBuilder.Entity("Entities.Models.Order", b =>
{
b.HasOne("Entities.Models.Node", "DropoffNode")
.WithMany()
.HasForeignKey("DropoffNodeId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("Entities.Models.Node", "PickupNode")
.WithMany()
.HasForeignKey("PickupNodeId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("Entities.Models.User", "Recipient")
.WithMany("ReceivedOrders")
.HasForeignKey("RecipientId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("Entities.Models.Robot", "AssignedRobot")
.WithMany("ActiveOrders")
.HasForeignKey("RobotId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Entities.Models.User", "Sender")
.WithMany("SentOrders")
.HasForeignKey("SenderId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("AssignedRobot");
b.Navigation("DropoffNode");
b.Navigation("PickupNode");
b.Navigation("Recipient");
b.Navigation("Sender");
});
modelBuilder.Entity("Entities.Models.Robot", b =>
{
b.HasOne("Entities.Models.Node", "CurrentNode")
.WithMany()
.HasForeignKey("CurrentNodeId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Entities.Models.Node", "TargetNode")
.WithMany()
.HasForeignKey("TargetNodeId")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CurrentNode");
b.Navigation("TargetNode");
});
modelBuilder.Entity("Entities.Models.User", b =>
{
b.HasOne("Entities.Models.Node", "PersonalNode")
.WithMany()
.HasForeignKey("PersonalNodeId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("Entities.Models.File", "ProfilePhoto")
.WithOne("User")
.HasForeignKey("Entities.Models.User", "ProfilePhotoId")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("PersonalNode");
b.Navigation("ProfilePhoto");
});
modelBuilder.Entity("Entities.Models.File", b =>
{
b.Navigation("User");
});
modelBuilder.Entity("Entities.Models.Order", b =>
{
b.Navigation("Images");
});
modelBuilder.Entity("Entities.Models.Robot", b =>
{
b.Navigation("ActiveOrders");
});
modelBuilder.Entity("Entities.Models.User", b =>
{
b.Navigation("ReceivedFriendRequests");
b.Navigation("ReceivedOrders");
b.Navigation("SentFriendRequests");
b.Navigation("SentOrders");
});
#pragma warning restore 612, 618
}
}
}