using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
///
public partial class ProviderInvoiceItem : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ProviderInvoiceItem",
columns: table => new
{
Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ProviderId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
InvoiceId = table.Column(type: "varchar(255)", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
InvoiceNumber = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientName = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
PlanName = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
AssignedSeats = table.Column(type: "int", nullable: false),
UsedSeats = table.Column(type: "int", nullable: false),
Total = table.Column(type: "decimal(65,30)", nullable: false),
Created = table.Column(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ProviderInvoiceItem", x => x.Id);
table.ForeignKey(
name: "FK_ProviderInvoiceItem_Provider_ProviderId",
column: x => x.ProviderId,
principalTable: "Provider",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_ProviderInvoiceItem_Id_InvoiceId",
table: "ProviderInvoiceItem",
columns: new[] { "Id", "InvoiceId" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_ProviderInvoiceItem_ProviderId",
table: "ProviderInvoiceItem",
column: "ProviderId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ProviderInvoiceItem");
}
}