150 lines
8.8 KiB
C#
150 lines
8.8 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
|
|
|
namespace Marco.Pms.DataAccess.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class Added_ExpensesStatusMaping_Table : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "StatusMapping");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "ExpensesStatusMapping",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
|
StatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
|
ExpeStatusIdnsesId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
|
NextStatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
|
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_ExpensesStatusMapping", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_ExpensesStatusMapping_ExpensesStatusMaster_ExpeStatusIdnsesId",
|
|
column: x => x.ExpeStatusIdnsesId,
|
|
principalTable: "ExpensesStatusMaster",
|
|
principalColumn: "Id");
|
|
table.ForeignKey(
|
|
name: "FK_ExpensesStatusMapping_ExpensesStatusMaster_NextStatusId",
|
|
column: x => x.NextStatusId,
|
|
principalTable: "ExpensesStatusMaster",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "FK_ExpensesStatusMapping_Tenants_TenantId",
|
|
column: x => x.TenantId,
|
|
principalTable: "Tenants",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.InsertData(
|
|
table: "ExpensesStatusMapping",
|
|
columns: new[] { "Id", "ExpeStatusIdnsesId", "NextStatusId", "StatusId", "TenantId" },
|
|
values: new object[,]
|
|
{
|
|
{ new Guid("1fca1700-1266-477d-bba4-9ac3753aa33c"), null, new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
|
{ new Guid("36c00548-241c-43ec-bc95-cacebedb925c"), null, new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
|
{ new Guid("5cf7f1df-9d1f-4289-add0-1775ad614f25"), null, new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
|
{ new Guid("af1e4492-98ee-4451-8ab7-fd8323f29c32"), null, new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), new Guid("297e0d8f-f668-41b5-bfea-e03b354251c8"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
|
{ new Guid("ef1fcfbc-60e0-4f17-9308-c583a05d48fd"), null, new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
|
{ new Guid("fddaaf20-4ccc-4f4e-a724-dd310272b356"), null, new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_ExpensesStatusMapping_ExpeStatusIdnsesId",
|
|
table: "ExpensesStatusMapping",
|
|
column: "ExpeStatusIdnsesId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_ExpensesStatusMapping_NextStatusId",
|
|
table: "ExpensesStatusMapping",
|
|
column: "NextStatusId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_ExpensesStatusMapping_TenantId",
|
|
table: "ExpensesStatusMapping",
|
|
column: "TenantId");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "ExpensesStatusMapping");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "StatusMapping",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
|
ExpeStatusIdnsesId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
|
NextStatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
|
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
|
StatusId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_StatusMapping", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_StatusMapping_ExpensesStatusMaster_ExpeStatusIdnsesId",
|
|
column: x => x.ExpeStatusIdnsesId,
|
|
principalTable: "ExpensesStatusMaster",
|
|
principalColumn: "Id");
|
|
table.ForeignKey(
|
|
name: "FK_StatusMapping_ExpensesStatusMaster_NextStatusId",
|
|
column: x => x.NextStatusId,
|
|
principalTable: "ExpensesStatusMaster",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "FK_StatusMapping_Tenants_TenantId",
|
|
column: x => x.TenantId,
|
|
principalTable: "Tenants",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.InsertData(
|
|
table: "StatusMapping",
|
|
columns: new[] { "Id", "ExpeStatusIdnsesId", "NextStatusId", "StatusId", "TenantId" },
|
|
values: new object[,]
|
|
{
|
|
{ new Guid("1fca1700-1266-477d-bba4-9ac3753aa33c"), null, new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
|
{ new Guid("36c00548-241c-43ec-bc95-cacebedb925c"), null, new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
|
{ new Guid("5cf7f1df-9d1f-4289-add0-1775ad614f25"), null, new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), new Guid("f18c5cfd-7815-4341-8da2-2c2d65778e27"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
|
{ new Guid("af1e4492-98ee-4451-8ab7-fd8323f29c32"), null, new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), new Guid("297e0d8f-f668-41b5-bfea-e03b354251c8"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
|
{ new Guid("ef1fcfbc-60e0-4f17-9308-c583a05d48fd"), null, new Guid("4068007f-c92f-4f37-a907-bc15fe57d4d8"), new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") },
|
|
{ new Guid("fddaaf20-4ccc-4f4e-a724-dd310272b356"), null, new Guid("d1ee5eec-24b6-4364-8673-a8f859c60729"), new Guid("6537018f-f4e9-4cb3-a210-6c3b2da999d7"), new Guid("b3466e83-7e11-464c-b93a-daf047838b26") }
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_StatusMapping_ExpeStatusIdnsesId",
|
|
table: "StatusMapping",
|
|
column: "ExpeStatusIdnsesId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_StatusMapping_NextStatusId",
|
|
table: "StatusMapping",
|
|
column: "NextStatusId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_StatusMapping_TenantId",
|
|
table: "StatusMapping",
|
|
column: "TenantId");
|
|
}
|
|
}
|
|
}
|