Rob / Infrastructure /Migrations /20251029125158_FileSystem.Designer.cs
danylokhodus's picture
Initial clean backend commit
70556b7
Raw
History Blame Contribute Delete
11.7 kB
// <auto-generated />
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
{
/// <inheritdoc />
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<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ContentType")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("FilePath")
.IsRequired()
.HasColumnType("TEXT");
b.Property<long>("FileSize")
.HasColumnType("INTEGER");
b.Property<int?>("OrderId")
.HasColumnType("INTEGER");
b.Property<DateTime>("UploadedAt")
.HasColumnType("TEXT");
b.Property<int?>("UserId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("OrderId");
b.ToTable("Files");
});
modelBuilder.Entity("Entities.Models.Node", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<double>("Latitude")
.HasColumnType("REAL");
b.Property<double>("Longitude")
.HasColumnType("REAL");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("Nodes");
});
modelBuilder.Entity("Entities.Models.Order", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTime?>("CompletedAt")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedAt")
.HasColumnType("TEXT");
b.Property<decimal>("DeliveryPrice")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("DropoffNodeId")
.HasColumnType("INTEGER");
b.Property<bool>("IsProductPaid")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("PickupNodeId")
.HasColumnType("INTEGER");
b.Property<decimal>("ProductPrice")
.HasColumnType("TEXT");
b.Property<int>("RecipientId")
.HasColumnType("INTEGER");
b.Property<int?>("RobotId")
.HasColumnType("INTEGER");
b.Property<int>("SenderId")
.HasColumnType("INTEGER");
b.Property<int>("Status")
.HasColumnType("INTEGER");
b.Property<double>("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<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("AccessKeyHash")
.HasColumnType("TEXT");
b.Property<double>("BatteryLevel")
.HasColumnType("REAL");
b.Property<double?>("CurrentLatitude")
.HasColumnType("REAL");
b.Property<double?>("CurrentLongitude")
.HasColumnType("REAL");
b.Property<int?>("CurrentNodeId")
.HasColumnType("INTEGER");
b.Property<string>("Model")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("SerialNumber")
.HasColumnType("TEXT");
b.Property<int>("Status")
.HasColumnType("INTEGER");
b.Property<int?>("TargetNodeId")
.HasColumnType("INTEGER");
b.Property<int>("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<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("GoogleId")
.HasColumnType("TEXT");
b.Property<string>("PasswordHash")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int?>("PersonalNodeId")
.HasColumnType("INTEGER");
b.Property<string>("PhoneNumber")
.HasColumnType("TEXT");
b.Property<int?>("ProfilePhotoId")
.HasColumnType("INTEGER");
b.Property<int?>("Role")
.HasColumnType("INTEGER");
b.Property<string>("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
}
}
}