168 lines
6.1 KiB
C#
168 lines
6.1 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Nashel.Modules.Order.Infrastructure.Persistence;
|
|
using NetTopologySuite.Geometries;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace Nashel.Modules.Order.Infrastructure.Migrations
|
|
{
|
|
[DbContext(typeof(OrderDbContext))]
|
|
[Migration("20260210192734_InitialCreate")]
|
|
partial class InitialCreate
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasDefaultSchema("ordering")
|
|
.HasAnnotation("ProductVersion", "10.0.2")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "postgis");
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("Nashel.Modules.Order.Domain.Aggregates.Order", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("CustomerId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime?>("Deadline")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<uint>("RowVersion")
|
|
.IsConcurrencyToken()
|
|
.ValueGeneratedOnAddOrUpdate()
|
|
.HasColumnType("xid")
|
|
.HasColumnName("xmin");
|
|
|
|
b.Property<Guid?>("SelectedPerformerId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("ServiceId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Status")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Type")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Orders", "ordering");
|
|
});
|
|
|
|
modelBuilder.Entity("Nashel.Modules.Order.Domain.Entities.OrderApplication", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Comment")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<Guid?>("OrderId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("PerformerId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("OrderId");
|
|
|
|
b.ToTable("OrderApplications", "ordering");
|
|
});
|
|
|
|
modelBuilder.Entity("Nashel.Modules.Order.Domain.Aggregates.Order", b =>
|
|
{
|
|
b.OwnsOne("Nashel.Modules.Order.Domain.ValueObjects.OrderLocation", "Location", b1 =>
|
|
{
|
|
b1.Property<Guid>("OrderId")
|
|
.HasColumnType("uuid");
|
|
|
|
b1.Property<string>("Address")
|
|
.IsRequired()
|
|
.HasColumnType("text")
|
|
.HasColumnName("Address");
|
|
|
|
b1.Property<Point>("Point")
|
|
.IsRequired()
|
|
.HasColumnType("geography (point)");
|
|
|
|
b1.HasKey("OrderId");
|
|
|
|
b1.HasIndex("Point");
|
|
|
|
NpgsqlIndexBuilderExtensions.HasMethod(b1.HasIndex("Point"), "gist");
|
|
|
|
b1.ToTable("Orders", "ordering");
|
|
|
|
b1.WithOwner()
|
|
.HasForeignKey("OrderId");
|
|
});
|
|
|
|
b.Navigation("Location")
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Nashel.Modules.Order.Domain.Entities.OrderApplication", b =>
|
|
{
|
|
b.HasOne("Nashel.Modules.Order.Domain.Aggregates.Order", null)
|
|
.WithMany("Applications")
|
|
.HasForeignKey("OrderId")
|
|
.OnDelete(DeleteBehavior.Cascade);
|
|
|
|
b.OwnsOne("Nashel.Modules.Order.Domain.ValueObjects.Money", "Price", b1 =>
|
|
{
|
|
b1.Property<Guid>("OrderApplicationId")
|
|
.HasColumnType("uuid");
|
|
|
|
b1.Property<decimal>("Amount")
|
|
.HasColumnType("numeric")
|
|
.HasColumnName("PriceAmount");
|
|
|
|
b1.Property<string>("Currency")
|
|
.IsRequired()
|
|
.HasMaxLength(3)
|
|
.HasColumnType("character varying(3)")
|
|
.HasColumnName("PriceCurrency");
|
|
|
|
b1.HasKey("OrderApplicationId");
|
|
|
|
b1.ToTable("OrderApplications", "ordering");
|
|
|
|
b1.WithOwner()
|
|
.HasForeignKey("OrderApplicationId");
|
|
});
|
|
|
|
b.Navigation("Price")
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Nashel.Modules.Order.Domain.Aggregates.Order", b =>
|
|
{
|
|
b.Navigation("Applications");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|