80 lines
3.5 KiB
C#
80 lines
3.5 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
|
|
|
namespace Server.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class Beginninging : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "Laps",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Created = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
|
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Time = table.Column<double>(type: "double precision", nullable: false),
|
|
Map = table.Column<string>(type: "text", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Laps", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "PbDTO",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Created = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
|
Time = table.Column<double>(type: "double precision", nullable: false),
|
|
Map = table.Column<string>(type: "text", nullable: true),
|
|
Completions = table.Column<int>(type: "integer", nullable: false),
|
|
Position = table.Column<int>(type: "integer", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
});
|
|
|
|
migrationBuilder.InsertData(
|
|
table: "Laps",
|
|
columns: new[] { "Id", "Created", "Map", "Time", "UserId" },
|
|
values: new object[,]
|
|
{
|
|
{ new Guid("42ee5177-d287-4ea1-91ed-ddd1d596e81f"), new DateTimeOffset(new DateTime(2023, 8, 29, 6, 24, 56, 272, DateTimeKind.Unspecified).AddTicks(1375), new TimeSpan(0, 0, 0, 0, 0)), "sr_TestTrack", 128.0, new Guid("11111111-1111-1111-1111-111111111111") },
|
|
{ new Guid("69002b76-54e2-455f-99aa-2fdb7f11c130"), new DateTimeOffset(new DateTime(2023, 8, 29, 6, 24, 56, 272, DateTimeKind.Unspecified).AddTicks(1471), new TimeSpan(0, 0, 0, 0, 0)), "sr_TestTrack", 148.0, new Guid("33333333-3333-3333-3333-333333333333") },
|
|
{ new Guid("81eb5dcb-1dd4-483b-993e-e73e1b95c5ff"), new DateTimeOffset(new DateTime(2023, 8, 29, 6, 24, 56, 272, DateTimeKind.Unspecified).AddTicks(1459), new TimeSpan(0, 0, 0, 0, 0)), "sr_TestTrack", 132.0, new Guid("22222222-2222-2222-2222-222222222222") }
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Laps_Map",
|
|
table: "Laps",
|
|
column: "Map");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Laps_UserId_Map",
|
|
table: "Laps",
|
|
columns: new[] { "UserId", "Map" },
|
|
unique: true);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "Laps");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "PbDTO");
|
|
}
|
|
}
|
|
}
|