This commit is contained in:
David Štaleker
2024-02-25 20:09:43 +01:00
parent 28d1630749
commit 4df426dc10
614 changed files with 121469 additions and 7647 deletions

View File

@@ -0,0 +1,73 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ZpcBulletinBoard.Migrations
{
/// <inheritdoc />
public partial class _1 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "BulletinBoards",
columns: table => new
{
IdBulletinBoard = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Guid = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_BulletinBoards", x => x.IdBulletinBoard);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Notes",
columns: table => new
{
IdNote = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
IdBulletinBoard = table.Column<int>(type: "int", nullable: false),
X = table.Column<int>(type: "int", nullable: false),
Y = table.Column<int>(type: "int", nullable: false),
Width = table.Column<int>(type: "int", nullable: false),
Height = table.Column<int>(type: "int", nullable: false),
Title = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Content = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_Notes", x => x.IdNote);
table.ForeignKey(
name: "FK_Notes_BulletinBoards_IdBulletinBoard",
column: x => x.IdBulletinBoard,
principalTable: "BulletinBoards",
principalColumn: "IdBulletinBoard",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_Notes_IdBulletinBoard",
table: "Notes",
column: "IdBulletinBoard");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Notes");
migrationBuilder.DropTable(
name: "BulletinBoards");
}
}
}