16160f6424
Initial version of the data model Includes EF initialization and migrations EF migrations are applied on application start
72 lines
2.0 KiB
C#
72 lines
2.0 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace TournamentOrganizer.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class TournamentStartEnd : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "WinnerId",
|
|
table: "Rounds");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "EventStart",
|
|
table: "Events",
|
|
newName: "Start");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "EventEnd",
|
|
table: "Events",
|
|
newName: "End");
|
|
|
|
migrationBuilder.AddColumn<DateTime>(
|
|
name: "End",
|
|
table: "Tournaments",
|
|
type: "TEXT",
|
|
nullable: false,
|
|
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
|
|
|
migrationBuilder.AddColumn<DateTime>(
|
|
name: "Start",
|
|
table: "Tournaments",
|
|
type: "TEXT",
|
|
nullable: false,
|
|
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "End",
|
|
table: "Tournaments");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "Start",
|
|
table: "Tournaments");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "Start",
|
|
table: "Events",
|
|
newName: "EventStart");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "End",
|
|
table: "Events",
|
|
newName: "EventEnd");
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "WinnerId",
|
|
table: "Rounds",
|
|
type: "INTEGER",
|
|
nullable: true);
|
|
}
|
|
}
|
|
}
|