122 lines
4.8 KiB
C#
122 lines
4.8 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
using Server;
|
|
|
|
#nullable disable
|
|
|
|
namespace Server.Migrations
|
|
{
|
|
[DbContext(typeof(SpaceRaceDbContext))]
|
|
partial class SpaceRaceDbContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "7.0.10")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("Server.Lap", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTimeOffset>("Created")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Map")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<List<double>>("Sectors")
|
|
.IsRequired()
|
|
.HasColumnType("double precision[]");
|
|
|
|
b.Property<double>("Time")
|
|
.HasColumnType("double precision");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Map");
|
|
|
|
b.HasIndex("UserId", "Map")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Laps");
|
|
|
|
b.HasData(
|
|
new
|
|
{
|
|
Id = new Guid("589bfb11-59c1-4f7e-beef-973c301b8e08"),
|
|
Created = new DateTimeOffset(new DateTime(2023, 8, 29, 10, 17, 29, 656, DateTimeKind.Unspecified).AddTicks(467), new TimeSpan(0, 0, 0, 0, 0)),
|
|
Map = "sr_testtrack",
|
|
Sectors = new List<double> { 64.0, 24.0, 24.0 },
|
|
Time = 128.0,
|
|
UserId = new Guid("11111111-1111-1111-1111-111111111111")
|
|
},
|
|
new
|
|
{
|
|
Id = new Guid("67bda0f2-ecf8-4521-ba21-08d252d9ce59"),
|
|
Created = new DateTimeOffset(new DateTime(2023, 8, 29, 10, 17, 29, 656, DateTimeKind.Unspecified).AddTicks(723), new TimeSpan(0, 0, 0, 0, 0)),
|
|
Map = "sr_testtrack",
|
|
Sectors = new List<double> { 64.0, 38.0, 24.0 },
|
|
Time = 132.0,
|
|
UserId = new Guid("22222222-2222-2222-2222-222222222222")
|
|
},
|
|
new
|
|
{
|
|
Id = new Guid("678183de-9df4-4d98-9807-f288b54a7f3a"),
|
|
Created = new DateTimeOffset(new DateTime(2023, 8, 29, 10, 17, 29, 656, DateTimeKind.Unspecified).AddTicks(745), new TimeSpan(0, 0, 0, 0, 0)),
|
|
Map = "sr_testtrack",
|
|
Sectors = new List<double> { 64.0, 64.0, 24.0 },
|
|
Time = 148.0,
|
|
UserId = new Guid("33333333-3333-3333-3333-333333333333")
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("SpaceRace.Shared.PbDTO", b =>
|
|
{
|
|
b.Property<int>("Completions")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTimeOffset>("Created")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<Guid>("Id")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Map")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("Position")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<List<double>>("Sectors")
|
|
.HasColumnType("double precision[]");
|
|
|
|
b.Property<double>("Time")
|
|
.HasColumnType("double precision");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.ToTable((string)null);
|
|
|
|
b.ToSqlQuery("WITH ranked AS (\n SELECT *, rank() OVER (ORDER BY \"Time\" ASC) AS \"Position\", COUNT(\"Id\") OVER () AS \"Completions\"\n FROM \"Laps\"\n)\n\nSELECT * FROM ranked");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|