Rob / Infrastructure /Migrations /MyDbContextModelSnapshot.cs
danylokhodus's picture
Add database migration for hover energy consumption
435de10
Raw
History Blame Contribute Delete
16.9 kB
// <auto-generated />
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<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTime>("CreatedAt")
.HasColumnType("TEXT");
b.Property<int>("CreatedByAdminId")
.HasColumnType("INTEGER");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<DateTime?>("ExpiresAt")
.HasColumnType("TEXT");
b.Property<bool>("IsUsed")
.HasColumnType("INTEGER");
b.Property<string>("KeyCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property<DateTime?>("UsedAt")
.HasColumnType("TEXT");
b.Property<int?>("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<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.Friendship", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTime>("CreatedAt")
.HasColumnType("TEXT");
b.Property<int>("FriendId")
.HasColumnType("INTEGER");
b.Property<int>("Status")
.HasColumnType("INTEGER");
b.Property<int>("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<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<int>("DeliveryPayer")
.HasColumnType("INTEGER");
b.Property<decimal>("DeliveryPrice")
.HasColumnType("TEXT");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("DropoffNodeId")
.HasColumnType("INTEGER");
b.Property<bool>("IsDeliveryPaid")
.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>("BatteryCapacityJoules")
.HasColumnType("REAL");
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<double>("EnergyConsumptionPerMeterJoules")
.HasColumnType("REAL");
b.Property<double>("HoverConsumptionPerSecondJoules")
.HasColumnType("REAL");
b.Property<string>("IpAddress")
.HasColumnType("TEXT");
b.Property<string>("Model")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int?>("Port")
.HasColumnType("INTEGER");
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.SystemSetting", b =>
{
b.Property<string>("Key")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("TEXT");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Key");
b.ToTable("SystemSettings");
});
modelBuilder.Entity("Entities.Models.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<decimal>("Balance")
.HasColumnType("TEXT");
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.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
}
}
}