- 前端 Header 新增搜索栏,接入已有 SearchFiles API,结果支持列表/网格视图 - 新增 PlaybackPosition 数据库列与 /api/files/progress 端点,播放进度存服务端 - 播放中每 5 秒自动保存进度,再次打开视频时弹出"继续播放"提示 - 目录浏览新增媒体类型过滤条(全部/视频/音频/文本),前端即时过滤 - 新增 4 种数据库迁移(AddPlaybackPosition)
464 lines
18 KiB
C#
464 lines
18 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using FileShare_EFCore.Database;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace FileShare_EFCore.Migrations.PostgreSQL
|
|
{
|
|
[DbContext(typeof(PostgreSqlAppDataContext))]
|
|
[Migration("20260522092330_AddPlaybackPosition")]
|
|
partial class AddPlaybackPosition
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "10.0.7")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("FileShare_EFCore.Models.ApiRefreshTokenEntity", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint")
|
|
.HasColumnName("id");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created-at");
|
|
|
|
b.Property<string>("Device")
|
|
.HasMaxLength(200)
|
|
.HasColumnType("character varying(200)")
|
|
.HasColumnName("device");
|
|
|
|
b.Property<DateTime>("ExpiresAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("expires-at");
|
|
|
|
b.Property<string>("IpAddress")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)")
|
|
.HasColumnName("ip-address");
|
|
|
|
b.Property<string>("ReplacedByTokenHash")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)")
|
|
.HasColumnName("replaced-by-token-hash");
|
|
|
|
b.Property<DateTime?>("RevokedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("revoked-at");
|
|
|
|
b.Property<string>("TokenHash")
|
|
.IsRequired()
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)")
|
|
.HasColumnName("token-hash");
|
|
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("user-id");
|
|
|
|
b.HasKey("Id")
|
|
.HasName("pk-api-refresh-token");
|
|
|
|
b.HasIndex("TokenHash")
|
|
.IsUnique()
|
|
.HasDatabaseName("idx-api-refresh-token-hash");
|
|
|
|
b.HasIndex("UserId")
|
|
.HasDatabaseName("idx-api-refresh-token-user-id");
|
|
|
|
b.ToTable("api-refresh-token", t =>
|
|
{
|
|
t.HasComment("API refresh token");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("FileShare_EFCore.Models.ManagedFileRecord", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer")
|
|
.HasColumnName("id");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("AbsolutePath")
|
|
.IsRequired()
|
|
.HasMaxLength(2048)
|
|
.HasColumnType("character varying(2048)")
|
|
.HasColumnName("absolute-path");
|
|
|
|
b.Property<string>("ContentType")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("character varying(100)")
|
|
.HasColumnName("content-type");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created-at");
|
|
|
|
b.Property<bool>("Exists")
|
|
.HasColumnType("boolean")
|
|
.HasColumnName("exists");
|
|
|
|
b.Property<string>("Extension")
|
|
.IsRequired()
|
|
.HasMaxLength(32)
|
|
.HasColumnType("character varying(32)")
|
|
.HasColumnName("extension");
|
|
|
|
b.Property<string>("FileName")
|
|
.IsRequired()
|
|
.HasMaxLength(260)
|
|
.HasColumnType("character varying(260)")
|
|
.HasColumnName("file-name");
|
|
|
|
b.Property<DateTime?>("LastPlayedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("last-played-at");
|
|
|
|
b.Property<DateTime>("LastSeenAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("last-seen-at");
|
|
|
|
b.Property<DateTime>("LastWriteTimeUtc")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("last-write-time-utc");
|
|
|
|
b.Property<int>("LibraryRootId")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("library-root-id");
|
|
|
|
b.Property<string>("MediaType")
|
|
.IsRequired()
|
|
.HasMaxLength(20)
|
|
.HasColumnType("character varying(20)")
|
|
.HasColumnName("media-type");
|
|
|
|
b.Property<double?>("PlaybackPosition")
|
|
.HasColumnType("double precision")
|
|
.HasColumnName("playback-position");
|
|
|
|
b.Property<string>("RelativePath")
|
|
.IsRequired()
|
|
.HasMaxLength(1024)
|
|
.HasColumnType("character varying(1024)")
|
|
.HasColumnName("relative-path");
|
|
|
|
b.Property<long>("SizeBytes")
|
|
.HasColumnType("bigint")
|
|
.HasColumnName("size-bytes");
|
|
|
|
b.Property<int?>("ThumbnailId")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("thumbnail-id");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated-at");
|
|
|
|
b.Property<double?>("VideoDuration")
|
|
.HasColumnType("double precision")
|
|
.HasColumnName("video-duration");
|
|
|
|
b.HasKey("Id")
|
|
.HasName("pk-managed-file-record");
|
|
|
|
b.HasIndex("AbsolutePath")
|
|
.IsUnique()
|
|
.HasDatabaseName("idx-managed-file-record-absolute-path");
|
|
|
|
b.HasIndex("LastPlayedAt")
|
|
.HasDatabaseName("idx-managed-file-record-last-played-at");
|
|
|
|
b.HasIndex("LibraryRootId")
|
|
.HasDatabaseName("idx-managed-file-record-root-id");
|
|
|
|
b.HasIndex("ThumbnailId")
|
|
.HasDatabaseName("idx-managed-file-record-thumbnail-id");
|
|
|
|
b.HasIndex("MediaType", "Exists")
|
|
.HasDatabaseName("idx-managed-file-record-media-type-exists");
|
|
|
|
b.ToTable("managed-file-record", t =>
|
|
{
|
|
t.HasComment("文件库文件记录");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("FileShare_EFCore.Models.ManagedLibraryRoot", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer")
|
|
.HasColumnName("id");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created-at");
|
|
|
|
b.Property<string>("DisplayName")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("character varying(200)")
|
|
.HasColumnName("display-name");
|
|
|
|
b.Property<bool>("IsAvailable")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("boolean")
|
|
.HasDefaultValue(true)
|
|
.HasColumnName("is-available");
|
|
|
|
b.Property<bool>("IsEnabled")
|
|
.HasColumnType("boolean")
|
|
.HasColumnName("is-enabled");
|
|
|
|
b.Property<DateTime?>("LastScanCompletedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("last-scan-completed-at");
|
|
|
|
b.Property<string>("LastScanError")
|
|
.HasMaxLength(2000)
|
|
.HasColumnType("character varying(2000)")
|
|
.HasColumnName("last-scan-error");
|
|
|
|
b.Property<DateTime?>("LastScanStartedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("last-scan-started-at");
|
|
|
|
b.Property<string>("Path")
|
|
.IsRequired()
|
|
.HasMaxLength(1024)
|
|
.HasColumnType("character varying(1024)")
|
|
.HasColumnName("path");
|
|
|
|
b.Property<int>("ScanIntervalMinutes")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("scan-interval-minutes");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated-at");
|
|
|
|
b.HasKey("Id")
|
|
.HasName("pk-managed-library-root");
|
|
|
|
b.HasIndex("Path")
|
|
.IsUnique()
|
|
.HasDatabaseName("idx-managed-library-root-path");
|
|
|
|
b.ToTable("managed-library-root", t =>
|
|
{
|
|
t.HasComment("文件库根目录");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("FileShare_EFCore.Models.ManagedThumbnailMap", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer")
|
|
.HasColumnName("id");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ContentType")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("character varying(100)")
|
|
.HasColumnName("content-type");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created-at");
|
|
|
|
b.Property<int>("LibraryRootId")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("library-root-id");
|
|
|
|
b.Property<string>("RelativePath")
|
|
.IsRequired()
|
|
.HasMaxLength(1024)
|
|
.HasColumnType("character varying(1024)")
|
|
.HasColumnName("relative-path");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated-at");
|
|
|
|
b.HasKey("Id")
|
|
.HasName("pk-managed-thumbnail-map");
|
|
|
|
b.HasIndex("LibraryRootId")
|
|
.HasDatabaseName("idx-managed-thumbnail-map-root-id");
|
|
|
|
b.HasIndex("RelativePath")
|
|
.IsUnique()
|
|
.HasDatabaseName("idx-managed-thumbnail-map-relative-path");
|
|
|
|
b.ToTable("managed-thumbnail-map", t =>
|
|
{
|
|
t.HasComment("文件缩略图映射记录");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("FileShare_EFCore.Models.UserEntity", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer")
|
|
.HasColumnName("id")
|
|
.HasComment("用户主键");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created-at")
|
|
.HasComment("创建时间");
|
|
|
|
b.Property<string>("Email")
|
|
.HasMaxLength(200)
|
|
.HasColumnType("character varying(200)")
|
|
.HasColumnName("email")
|
|
.HasComment("用户邮箱");
|
|
|
|
b.Property<string>("Name")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("character varying(100)")
|
|
.HasColumnName("name")
|
|
.HasComment("用户名称");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.HasMaxLength(200)
|
|
.HasColumnType("character varying(200)")
|
|
.HasColumnName("password-hash")
|
|
.HasComment("密码哈希值");
|
|
|
|
b.Property<string>("PhoneNumber")
|
|
.HasMaxLength(50)
|
|
.HasColumnType("character varying(50)")
|
|
.HasColumnName("phone-number")
|
|
.HasComment("电话号码");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated-at")
|
|
.HasComment("更新时间");
|
|
|
|
b.HasKey("Id")
|
|
.HasName("pk-user");
|
|
|
|
b.ToTable("user", t =>
|
|
{
|
|
t.HasComment("用户实体,演示数据库 CRUD 操作");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("FileShare_EFCore.Models.WeatherForecastEntity", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer")
|
|
.HasColumnName("id")
|
|
.HasComment("天气预报主键");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("created-at")
|
|
.HasComment("创建时间");
|
|
|
|
b.Property<DateOnly>("Date")
|
|
.HasColumnType("date")
|
|
.HasColumnName("date")
|
|
.HasComment("预报日期");
|
|
|
|
b.Property<string>("Summary")
|
|
.HasMaxLength(200)
|
|
.HasColumnType("character varying(200)")
|
|
.HasColumnName("summary")
|
|
.HasComment("天气摘要");
|
|
|
|
b.Property<int>("TemperatureC")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("temperature-c")
|
|
.HasComment("摄氏温度");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone")
|
|
.HasColumnName("updated-at")
|
|
.HasComment("更新时间");
|
|
|
|
b.HasKey("Id")
|
|
.HasName("pk-weather-forecast");
|
|
|
|
b.ToTable("weather-forecast", t =>
|
|
{
|
|
t.HasComment("天气预报数据实体");
|
|
});
|
|
});
|
|
|
|
modelBuilder.Entity("FileShare_EFCore.Models.ManagedFileRecord", b =>
|
|
{
|
|
b.HasOne("FileShare_EFCore.Models.ManagedLibraryRoot", "LibraryRoot")
|
|
.WithMany("Files")
|
|
.HasForeignKey("LibraryRootId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("FileShare_EFCore.Models.ManagedThumbnailMap", "Thumbnail")
|
|
.WithMany("Files")
|
|
.HasForeignKey("ThumbnailId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("LibraryRoot");
|
|
|
|
b.Navigation("Thumbnail");
|
|
});
|
|
|
|
modelBuilder.Entity("FileShare_EFCore.Models.ManagedThumbnailMap", b =>
|
|
{
|
|
b.HasOne("FileShare_EFCore.Models.ManagedLibraryRoot", "LibraryRoot")
|
|
.WithMany("Thumbnails")
|
|
.HasForeignKey("LibraryRootId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("LibraryRoot");
|
|
});
|
|
|
|
modelBuilder.Entity("FileShare_EFCore.Models.ManagedLibraryRoot", b =>
|
|
{
|
|
b.Navigation("Files");
|
|
|
|
b.Navigation("Thumbnails");
|
|
});
|
|
|
|
modelBuilder.Entity("FileShare_EFCore.Models.ManagedThumbnailMap", b =>
|
|
{
|
|
b.Navigation("Files");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|