201 lines
6.9 KiB
C#
201 lines
6.9 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using LogisticsApp.Server.Data;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace LogisticsApp.Server.Migrations
|
|
{
|
|
[DbContext(typeof(ApplicationDbContext))]
|
|
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "8.0.0")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("LogisticsApp.Server.Models.Order", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Address")
|
|
.IsRequired()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("character varying(500)");
|
|
|
|
b.Property<string>("ClientName")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("character varying(200)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<decimal>("OrderCost")
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<DateTime>("OrderDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Status")
|
|
.IsRequired()
|
|
.HasMaxLength(20)
|
|
.HasColumnType("character varying(20)");
|
|
|
|
b.Property<DateTime?>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ClientName");
|
|
|
|
b.HasIndex("OrderDate");
|
|
|
|
b.HasIndex("Status");
|
|
|
|
b.ToTable("Orders");
|
|
});
|
|
|
|
modelBuilder.Entity("LogisticsApp.Server.Models.User", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Role")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Username")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("character varying(50)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Username")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Users");
|
|
});
|
|
|
|
modelBuilder.Entity("LogisticsApp.Server.Models.Vehicle", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("DriverName")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("character varying(100)");
|
|
|
|
b.Property<string>("LicensePlate")
|
|
.IsRequired()
|
|
.HasMaxLength(20)
|
|
.HasColumnType("character varying(20)");
|
|
|
|
b.Property<string>("VehicleType")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("character varying(50)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("LicensePlate");
|
|
|
|
b.ToTable("Vehicles");
|
|
});
|
|
|
|
modelBuilder.Entity("LogisticsApp.Server.Models.WaybillEntry", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateOnly>("Date")
|
|
.HasColumnType("date");
|
|
|
|
b.Property<string>("EndTime")
|
|
.IsRequired()
|
|
.HasMaxLength(5)
|
|
.HasColumnType("character varying(5)");
|
|
|
|
b.Property<int>("OrderId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("StartTime")
|
|
.IsRequired()
|
|
.HasMaxLength(5)
|
|
.HasColumnType("character varying(5)");
|
|
|
|
b.Property<int>("VehicleId")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("OrderId");
|
|
|
|
b.HasIndex("VehicleId", "Date");
|
|
|
|
b.ToTable("WaybillEntries");
|
|
});
|
|
|
|
modelBuilder.Entity("LogisticsApp.Server.Models.WaybillEntry", b =>
|
|
{
|
|
b.HasOne("LogisticsApp.Server.Models.Order", "Order")
|
|
.WithMany()
|
|
.HasForeignKey("OrderId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("LogisticsApp.Server.Models.Vehicle", "Vehicle")
|
|
.WithMany()
|
|
.HasForeignKey("VehicleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Order");
|
|
|
|
b.Navigation("Vehicle");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|