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

File diff suppressed because it is too large Load Diff

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");
}
}
}

View File

@@ -154,6 +154,37 @@ namespace ReallifeGamemode.Database.Migrations
b.ToTable("BusinessData");
});
modelBuilder.Entity("ReallifeGamemode.Database.Entities.CannabisPlant", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
b.Property<bool>("Harvested")
.HasColumnType("tinyint(1)");
b.Property<DateTime>("PlantDate")
.HasColumnType("datetime(6)");
b.Property<int>("PlantedById")
.HasColumnType("int");
b.Property<float>("X")
.HasColumnType("float");
b.Property<float>("Y")
.HasColumnType("float");
b.Property<float>("Z")
.HasColumnType("float");
b.HasKey("Id");
b.HasIndex("PlantedById");
b.ToTable("CannabisPlants");
});
modelBuilder.Entity("ReallifeGamemode.Database.Entities.Character", b =>
{
b.Property<int>("Id")
@@ -1931,6 +1962,15 @@ namespace ReallifeGamemode.Database.Migrations
.HasForeignKey("BusRouteId");
});
modelBuilder.Entity("ReallifeGamemode.Database.Entities.CannabisPlant", b =>
{
b.HasOne("ReallifeGamemode.Database.Entities.User", "PlantedBy")
.WithMany()
.HasForeignKey("PlantedById")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("ReallifeGamemode.Database.Entities.Character", b =>
{
b.HasOne("ReallifeGamemode.Database.Entities.User", "User")