adding completions

This commit is contained in:
ntr committed 2023-08-23 13:39:13 +10:00
1 parent a69a376325
commit 8b1b4f8ac6
11 files changed
+210 -20

No files matched your search

@@ -0,0 +1,58 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Server;
#nullable disable
namespace Server.Migrations
{
[DbContext(typeof(SpaceRaceDbContext))]
[Migration("20230823032740_Beginninging")]
partial class Beginninging
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.10")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Server.Completion", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTimeOffset>("Date")
.HasColumnType("timestamp with time zone");
b.Property<string>("Map")
.IsRequired()
.HasColumnType("text");
b.Property<double>("Time")
.HasColumnType("double precision");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("Map");
b.HasIndex("UserId");
b.ToTable("Completions");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,47 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Server.Migrations
{
/// <inheritdoc />
public partial class Beginninging : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Completions",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Date = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
UserId = table.Column<Guid>(type: "uuid", nullable: false),
Map = table.Column<string>(type: "text", nullable: false),
Time = table.Column<double>(type: "double precision", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Completions", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_Completions_Map",
table: "Completions",
column: "Map");
migrationBuilder.CreateIndex(
name: "IX_Completions_UserId",
table: "Completions",
column: "UserId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Completions");
}
}
}
@@ -0,0 +1,55 @@
// <auto-generated />
using System;
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.Completion", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTimeOffset>("Date")
.HasColumnType("timestamp with time zone");
b.Property<string>("Map")
.IsRequired()
.HasColumnType("text");
b.Property<double>("Time")
.HasColumnType("double precision");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("Map");
b.HasIndex("UserId");
b.ToTable("Completions");
});
#pragma warning restore 612, 618
}
}
}