//
using System;
using Infrastructure;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Infrastructure.Migrations
{
[DbContext(typeof(MyDbContext))]
[Migration("20251029125158_FileSystem")]
partial class FileSystem
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "9.0.9");
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.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("DeliveryPrice")
.HasColumnType("TEXT");
b.Property("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property("DropoffNodeId")
.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("BatteryLevel")
.HasColumnType("REAL");
b.Property("CurrentLatitude")
.HasColumnType("REAL");
b.Property("CurrentLongitude")
.HasColumnType("REAL");
b.Property("CurrentNodeId")
.HasColumnType("INTEGER");
b.Property("Model")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Name")
.IsRequired()
.HasColumnType("TEXT");
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.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
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.File", b =>
{
b.HasOne("Entities.Models.Order", "Order")
.WithMany("Images")
.HasForeignKey("OrderId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("Order");
});
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("ReceivedOrders");
b.Navigation("SentOrders");
});
#pragma warning restore 612, 618
}
}
}