using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace ReallifeGamemode.Database.Migrations { public partial class AddCannabisPlants : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "CannabisPlants", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), PlantDate = table.Column(nullable: false), X = table.Column(nullable: false), Y = table.Column(nullable: false), Z = table.Column(nullable: false), Harvested = table.Column(nullable: false), PlantedById = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_CannabisPlants", x => x.Id); table.ForeignKey( name: "FK_CannabisPlants_Users_PlantedById", column: x => x.PlantedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_CannabisPlants_PlantedById", table: "CannabisPlants", column: "PlantedById"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "CannabisPlants"); } } }