Files
spacerace/Server/Migrations/20230831064847_Initialisation.cs
2023-08-31 16:55:31 +10:00

63 lines
3.0 KiB
C#

using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Server.Migrations
{
/// <inheritdoc />
public partial class Initialisation : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Laps",
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),
Sectors = table.Column<List<double>>(type: "double precision[]", nullable: false),
Map = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Laps", x => x.Id);
});
migrationBuilder.InsertData(
table: "Laps",
columns: new[] { "Id", "Created", "Map", "Sectors", "Time", "UserId" },
values: new object[,]
{
{ new Guid("a5f5815a-2ba5-4b9f-8f45-fe41f5b20102"), new DateTimeOffset(new DateTime(2023, 8, 31, 6, 48, 46, 941, DateTimeKind.Unspecified).AddTicks(8875), new TimeSpan(0, 0, 0, 0, 0)), "sr_junglism", new List<double> { 64.0, 64.0, 128.0 }, 256.0, new Guid("22222222-2222-2222-2222-222222222222") },
{ new Guid("be3d3d80-a0c3-4aff-b373-711b6eb2c9f3"), new DateTimeOffset(new DateTime(2023, 8, 31, 6, 48, 46, 941, DateTimeKind.Unspecified).AddTicks(8821), new TimeSpan(0, 0, 0, 0, 0)), "sr_testtrack", new List<double> { 64.0, 24.0, 24.0 }, 128.0, new Guid("11111111-1111-1111-1111-111111111111") },
{ new Guid("d2a3e508-8a8e-4959-8103-67c60567e294"), new DateTimeOffset(new DateTime(2023, 8, 31, 6, 48, 46, 941, DateTimeKind.Unspecified).AddTicks(8882), new TimeSpan(0, 0, 0, 0, 0)), "sr_silverstorage", new List<double> { 64.0, 64.0, 128.0 }, 256.0, new Guid("33333333-3333-3333-3333-333333333333") }
});
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");
}
}
}