Initial commit

This commit is contained in:
2020-04-13 15:16:46 +01:00
commit 17a40cb95f
81 changed files with 10120 additions and 0 deletions
@@ -0,0 +1,149 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace AutoBet.Db.Migrations
{
public partial class RaceDetail : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Races",
columns: table => new
{
Id = table.Column<string>(nullable: false),
DistanceChangeText = table.Column<string>(nullable: true),
BlackTypeRace = table.Column<int>(nullable: false),
AbandonedReasonCode = table.Column<int>(nullable: false),
RaceCriteriaRaceType = table.Column<string>(nullable: true),
DistanceChange = table.Column<string>(nullable: true),
DistanceText = table.Column<string>(nullable: true),
DistanceValue = table.Column<int>(nullable: false),
DistanceUnits = table.Column<string>(nullable: true),
RawDistanceText = table.Column<string>(nullable: true),
RatingBand = table.Column<string>(nullable: true),
RaceClass = table.Column<int>(nullable: false),
PrizeCurrency = table.Column<string>(nullable: true),
PrizeAmount = table.Column<int>(nullable: false),
AgeLimit = table.Column<string>(nullable: true),
RaceName = table.Column<string>(nullable: true),
RaceTime = table.Column<TimeSpan>(nullable: false),
RaceDate = table.Column<DateTime>(nullable: false),
DivisionSequence = table.Column<int>(nullable: false),
YearOfRace = table.Column<int>(nullable: false),
RaceId = table.Column<int>(nullable: false),
Plus10 = table.Column<bool>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Races", x => x.Id);
});
migrationBuilder.CreateTable(
name: "RunnerResults",
columns: table => new
{
Id = table.Column<string>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_RunnerResults", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Runners",
columns: table => new
{
Id = table.Column<string>(nullable: false),
HeadGearWearingCode = table.Column<string>(nullable: true),
HeadGearWearingSheepSkin = table.Column<int>(nullable: false),
HeadGearDescription = table.Column<string>(nullable: true),
HeadGearAbbreviation = table.Column<string>(nullable: true),
JockeyProfile = table.Column<int>(nullable: false),
CourseWinner = table.Column<string>(nullable: true),
DistanceWinner = table.Column<string>(nullable: true),
WindSurgeryFirstRun = table.Column<string>(nullable: true),
TrainerId = table.Column<int>(nullable: false),
TrainerName = table.Column<string>(nullable: true),
OwnerId = table.Column<int>(nullable: false),
OwnerName = table.Column<string>(nullable: true),
WbSilkCode = table.Column<string>(nullable: true),
WbSilkDescription = table.Column<string>(nullable: true),
SilkImage = table.Column<string>(nullable: true),
Plus10 = table.Column<int>(nullable: false),
ForecastPriceNumerator = table.Column<string>(nullable: true),
ForecastPriceDenominator = table.Column<string>(nullable: true),
WeightText = table.Column<string>(nullable: true),
WeightsJockeyClaiming = table.Column<int>(nullable: false),
Odds = table.Column<string>(nullable: true),
JockeyName = table.Column<string>(nullable: true),
Status = table.Column<int>(nullable: false),
RaceId = table.Column<int>(nullable: false),
YearOfRace = table.Column<int>(nullable: false),
DivisionSequence = table.Column<int>(nullable: false),
AnimalId = table.Column<int>(nullable: false),
RacehorseName = table.Column<string>(nullable: true),
AgeYears = table.Column<int>(nullable: false),
Bred = table.Column<string>(nullable: true),
ClothNumber = table.Column<int>(nullable: false),
DrawnStall = table.Column<int>(nullable: true),
ReserveNumber = table.Column<string>(nullable: true),
BhaRating = table.Column<string>(nullable: true),
FormFigures = table.Column<string>(nullable: true),
WeightValue = table.Column<string>(nullable: true),
PenaltyValue = table.Column<int>(nullable: false),
SexType = table.Column<int>(nullable: false),
NonRunnerDeclaredReason = table.Column<string>(nullable: true),
NonRunnerDeclaredDate = table.Column<string>(nullable: true),
NonRunnerDeclaredTime = table.Column<string>(nullable: true),
RunnerNumber = table.Column<int>(nullable: false),
JockeyId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Runners", x => x.Id);
});
migrationBuilder.CreateTable(
name: "LastRuns",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
RaceType = table.Column<string>(nullable: true),
Days = table.Column<int>(nullable: false),
RunnerId = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_LastRuns", x => x.Id);
table.ForeignKey(
name: "FK_LastRuns_Runners_RunnerId",
column: x => x.RunnerId,
principalTable: "Runners",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_LastRuns_RunnerId",
table: "LastRuns",
column: "RunnerId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "LastRuns");
migrationBuilder.DropTable(
name: "Races");
migrationBuilder.DropTable(
name: "RunnerResults");
migrationBuilder.DropTable(
name: "Runners");
}
}
}