using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Rmsys.Infrastructure.Migrations
{
///
public partial class AddReadReceipts : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "readreceipts",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
MeetingId = table.Column(type: "int", nullable: false),
CadreId = table.Column(type: "int", nullable: false),
MaterialType = table.Column(type: "varchar(16)", maxLength: 16, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
PadNo = table.Column(type: "varchar(32)", maxLength: 32, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ReadAt = table.Column(type: "datetime(6)", nullable: false),
ImportedAt = table.Column(type: "datetime(6)", nullable: false),
ImportedBy = table.Column(type: "varchar(32)", maxLength: 32, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_readreceipts", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_readreceipts_MeetingId",
table: "readreceipts",
column: "MeetingId");
migrationBuilder.CreateIndex(
name: "IX_readreceipts_MeetingId_CadreId_MaterialType_PadNo",
table: "readreceipts",
columns: new[] { "MeetingId", "CadreId", "MaterialType", "PadNo" },
unique: true);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "readreceipts");
}
}
}