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("be83b30b-15f0-4013-95c1-d4c71ac602f9"), new DateTimeOffset(new DateTime(2023, 8, 29, 3, 0, 53, 704, DateTimeKind.Unspecified).AddTicks(7873), new TimeSpan(0, 0, 0, 0, 0)), "sr_TestTrack", 132.0, new Guid("3620fbda-a45a-4eec-824b-9a6c77e9dbfd") },
|
|
{ new Guid("cb42e7cb-02c4-4725-8d41-a62fa3868d67"), new DateTimeOffset(new DateTime(2023, 8, 29, 3, 0, 53, 704, DateTimeKind.Unspecified).AddTicks(7881), new TimeSpan(0, 0, 0, 0, 0)), "sr_TestTrack", 148.0, new Guid("b3a23d2c-ee77-4122-9086-50a884bf49b5") },
|
|
{ new Guid("dd85f455-658c-4e39-b77e-a8f227c3d0cf"), new DateTimeOffset(new DateTime(2023, 8, 29, 3, 0, 53, 704, DateTimeKind.Unspecified).AddTicks(7826), new TimeSpan(0, 0, 0, 0, 0)), "sr_TestTrack", 128.0, new Guid("a6e068ac-5aaa-48f2-adf5-ca30963d2f9d") }
|
|
});
|
|
|
|
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");
|
|
}
|
|
}
|
|
}
|