更新
This commit is contained in:
2026-02-23 18:52:32 +08:00
parent d429560511
commit 123fa6a7aa
81 changed files with 5952 additions and 407 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,52 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IM_API.Migrations
{
/// <inheritdoc />
public partial class adduploadtask : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "UploadTasks",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FileName = table.Column<string>(type: "longtext", nullable: false, collation: "latin1_swedish_ci")
.Annotation("MySql:CharSet", "latin1"),
FileSize = table.Column<long>(type: "bigint", nullable: false),
FileHash = table.Column<string>(type: "longtext", nullable: false, collation: "latin1_swedish_ci")
.Annotation("MySql:CharSet", "latin1"),
ContentType = table.Column<string>(type: "longtext", nullable: false, collation: "latin1_swedish_ci")
.Annotation("MySql:CharSet", "latin1"),
ChunkSize = table.Column<int>(type: "int", nullable: false),
TotalChunks = table.Column<int>(type: "int", nullable: false),
Status = table.Column<int>(type: "int", nullable: false),
StorageProvider = table.Column<string>(type: "longtext", nullable: false, collation: "latin1_swedish_ci")
.Annotation("MySql:CharSet", "latin1"),
ObjectName = table.Column<string>(type: "longtext", nullable: false, collation: "latin1_swedish_ci")
.Annotation("MySql:CharSet", "latin1"),
ProviderUploadId = table.Column<string>(type: "longtext", nullable: true, collation: "latin1_swedish_ci")
.Annotation("MySql:CharSet", "latin1"),
CreatedAt = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => x.Id);
})
.Annotation("MySql:CharSet", "latin1")
.Annotation("Relational:Collation", "latin1_swedish_ci");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "UploadTasks");
}
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,186 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IM_API.Migrations
{
/// <inheritdoc />
public partial class updateuploadtask : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameTable(
name: "UploadTasks",
newName: "upload_tasks");
migrationBuilder.AlterTable(
name: "upload_tasks")
.Annotation("MySql:CharSet", "utf8mb4")
.Annotation("Relational:Collation", "utf8mb4_general_ci")
.OldAnnotation("MySql:CharSet", "latin1")
.OldAnnotation("Relational:Collation", "latin1_swedish_ci");
migrationBuilder.AlterColumn<string>(
name: "StorageProvider",
table: "upload_tasks",
type: "longtext",
nullable: false,
collation: "utf8mb4_general_ci",
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "latin1")
.OldAnnotation("Relational:Collation", "latin1_swedish_ci");
migrationBuilder.AlterColumn<string>(
name: "ProviderUploadId",
table: "upload_tasks",
type: "longtext",
nullable: true,
collation: "utf8mb4_general_ci",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "latin1")
.OldAnnotation("Relational:Collation", "latin1_swedish_ci");
migrationBuilder.AlterColumn<string>(
name: "ObjectName",
table: "upload_tasks",
type: "longtext",
nullable: false,
collation: "utf8mb4_general_ci",
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "latin1")
.OldAnnotation("Relational:Collation", "latin1_swedish_ci");
migrationBuilder.AlterColumn<string>(
name: "FileName",
table: "upload_tasks",
type: "longtext",
nullable: false,
collation: "utf8mb4_general_ci",
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "latin1")
.OldAnnotation("Relational:Collation", "latin1_swedish_ci");
migrationBuilder.AlterColumn<string>(
name: "FileHash",
table: "upload_tasks",
type: "longtext",
nullable: false,
collation: "utf8mb4_general_ci",
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "latin1")
.OldAnnotation("Relational:Collation", "latin1_swedish_ci");
migrationBuilder.AlterColumn<string>(
name: "ContentType",
table: "upload_tasks",
type: "longtext",
nullable: false,
collation: "utf8mb4_general_ci",
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "latin1")
.OldAnnotation("Relational:Collation", "latin1_swedish_ci");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameTable(
name: "upload_tasks",
newName: "UploadTasks");
migrationBuilder.AlterTable(
name: "UploadTasks")
.Annotation("MySql:CharSet", "latin1")
.Annotation("Relational:Collation", "latin1_swedish_ci")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:Collation", "utf8mb4_general_ci");
migrationBuilder.AlterColumn<string>(
name: "StorageProvider",
table: "UploadTasks",
type: "longtext",
nullable: false,
collation: "latin1_swedish_ci",
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "latin1")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:Collation", "utf8mb4_general_ci");
migrationBuilder.AlterColumn<string>(
name: "ProviderUploadId",
table: "UploadTasks",
type: "longtext",
nullable: true,
collation: "latin1_swedish_ci",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "latin1")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:Collation", "utf8mb4_general_ci");
migrationBuilder.AlterColumn<string>(
name: "ObjectName",
table: "UploadTasks",
type: "longtext",
nullable: false,
collation: "latin1_swedish_ci",
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "latin1")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:Collation", "utf8mb4_general_ci");
migrationBuilder.AlterColumn<string>(
name: "FileName",
table: "UploadTasks",
type: "longtext",
nullable: false,
collation: "latin1_swedish_ci",
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "latin1")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:Collation", "utf8mb4_general_ci");
migrationBuilder.AlterColumn<string>(
name: "FileHash",
table: "UploadTasks",
type: "longtext",
nullable: false,
collation: "latin1_swedish_ci",
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "latin1")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:Collation", "utf8mb4_general_ci");
migrationBuilder.AlterColumn<string>(
name: "ContentType",
table: "UploadTasks",
type: "longtext",
nullable: false,
collation: "latin1_swedish_ci",
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "latin1")
.OldAnnotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("Relational:Collation", "utf8mb4_general_ci");
}
}
}
@@ -768,6 +768,59 @@ namespace IM_API.Migrations
MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
});
modelBuilder.Entity("IM_API.Models.Upload.UploadTask", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<int>("ChunkSize")
.HasColumnType("int");
b.Property<string>("ContentType")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("FileHash")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("longtext");
b.Property<long>("FileSize")
.HasColumnType("bigint");
b.Property<string>("ObjectName")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("ProviderUploadId")
.HasColumnType("longtext");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<string>("StorageProvider")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("TotalChunks")
.HasColumnType("int");
b.HasKey("Id")
.HasName("PRIMARY");
b.ToTable("upload_tasks", (string)null);
MySqlEntityTypeBuilderExtensions.HasCharSet(b, "utf8mb4");
MySqlEntityTypeBuilderExtensions.UseCollation(b, "utf8mb4_general_ci");
});
modelBuilder.Entity("IM_API.Models.User", b =>
{
b.Property<int>("Id")