using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace ReallifeGamemode.Database.Migrations { public partial class BusRoutes : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "BusRoutes", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Description = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_BusRoutes", x => x.Id); }); migrationBuilder.CreateTable( name: "BusRoutesPoints", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Description = table.Column(nullable: true), X = table.Column(nullable: false), Y = table.Column(nullable: false), Z = table.Column(nullable: false), BusRouteId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_BusRoutesPoints", x => x.Id); table.ForeignKey( name: "FK_BusRoutesPoints_BusRoutes_BusRouteId", column: x => x.BusRouteId, principalTable: "BusRoutes", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_BusRoutesPoints_BusRouteId", table: "BusRoutesPoints", column: "BusRouteId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "BusRoutesPoints"); migrationBuilder.DropTable( name: "BusRoutes"); } } }