update the migrations

This commit is contained in:
2026-09-24 17:24:43 +05:30
parent e8692b2474
commit 75b0a802c3
11 changed files with 12620 additions and 87 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,72 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Distribution.Migrations
{
/// <inheritdoc />
public partial class AddShopPOCancelInfo : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "CancelReason",
table: "ShopPOs",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<DateTime>(
name: "CancelledAt",
table: "ShopPOs",
type: "datetime(6)",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "CancelledBy",
table: "ShopPOs",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.UpdateData(
table: "ShopPOs",
keyColumn: "Id",
keyValue: new Guid("33000000-0000-0000-0000-000000000001"),
columns: new[] { "CancelReason", "CancelledAt", "CancelledBy" },
values: new object[] { null, null, null });
migrationBuilder.UpdateData(
table: "ShopPOs",
keyColumn: "Id",
keyValue: new Guid("33000000-0000-0000-0000-000000000002"),
columns: new[] { "CancelReason", "CancelledAt", "CancelledBy" },
values: new object[] { null, null, null });
migrationBuilder.UpdateData(
table: "ShopPOs",
keyColumn: "Id",
keyValue: new Guid("33000000-0000-0000-0000-000000000003"),
columns: new[] { "CancelReason", "CancelledAt", "CancelledBy" },
values: new object[] { null, null, null });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CancelReason",
table: "ShopPOs");
migrationBuilder.DropColumn(
name: "CancelledAt",
table: "ShopPOs");
migrationBuilder.DropColumn(
name: "CancelledBy",
table: "ShopPOs");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,100 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Distribution.Migrations
{
/// <inheritdoc />
public partial class AddStoreContactNumberAndNullableOwner : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "OwnerName",
table: "Stores",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "ContactNumber",
table: "Stores",
type: "longtext",
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000001"),
column: "ContactNumber",
value: null);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000002"),
column: "ContactNumber",
value: null);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000003"),
column: "ContactNumber",
value: null);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000004"),
column: "ContactNumber",
value: null);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000005"),
column: "ContactNumber",
value: null);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000006"),
column: "ContactNumber",
value: null);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ContactNumber",
table: "Stores");
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "OwnerName",
keyValue: null,
column: "OwnerName",
value: "");
migrationBuilder.AlterColumn<string>(
name: "OwnerName",
table: "Stores",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,191 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Distribution.Migrations
{
/// <inheritdoc />
public partial class RouteOptionalFieldsAndStoreContactNumber : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "StoreKycDocuments");
migrationBuilder.DropColumn(
name: "KycStatus",
table: "Stores");
migrationBuilder.AlterColumn<string>(
name: "StartPoint",
table: "Routes",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<decimal>(
name: "Length",
table: "Routes",
type: "decimal(65,30)",
nullable: true,
oldClrType: typeof(decimal),
oldType: "decimal(65,30)");
migrationBuilder.AlterColumn<string>(
name: "EndPoint",
table: "Routes",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "KycStatus",
table: "Stores",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.UpdateData(
table: "Routes",
keyColumn: "StartPoint",
keyValue: null,
column: "StartPoint",
value: "");
migrationBuilder.AlterColumn<string>(
name: "StartPoint",
table: "Routes",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<decimal>(
name: "Length",
table: "Routes",
type: "decimal(65,30)",
nullable: false,
defaultValue: 0m,
oldClrType: typeof(decimal),
oldType: "decimal(65,30)",
oldNullable: true);
migrationBuilder.UpdateData(
table: "Routes",
keyColumn: "EndPoint",
keyValue: null,
column: "EndPoint",
value: "");
migrationBuilder.AlterColumn<string>(
name: "EndPoint",
table: "Routes",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "StoreKycDocuments",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FK_StoreId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
DocumentType = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
FileReference = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
UploadedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_StoreKycDocuments", x => x.Id);
table.ForeignKey(
name: "FK_StoreKycDocuments_Stores_FK_StoreId",
column: x => x.FK_StoreId,
principalTable: "Stores",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "StoreKycDocuments",
columns: new[] { "Id", "CreatedAt", "DocumentType", "FK_StoreId", "FileReference", "IsActive", "UploadedAt" },
values: new object[,]
{
{ new Guid("63000000-0000-0000-0000-000000000001"), new DateTime(2026, 8, 10, 0, 0, 0, 0, DateTimeKind.Unspecified), "Business Registration", new Guid("26000000-0000-0000-0000-000000000001"), "seed/kyc/fort-mini-mart-brc.pdf", true, new DateTime(2026, 8, 10, 0, 0, 0, 0, DateTimeKind.Unspecified) },
{ new Guid("63000000-0000-0000-0000-000000000002"), new DateTime(2026, 8, 12, 0, 0, 0, 0, DateTimeKind.Unspecified), "NIC", new Guid("26000000-0000-0000-0000-000000000003"), "seed/kyc/wattala-owner-nic.pdf", true, new DateTime(2026, 8, 12, 0, 0, 0, 0, DateTimeKind.Unspecified) }
});
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000001"),
column: "KycStatus",
value: 1);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000002"),
column: "KycStatus",
value: 1);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000003"),
column: "KycStatus",
value: 0);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000004"),
column: "KycStatus",
value: 0);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000005"),
column: "KycStatus",
value: 1);
migrationBuilder.UpdateData(
table: "Stores",
keyColumn: "Id",
keyValue: new Guid("26000000-0000-0000-0000-000000000006"),
column: "KycStatus",
value: 0);
migrationBuilder.CreateIndex(
name: "IX_StoreKycDocuments_FK_StoreId",
table: "StoreKycDocuments",
column: "FK_StoreId");
}
}
}
@@ -1586,7 +1586,6 @@ namespace Distribution.Migrations
.HasColumnType("datetime(6)");
b.Property<string>("EndPoint")
.IsRequired()
.HasColumnType("longtext");
b.Property<Guid?>("FK_OwnerUserId")
@@ -1598,7 +1597,7 @@ namespace Distribution.Migrations
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<decimal>("Length")
b.Property<decimal?>("Length")
.HasColumnType("decimal(65,30)");
b.Property<string>("RouteName")
@@ -1606,7 +1605,6 @@ namespace Distribution.Migrations
.HasColumnType("longtext");
b.Property<string>("StartPoint")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
@@ -2062,6 +2060,15 @@ namespace Distribution.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("CancelReason")
.HasColumnType("longtext");
b.Property<DateTime?>("CancelledAt")
.HasColumnType("datetime(6)");
b.Property<Guid?>("CancelledBy")
.HasColumnType("char(36)");
b.Property<DateTime?>("ConfirmedAt")
.HasColumnType("datetime(6)");
@@ -2376,6 +2383,9 @@ namespace Distribution.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ContactNumber")
.HasColumnType("longtext");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
@@ -2391,9 +2401,6 @@ namespace Distribution.Migrations
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<int>("KycStatus")
.HasColumnType("int");
b.Property<decimal>("Latitude")
.HasColumnType("decimal(65,30)");
@@ -2407,7 +2414,6 @@ namespace Distribution.Migrations
.HasColumnType("decimal(65,30)");
b.Property<string>("OwnerName")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Segment")
@@ -2436,7 +2442,6 @@ namespace Distribution.Migrations
CreditLimit = 50000m,
FK_RouteId = new Guid("25000000-0000-0000-0000-000000000001"),
IsActive = true,
KycStatus = 1,
Latitude = 6.9344m,
Longitude = 79.8428m,
OneTimeAmount = 0m,
@@ -2454,7 +2459,6 @@ namespace Distribution.Migrations
CreditLimit = 30000m,
FK_RouteId = new Guid("25000000-0000-0000-0000-000000000001"),
IsActive = true,
KycStatus = 1,
Latitude = 6.8508m,
Longitude = 79.8654m,
OneTimeAmount = 0m,
@@ -2472,7 +2476,6 @@ namespace Distribution.Migrations
CreditLimit = 40000m,
FK_RouteId = new Guid("25000000-0000-0000-0000-000000000002"),
IsActive = true,
KycStatus = 0,
Latitude = 6.9890m,
Longitude = 79.8912m,
OneTimeAmount = 0m,
@@ -2490,7 +2493,6 @@ namespace Distribution.Migrations
CreditLimit = 25000m,
FK_RouteId = new Guid("25000000-0000-0000-0000-000000000002"),
IsActive = true,
KycStatus = 0,
Latitude = 7.2094m,
Longitude = 79.8380m,
OneTimeAmount = 0m,
@@ -2507,7 +2509,6 @@ namespace Distribution.Migrations
CreditLimit = 35000m,
FK_RouteId = new Guid("25000000-0000-0000-0000-000000000003"),
IsActive = true,
KycStatus = 1,
Latitude = 7.2906m,
Longitude = 80.6337m,
OneTimeAmount = 0m,
@@ -2525,7 +2526,6 @@ namespace Distribution.Migrations
CreditLimit = 20000m,
FK_RouteId = new Guid("25000000-0000-0000-0000-000000000004"),
IsActive = true,
KycStatus = 0,
Latitude = 7.4675m,
Longitude = 80.6234m,
OneTimeAmount = 0m,
@@ -2536,61 +2536,6 @@ namespace Distribution.Migrations
});
});
modelBuilder.Entity("Distribution.Models.StoreKycDocument", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("DocumentType")
.IsRequired()
.HasColumnType("longtext");
b.Property<Guid>("FK_StoreId")
.HasColumnType("char(36)");
b.Property<string>("FileReference")
.IsRequired()
.HasColumnType("longtext");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<DateTime>("UploadedAt")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.HasIndex("FK_StoreId");
b.ToTable("StoreKycDocuments");
b.HasData(
new
{
Id = new Guid("63000000-0000-0000-0000-000000000001"),
CreatedAt = new DateTime(2026, 8, 10, 0, 0, 0, 0, DateTimeKind.Unspecified),
DocumentType = "Business Registration",
FK_StoreId = new Guid("26000000-0000-0000-0000-000000000001"),
FileReference = "seed/kyc/fort-mini-mart-brc.pdf",
IsActive = true,
UploadedAt = new DateTime(2026, 8, 10, 0, 0, 0, 0, DateTimeKind.Unspecified)
},
new
{
Id = new Guid("63000000-0000-0000-0000-000000000002"),
CreatedAt = new DateTime(2026, 8, 12, 0, 0, 0, 0, DateTimeKind.Unspecified),
DocumentType = "NIC",
FK_StoreId = new Guid("26000000-0000-0000-0000-000000000003"),
FileReference = "seed/kyc/wattala-owner-nic.pdf",
IsActive = true,
UploadedAt = new DateTime(2026, 8, 12, 0, 0, 0, 0, DateTimeKind.Unspecified)
});
});
modelBuilder.Entity("Distribution.Models.SubCategory", b =>
{
b.Property<Guid>("Id")
@@ -3828,17 +3773,6 @@ namespace Distribution.Migrations
b.Navigation("Route");
});
modelBuilder.Entity("Distribution.Models.StoreKycDocument", b =>
{
b.HasOne("Distribution.Models.Store", "Store")
.WithMany()
.HasForeignKey("FK_StoreId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Store");
});
modelBuilder.Entity("Distribution.Models.SubCategory", b =>
{
b.HasOne("Distribution.Models.Category", "Category")