548 lines
20 KiB
C#
548 lines
20 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using PlaylistShared.Api.Data;
|
|
|
|
#nullable disable
|
|
|
|
namespace PlaylistShared.Api.Data.Migrations
|
|
{
|
|
[DbContext(typeof(ApplicationDbContext))]
|
|
[Migration("20260414094124_AddSharedPermissions")]
|
|
partial class AddSharedPermissions
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "10.0.5")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
|
|
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("ConcurrencyStamp")
|
|
.IsConcurrencyToken()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Name")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.Property<string>("NormalizedName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("NormalizedName")
|
|
.IsUnique()
|
|
.HasDatabaseName("RoleNameIndex")
|
|
.HasFilter("[NormalizedName] IS NOT NULL");
|
|
|
|
b.ToTable("AspNetRoles", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ClaimType")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ClaimValue")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<Guid>("RoleId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("RoleId");
|
|
|
|
b.ToTable("AspNetRoleClaims", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ClaimType")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ClaimValue")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("AspNetUserClaims", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
|
{
|
|
b.Property<string>("LoginProvider")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<string>("ProviderKey")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<string>("ProviderDisplayName")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.HasKey("LoginProvider", "ProviderKey");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("AspNetUserLogins", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
|
{
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<Guid>("RoleId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.HasKey("UserId", "RoleId");
|
|
|
|
b.HasIndex("RoleId");
|
|
|
|
b.ToTable("AspNetUserRoles", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
|
{
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("LoginProvider")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<string>("Name")
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<string>("Value")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("UserId", "LoginProvider", "Name");
|
|
|
|
b.ToTable("AspNetUserTokens", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("PlaylistShared.Api.Entities.ApplicationUser", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<int>("AccessFailedCount")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ConcurrencyStamp")
|
|
.IsConcurrencyToken()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Email")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.Property<bool>("EmailConfirmed")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<bool>("LockoutEnabled")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<DateTimeOffset?>("LockoutEnd")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<string>("NormalizedEmail")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.Property<string>("NormalizedUserName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("PhoneNumber")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("PhoneNumberConfirmed")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("RefreshToken")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("RefreshTokenExpiryUtc")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("SecurityStamp")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("TwoFactorEnabled")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<string>("UserName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.Property<string>("YandexAccessToken")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("YandexId")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("YandexRefreshToken")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("YandexTokenExpiryUtc")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("NormalizedEmail")
|
|
.HasDatabaseName("EmailIndex");
|
|
|
|
b.HasIndex("NormalizedUserName")
|
|
.IsUnique()
|
|
.HasDatabaseName("UserNameIndex")
|
|
.HasFilter("[NormalizedUserName] IS NOT NULL");
|
|
|
|
b.ToTable("AspNetUsers", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("PlaylistShared.Api.Entities.SharedPlaylist", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<int>("AddPermission")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("CoverUrl")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<Guid>("CreatorUserId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("Description")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<int>("PlayPermission")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("RemovePermission")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ShareToken")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.Property<string>("Title")
|
|
.IsRequired()
|
|
.HasMaxLength(255)
|
|
.HasColumnType("nvarchar(255)");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int>("ViewPermission")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("YandexPlaylistKind")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("nvarchar(50)");
|
|
|
|
b.Property<string>("YandexPlaylistOwnerUid")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("nvarchar(50)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CreatorUserId");
|
|
|
|
b.HasIndex("ShareToken")
|
|
.IsUnique();
|
|
|
|
b.ToTable("SharedPlaylists");
|
|
});
|
|
|
|
modelBuilder.Entity("PlaylistShared.Api.Entities.TrackAdditionLog", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTime>("AddedAtUtc")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<Guid?>("AddedByUserId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("SessionId")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(449)");
|
|
|
|
b.Property<Guid>("SharedPlaylistId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("TrackId")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AddedByUserId");
|
|
|
|
b.HasIndex("SessionId");
|
|
|
|
b.HasIndex("SharedPlaylistId", "TrackId");
|
|
|
|
b.ToTable("TrackAdditionLogs");
|
|
});
|
|
|
|
modelBuilder.Entity("PlaylistShared.Api.Entities.UserSession", b =>
|
|
{
|
|
b.Property<string>("SessionId")
|
|
.HasMaxLength(449)
|
|
.HasColumnType("nvarchar(449)");
|
|
|
|
b.Property<Guid?>("AssociatedUserId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("ClientIpAddress")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<DateTime>("FirstSeenUtc")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<DateTime>("LastSeenUtc")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("UserAgent")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("SessionId");
|
|
|
|
b.HasIndex("AssociatedUserId");
|
|
|
|
b.ToTable("UserSessions");
|
|
});
|
|
|
|
modelBuilder.Entity("TrackRemovalLog", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTime>("RemovedAtUtc")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<Guid?>("RemovedByUserId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("SessionId")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(449)");
|
|
|
|
b.Property<Guid>("SharedPlaylistId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("TrackId")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(450)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("RemovedByUserId");
|
|
|
|
b.HasIndex("SessionId");
|
|
|
|
b.HasIndex("SharedPlaylistId", "TrackId");
|
|
|
|
b.ToTable("TrackRemovalLogs");
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
|
{
|
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", null)
|
|
.WithMany()
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
|
{
|
|
b.HasOne("PlaylistShared.Api.Entities.ApplicationUser", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
|
{
|
|
b.HasOne("PlaylistShared.Api.Entities.ApplicationUser", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
|
{
|
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", null)
|
|
.WithMany()
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PlaylistShared.Api.Entities.ApplicationUser", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
|
{
|
|
b.HasOne("PlaylistShared.Api.Entities.ApplicationUser", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("PlaylistShared.Api.Entities.SharedPlaylist", b =>
|
|
{
|
|
b.HasOne("PlaylistShared.Api.Entities.ApplicationUser", "Creator")
|
|
.WithMany("OwnedPlaylists")
|
|
.HasForeignKey("CreatorUserId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Creator");
|
|
});
|
|
|
|
modelBuilder.Entity("PlaylistShared.Api.Entities.TrackAdditionLog", b =>
|
|
{
|
|
b.HasOne("PlaylistShared.Api.Entities.ApplicationUser", "AddedByUser")
|
|
.WithMany()
|
|
.HasForeignKey("AddedByUserId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.HasOne("PlaylistShared.Api.Entities.UserSession", "Session")
|
|
.WithMany("TrackAdditionLogs")
|
|
.HasForeignKey("SessionId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PlaylistShared.Api.Entities.SharedPlaylist", "SharedPlaylist")
|
|
.WithMany("TrackAdditionLogs")
|
|
.HasForeignKey("SharedPlaylistId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("AddedByUser");
|
|
|
|
b.Navigation("Session");
|
|
|
|
b.Navigation("SharedPlaylist");
|
|
});
|
|
|
|
modelBuilder.Entity("PlaylistShared.Api.Entities.UserSession", b =>
|
|
{
|
|
b.HasOne("PlaylistShared.Api.Entities.ApplicationUser", "User")
|
|
.WithMany()
|
|
.HasForeignKey("AssociatedUserId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("TrackRemovalLog", b =>
|
|
{
|
|
b.HasOne("PlaylistShared.Api.Entities.ApplicationUser", "RemovedByUser")
|
|
.WithMany()
|
|
.HasForeignKey("RemovedByUserId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.HasOne("PlaylistShared.Api.Entities.UserSession", "Session")
|
|
.WithMany("TrackRemovalLogs")
|
|
.HasForeignKey("SessionId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PlaylistShared.Api.Entities.SharedPlaylist", "SharedPlaylist")
|
|
.WithMany()
|
|
.HasForeignKey("SharedPlaylistId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("RemovedByUser");
|
|
|
|
b.Navigation("Session");
|
|
|
|
b.Navigation("SharedPlaylist");
|
|
});
|
|
|
|
modelBuilder.Entity("PlaylistShared.Api.Entities.ApplicationUser", b =>
|
|
{
|
|
b.Navigation("OwnedPlaylists");
|
|
});
|
|
|
|
modelBuilder.Entity("PlaylistShared.Api.Entities.SharedPlaylist", b =>
|
|
{
|
|
b.Navigation("TrackAdditionLogs");
|
|
});
|
|
|
|
modelBuilder.Entity("PlaylistShared.Api.Entities.UserSession", b =>
|
|
{
|
|
b.Navigation("TrackAdditionLogs");
|
|
|
|
b.Navigation("TrackRemovalLogs");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|