fix: align backend APIs and upload flow
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace GroupService.Infrastructure.Migrations
|
||||
{
|
||||
[DbContext(typeof(GroupDbContext))]
|
||||
[Migration("20260909000200_ApiAlignmentFixes")]
|
||||
public partial class ApiAlignmentFixes : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_group_members_UserId_IsDeleted_GroupId",
|
||||
table: "group_members",
|
||||
columns: new[] { "UserId", "IsDeleted", "GroupId" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_group_members_GroupId_IsDeleted_Role",
|
||||
table: "group_members",
|
||||
columns: new[] { "GroupId", "IsDeleted", "Role" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_group_join_requests_Id",
|
||||
table: "group_join_requests",
|
||||
column: "Id",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_group_join_requests_GroupId_State_CreationTime",
|
||||
table: "group_join_requests",
|
||||
columns: new[] { "GroupId", "State", "CreationTime" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_group_join_requests_UserId_CreationTime",
|
||||
table: "group_join_requests",
|
||||
columns: new[] { "UserId", "CreationTime" });
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex("IX_group_members_UserId_IsDeleted_GroupId", "group_members");
|
||||
migrationBuilder.DropIndex("IX_group_members_GroupId_IsDeleted_Role", "group_members");
|
||||
migrationBuilder.DropIndex("IX_group_join_requests_Id", "group_join_requests");
|
||||
migrationBuilder.DropIndex("IX_group_join_requests_GroupId_State_CreationTime", "group_join_requests");
|
||||
migrationBuilder.DropIndex("IX_group_join_requests_UserId_CreationTime", "group_join_requests");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
namespace GroupService.Infrastructure.Migrations;
|
||||
[DbContext(typeof(GroupDbContext))]
|
||||
[Migration("20260915000100_ManagementReceipts")]
|
||||
public class ManagementReceipts : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder m) => m.Sql("""
|
||||
CREATE TABLE IF NOT EXISTS management_receipts (
|
||||
Owner varchar(64) NOT NULL,
|
||||
Id char(36) NOT NULL,
|
||||
Payload longtext NOT NULL,
|
||||
CreatedAt datetime(6) NOT NULL,
|
||||
PRIMARY KEY (Owner, Id)
|
||||
) CHARACTER SET utf8mb4;
|
||||
""");
|
||||
// Receipts are retained on rollback: losing idempotency history can repeat a previously applied action.
|
||||
protected override void Down(MigrationBuilder m) { }
|
||||
}
|
||||
@@ -227,6 +227,13 @@ namespace GroupService.Infrastructure.Migrations
|
||||
|
||||
b.HasKey("GroupId", "UserId");
|
||||
|
||||
b.HasIndex("Id")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("GroupId", "State", "CreationTime");
|
||||
|
||||
b.HasIndex("UserId", "CreationTime");
|
||||
|
||||
b.ToTable("group_join_requests", (string)null);
|
||||
});
|
||||
|
||||
@@ -266,6 +273,10 @@ namespace GroupService.Infrastructure.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("GroupId", "IsDeleted", "Role");
|
||||
|
||||
b.HasIndex("UserId", "IsDeleted", "GroupId");
|
||||
|
||||
b.ToTable("group_members", (string)null);
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
|
||||
Reference in New Issue
Block a user