hanf continuation

This commit is contained in:
hydrant
2021-05-25 20:10:58 +02:00
parent a49fcf09c7
commit 3abf2a2d0e
13 changed files with 2681 additions and 8 deletions

View File

@@ -0,0 +1,47 @@
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<long>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
PlantDate = table.Column<DateTime>(nullable: false),
X = table.Column<float>(nullable: false),
Y = table.Column<float>(nullable: false),
Z = table.Column<float>(nullable: false),
Harvested = table.Column<bool>(nullable: false),
PlantedById = table.Column<int>(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");
}
}
}