67 lines
2.8 KiB
C#
67 lines
2.8 KiB
C#
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace PizzaBot.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class InitialCreate : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AlterDatabase()
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Requests",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
Name = table.Column<string>(type: "longtext", nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
reqPiecesMeat = table.Column<int>(type: "int", nullable: false),
|
|
reqPiecesVegetarian = table.Column<int>(type: "int", nullable: false),
|
|
reqPiecesVegan = table.Column<int>(type: "int", nullable: false),
|
|
priority = table.Column<float>(type: "float", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Requests", x => x.Id);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Results",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
resPiecesMeat = table.Column<int>(type: "int", nullable: false),
|
|
resPiecesVegetarian = table.Column<int>(type: "int", nullable: false),
|
|
resPiecesVegan = table.Column<int>(type: "int", nullable: false),
|
|
penaltyMeatVeggi = table.Column<float>(type: "float", nullable: false),
|
|
penaltyVeggieVegan = table.Column<float>(type: "float", nullable: false),
|
|
totalCost = table.Column<float>(type: "float", nullable: false),
|
|
hasPaid = table.Column<bool>(type: "tinyint(1)", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Results", x => x.Id);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "Requests");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Results");
|
|
}
|
|
}
|
|
}
|