feat: refactor week number handling to use WeekDefinitionId across multiple entities and queries
This commit is contained in:
+3599
File diff suppressed because it is too large
Load Diff
+81
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddWeekDefinitionTable : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "WeekDefinitions",
|
||||
schema: "CMS",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
WeekOrder = table.Column<int>(type: "int", nullable: false),
|
||||
DisplayName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||||
GregorianWeekNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
|
||||
PersianWeekNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
|
||||
StartDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
EndDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
GregorianYear = table.Column<int>(type: "int", nullable: false),
|
||||
PersianYear = table.Column<int>(type: "int", nullable: false),
|
||||
IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true),
|
||||
Created = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
LastModified = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifiedBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_WeekDefinitions", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WeekDefinition_GregorianWeekNumber",
|
||||
schema: "CMS",
|
||||
table: "WeekDefinitions",
|
||||
column: "GregorianWeekNumber",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WeekDefinition_GregorianYear",
|
||||
schema: "CMS",
|
||||
table: "WeekDefinitions",
|
||||
column: "GregorianYear");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WeekDefinition_PersianWeekNumber",
|
||||
schema: "CMS",
|
||||
table: "WeekDefinitions",
|
||||
column: "PersianWeekNumber");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WeekDefinition_PersianYear",
|
||||
schema: "CMS",
|
||||
table: "WeekDefinitions",
|
||||
column: "PersianYear");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WeekDefinition_StartDate",
|
||||
schema: "CMS",
|
||||
table: "WeekDefinitions",
|
||||
column: "StartDate");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "WeekDefinitions",
|
||||
schema: "CMS");
|
||||
}
|
||||
}
|
||||
}
|
||||
+3682
File diff suppressed because it is too large
Load Diff
+296
@@ -0,0 +1,296 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddWeekDefinitionIdToCommissionTables : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WorkerExecutionLogs",
|
||||
type: "bigint",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools",
|
||||
type: "nvarchar(10)",
|
||||
maxLength: 10,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(20)",
|
||||
oldMaxLength: 20);
|
||||
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools",
|
||||
type: "bigint",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts",
|
||||
type: "nvarchar(10)",
|
||||
maxLength: 10,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(20)",
|
||||
oldMaxLength: 20);
|
||||
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts",
|
||||
type: "bigint",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances",
|
||||
type: "nvarchar(10)",
|
||||
maxLength: 10,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(20)",
|
||||
oldMaxLength: 20);
|
||||
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances",
|
||||
type: "bigint",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "CommissionPayoutHistories",
|
||||
type: "nvarchar(10)",
|
||||
maxLength: 10,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(20)",
|
||||
oldMaxLength: 20);
|
||||
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "CommissionPayoutHistories",
|
||||
type: "bigint",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WorkerExecutionLogs_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WorkerExecutionLogs",
|
||||
column: "WeekDefinitionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WeeklyCommissionPool_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools",
|
||||
column: "WeekDefinitionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_UserCommissionPayout_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts",
|
||||
column: "WeekDefinitionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_NetworkWeeklyBalance_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances",
|
||||
column: "WeekDefinitionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CommissionPayoutHistory_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "CommissionPayoutHistories",
|
||||
column: "WeekDefinitionId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CommissionPayoutHistories_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "CommissionPayoutHistories",
|
||||
column: "WeekDefinitionId",
|
||||
principalSchema: "CMS",
|
||||
principalTable: "WeekDefinitions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_NetworkWeeklyBalances_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances",
|
||||
column: "WeekDefinitionId",
|
||||
principalSchema: "CMS",
|
||||
principalTable: "WeekDefinitions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_UserCommissionPayouts_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts",
|
||||
column: "WeekDefinitionId",
|
||||
principalSchema: "CMS",
|
||||
principalTable: "WeekDefinitions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_WeeklyCommissionPools_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools",
|
||||
column: "WeekDefinitionId",
|
||||
principalSchema: "CMS",
|
||||
principalTable: "WeekDefinitions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_WorkerExecutionLogs_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WorkerExecutionLogs",
|
||||
column: "WeekDefinitionId",
|
||||
principalSchema: "CMS",
|
||||
principalTable: "WeekDefinitions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_CommissionPayoutHistories_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "CommissionPayoutHistories");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_NetworkWeeklyBalances_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_UserCommissionPayouts_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_WeeklyCommissionPools_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_WorkerExecutionLogs_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WorkerExecutionLogs");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_WorkerExecutionLogs_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WorkerExecutionLogs");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_WeeklyCommissionPool_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_UserCommissionPayout_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_NetworkWeeklyBalance_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_CommissionPayoutHistory_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "CommissionPayoutHistories");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WorkerExecutionLogs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "CommissionPayoutHistories");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools",
|
||||
type: "nvarchar(20)",
|
||||
maxLength: 20,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(10)",
|
||||
oldMaxLength: 10);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts",
|
||||
type: "nvarchar(20)",
|
||||
maxLength: 20,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(10)",
|
||||
oldMaxLength: 10);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances",
|
||||
type: "nvarchar(20)",
|
||||
maxLength: 20,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(10)",
|
||||
oldMaxLength: 10);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "CommissionPayoutHistories",
|
||||
type: "nvarchar(20)",
|
||||
maxLength: 20,
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(10)",
|
||||
oldMaxLength: 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
+3647
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,477 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class u16 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_CommissionPayoutHistories_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "CommissionPayoutHistories");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_NetworkWeeklyBalances_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_UserCommissionPayouts_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_WeeklyCommissionPools_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_WorkerExecutionLogs_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WorkerExecutionLogs");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_WorkerExecutionLogs_WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "WorkerExecutionLogs");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_WeeklyCommissionPool_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_WeeklyCommissionPool_WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_UserCommissionPayout_UserId_WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_UserCommissionPayout_WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_NetworkWeeklyBalance_UserId_WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_NetworkWeeklyBalance_WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_CommissionPayoutHistory_WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "CommissionPayoutHistories");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "WorkerExecutionLogs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "CommissionPayoutHistories");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_UserCommissionPayout_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts",
|
||||
newName: "IX_UserCommissionPayouts_WeekDefinitionId");
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WorkerExecutionLogs",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "CommissionPayoutHistories",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WeeklyCommissionPool_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools",
|
||||
column: "WeekDefinitionId",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_UserCommissionPayout_UserId_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts",
|
||||
columns: new[] { "UserId", "WeekDefinitionId" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_NetworkWeeklyBalance_UserId_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances",
|
||||
columns: new[] { "UserId", "WeekDefinitionId" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CommissionPayoutHistories_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "CommissionPayoutHistories",
|
||||
column: "WeekDefinitionId",
|
||||
principalSchema: "CMS",
|
||||
principalTable: "WeekDefinitions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_NetworkWeeklyBalances_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances",
|
||||
column: "WeekDefinitionId",
|
||||
principalSchema: "CMS",
|
||||
principalTable: "WeekDefinitions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_UserCommissionPayouts_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts",
|
||||
column: "WeekDefinitionId",
|
||||
principalSchema: "CMS",
|
||||
principalTable: "WeekDefinitions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_WeeklyCommissionPools_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools",
|
||||
column: "WeekDefinitionId",
|
||||
principalSchema: "CMS",
|
||||
principalTable: "WeekDefinitions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_WorkerExecutionLogs_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WorkerExecutionLogs",
|
||||
column: "WeekDefinitionId",
|
||||
principalSchema: "CMS",
|
||||
principalTable: "WeekDefinitions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_CommissionPayoutHistories_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "CommissionPayoutHistories");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_NetworkWeeklyBalances_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_UserCommissionPayouts_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_WeeklyCommissionPools_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_WorkerExecutionLogs_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WorkerExecutionLogs");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_WeeklyCommissionPool_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_UserCommissionPayout_UserId_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_NetworkWeeklyBalance_UserId_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_UserCommissionPayouts_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts",
|
||||
newName: "IX_UserCommissionPayout_WeekDefinitionId");
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WorkerExecutionLogs",
|
||||
type: "bigint",
|
||||
nullable: true,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "WorkerExecutionLogs",
|
||||
type: "nvarchar(10)",
|
||||
maxLength: 10,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools",
|
||||
type: "bigint",
|
||||
nullable: true,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools",
|
||||
type: "nvarchar(10)",
|
||||
maxLength: 10,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts",
|
||||
type: "bigint",
|
||||
nullable: true,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts",
|
||||
type: "nvarchar(10)",
|
||||
maxLength: 10,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances",
|
||||
type: "bigint",
|
||||
nullable: true,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances",
|
||||
type: "nvarchar(10)",
|
||||
maxLength: 10,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "CommissionPayoutHistories",
|
||||
type: "bigint",
|
||||
nullable: true,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "CommissionPayoutHistories",
|
||||
type: "nvarchar(10)",
|
||||
maxLength: 10,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WorkerExecutionLogs_WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "WorkerExecutionLogs",
|
||||
column: "WeekNumber");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WeeklyCommissionPool_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools",
|
||||
column: "WeekDefinitionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_WeeklyCommissionPool_WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools",
|
||||
column: "WeekNumber",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_UserCommissionPayout_UserId_WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts",
|
||||
columns: new[] { "UserId", "WeekNumber" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_UserCommissionPayout_WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts",
|
||||
column: "WeekNumber");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_NetworkWeeklyBalance_UserId_WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances",
|
||||
columns: new[] { "UserId", "WeekNumber" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_NetworkWeeklyBalance_WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances",
|
||||
column: "WeekNumber");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CommissionPayoutHistory_WeekNumber",
|
||||
schema: "CMS",
|
||||
table: "CommissionPayoutHistories",
|
||||
column: "WeekNumber");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CommissionPayoutHistories_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "CommissionPayoutHistories",
|
||||
column: "WeekDefinitionId",
|
||||
principalSchema: "CMS",
|
||||
principalTable: "WeekDefinitions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_NetworkWeeklyBalances_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "NetworkWeeklyBalances",
|
||||
column: "WeekDefinitionId",
|
||||
principalSchema: "CMS",
|
||||
principalTable: "WeekDefinitions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_UserCommissionPayouts_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "UserCommissionPayouts",
|
||||
column: "WeekDefinitionId",
|
||||
principalSchema: "CMS",
|
||||
principalTable: "WeekDefinitions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_WeeklyCommissionPools_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WeeklyCommissionPools",
|
||||
column: "WeekDefinitionId",
|
||||
principalSchema: "CMS",
|
||||
principalTable: "WeekDefinitions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_WorkerExecutionLogs_WeekDefinitions_WeekDefinitionId",
|
||||
schema: "CMS",
|
||||
table: "WorkerExecutionLogs",
|
||||
column: "WeekDefinitionId",
|
||||
principalSchema: "CMS",
|
||||
principalTable: "WeekDefinitions",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
}
|
||||
}
|
||||
}
|
||||
+3647
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,22 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class u17 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+160
-33
@@ -301,10 +301,8 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||
b.Property<long>("ValuePerBalance")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("WeekNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
b.Property<long>("WeekDefinitionId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("WeeklyPoolId")
|
||||
.HasColumnType("bigint");
|
||||
@@ -320,15 +318,14 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||
b.HasIndex("Status")
|
||||
.HasDatabaseName("IX_UserCommissionPayout_Status");
|
||||
|
||||
b.HasIndex("WeekNumber")
|
||||
.HasDatabaseName("IX_UserCommissionPayout_WeekNumber");
|
||||
b.HasIndex("WeekDefinitionId");
|
||||
|
||||
b.HasIndex("WeeklyPoolId")
|
||||
.HasDatabaseName("IX_UserCommissionPayout_WeeklyPoolId");
|
||||
|
||||
b.HasIndex("UserId", "WeekNumber")
|
||||
b.HasIndex("UserId", "WeekDefinitionId")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("IX_UserCommissionPayout_UserId_WeekNumber");
|
||||
.HasDatabaseName("IX_UserCommissionPayout_UserId_WeekDefinitionId");
|
||||
|
||||
b.ToTable("UserCommissionPayouts", "CMS");
|
||||
});
|
||||
@@ -371,19 +368,17 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||
b.Property<long>("ValuePerBalance")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("WeekNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
b.Property<long>("WeekDefinitionId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("IsCalculated")
|
||||
.HasDatabaseName("IX_WeeklyCommissionPool_IsCalculated");
|
||||
|
||||
b.HasIndex("WeekNumber")
|
||||
b.HasIndex("WeekDefinitionId")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("IX_WeeklyCommissionPool_WeekNumber");
|
||||
.HasDatabaseName("IX_WeeklyCommissionPool_WeekDefinitionId");
|
||||
|
||||
b.ToTable("WeeklyCommissionPools", "CMS");
|
||||
});
|
||||
@@ -442,10 +437,8 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("WeekNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
b.Property<long>("WeekDefinitionId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -453,7 +446,7 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||
|
||||
b.HasIndex("Status");
|
||||
|
||||
b.HasIndex("WeekNumber");
|
||||
b.HasIndex("WeekDefinitionId");
|
||||
|
||||
b.ToTable("WorkerExecutionLogs", "CMS");
|
||||
});
|
||||
@@ -1379,10 +1372,8 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||
b.Property<long>("UserId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("WeekNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
b.Property<long>("WeekDefinitionId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -1392,8 +1383,8 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||
b.HasIndex("UserCommissionPayoutId")
|
||||
.HasDatabaseName("IX_CommissionPayoutHistory_PayoutId");
|
||||
|
||||
b.HasIndex("WeekNumber")
|
||||
.HasDatabaseName("IX_CommissionPayoutHistory_WeekNumber");
|
||||
b.HasIndex("WeekDefinitionId")
|
||||
.HasDatabaseName("IX_CommissionPayoutHistory_WeekDefinitionId");
|
||||
|
||||
b.HasIndex("UserId", "Created")
|
||||
.HasDatabaseName("IX_CommissionPayoutHistory_UserId_Created");
|
||||
@@ -1598,10 +1589,8 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||
b.Property<long>("UserId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("WeekNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
b.Property<long>("WeekDefinitionId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("WeeklyPoolContribution")
|
||||
.HasColumnType("bigint");
|
||||
@@ -1611,12 +1600,12 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||
b.HasIndex("IsExpired")
|
||||
.HasDatabaseName("IX_NetworkWeeklyBalance_IsExpired");
|
||||
|
||||
b.HasIndex("WeekNumber")
|
||||
.HasDatabaseName("IX_NetworkWeeklyBalance_WeekNumber");
|
||||
b.HasIndex("WeekDefinitionId")
|
||||
.HasDatabaseName("IX_NetworkWeeklyBalance_WeekDefinitionId");
|
||||
|
||||
b.HasIndex("UserId", "WeekNumber")
|
||||
b.HasIndex("UserId", "WeekDefinitionId")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("IX_NetworkWeeklyBalance_UserId_WeekNumber");
|
||||
.HasDatabaseName("IX_NetworkWeeklyBalance_UserId_WeekDefinitionId");
|
||||
|
||||
b.ToTable("NetworkWeeklyBalances", "CMS");
|
||||
});
|
||||
@@ -2841,6 +2830,85 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||
b.ToTable("UserWalletChangeLogs", "CMS");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CMSMicroservice.Domain.Entities.WeekDefinition", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DisplayName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<DateTime>("EndDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("GregorianWeekNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<int>("GregorianYear")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(true);
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("LastModified")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("LastModifiedBy")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PersianWeekNumber")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<int>("PersianYear")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("StartDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("WeekOrder")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("GregorianWeekNumber")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("IX_WeekDefinition_GregorianWeekNumber");
|
||||
|
||||
b.HasIndex("GregorianYear")
|
||||
.HasDatabaseName("IX_WeekDefinition_GregorianYear");
|
||||
|
||||
b.HasIndex("PersianWeekNumber")
|
||||
.HasDatabaseName("IX_WeekDefinition_PersianWeekNumber");
|
||||
|
||||
b.HasIndex("PersianYear")
|
||||
.HasDatabaseName("IX_WeekDefinition_PersianYear");
|
||||
|
||||
b.HasIndex("StartDate")
|
||||
.HasDatabaseName("IX_WeekDefinition_StartDate");
|
||||
|
||||
b.ToTable("WeekDefinitions", "CMS");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Category", b =>
|
||||
{
|
||||
b.HasOne("CMSMicroservice.Domain.Entities.Category", "Parent")
|
||||
@@ -2896,6 +2964,12 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CMSMicroservice.Domain.Entities.WeekDefinition", "WeekDefinition")
|
||||
.WithMany("UserCommissionPayouts")
|
||||
.HasForeignKey("WeekDefinitionId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CMSMicroservice.Domain.Entities.Commission.WeeklyCommissionPool", "WeeklyPool")
|
||||
.WithMany("UserCommissionPayouts")
|
||||
.HasForeignKey("WeeklyPoolId")
|
||||
@@ -2904,9 +2978,33 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||
|
||||
b.Navigation("User");
|
||||
|
||||
b.Navigation("WeekDefinition");
|
||||
|
||||
b.Navigation("WeeklyPool");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Commission.WeeklyCommissionPool", b =>
|
||||
{
|
||||
b.HasOne("CMSMicroservice.Domain.Entities.WeekDefinition", "WeekDefinition")
|
||||
.WithMany("WeeklyCommissionPools")
|
||||
.HasForeignKey("WeekDefinitionId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("WeekDefinition");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Commission.WorkerExecutionLog", b =>
|
||||
{
|
||||
b.HasOne("CMSMicroservice.Domain.Entities.WeekDefinition", "WeekDefinition")
|
||||
.WithMany("WorkerExecutionLogs")
|
||||
.HasForeignKey("WeekDefinitionId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("WeekDefinition");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CMSMicroservice.Domain.Entities.DayaLoanContract", b =>
|
||||
{
|
||||
b.HasOne("CMSMicroservice.Domain.Entities.Transaction", "Transaction")
|
||||
@@ -3077,7 +3175,15 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CMSMicroservice.Domain.Entities.WeekDefinition", "WeekDefinition")
|
||||
.WithMany("CommissionPayoutHistories")
|
||||
.HasForeignKey("WeekDefinitionId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("UserCommissionPayout");
|
||||
|
||||
b.Navigation("WeekDefinition");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CMSMicroservice.Domain.Entities.History.SystemConfigurationHistory", b =>
|
||||
@@ -3099,7 +3205,15 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("CMSMicroservice.Domain.Entities.WeekDefinition", "WeekDefinition")
|
||||
.WithMany("NetworkWeeklyBalances")
|
||||
.HasForeignKey("WeekDefinitionId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
|
||||
b.Navigation("WeekDefinition");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Order.OrderVAT", b =>
|
||||
@@ -3511,6 +3625,19 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
|
||||
{
|
||||
b.Navigation("UserWalletChangeLogs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("CMSMicroservice.Domain.Entities.WeekDefinition", b =>
|
||||
{
|
||||
b.Navigation("CommissionPayoutHistories");
|
||||
|
||||
b.Navigation("NetworkWeeklyBalances");
|
||||
|
||||
b.Navigation("UserCommissionPayouts");
|
||||
|
||||
b.Navigation("WeeklyCommissionPools");
|
||||
|
||||
b.Navigation("WorkerExecutionLogs");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user