Добавлен вывод QR яндекса
This commit is contained in:
@@ -16,6 +16,7 @@ public class ApplicationDbContext : IdentityDbContext<ApplicationUser, IdentityR
|
||||
public DbSet<TrackAdditionLog> TrackAdditionLogs => Set<TrackAdditionLog>();
|
||||
public DbSet<TrackRemovalLog> TrackRemovalLogs => Set<TrackRemovalLog>();
|
||||
public DbSet<UserSession> UserSessions => Set<UserSession>();
|
||||
public DbSet<YandexAuthSession> YandexAuthSessions => Set<YandexAuthSession>();
|
||||
public DbSet<DataProtectionKey> DataProtectionKeys { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
@@ -102,5 +103,36 @@ public class ApplicationDbContext : IdentityDbContext<ApplicationUser, IdentityR
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
entity.Property(e => e.AddedAtUtc).IsRequired();
|
||||
});
|
||||
|
||||
|
||||
builder.Entity<YandexAuthSession>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Id);
|
||||
entity.Property(e => e.Id)
|
||||
.ValueGeneratedOnAdd();
|
||||
entity.HasOne(e => e.User)
|
||||
.WithMany()
|
||||
.HasForeignKey(e => e.UserId)
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
entity.Property(e => e.QrCodeUrl)
|
||||
.IsRequired()
|
||||
.HasMaxLength(500);
|
||||
entity.Property(e => e.SerializedCookies)
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
entity.Property(e => e.ConfirmedAt)
|
||||
.IsRequired(false);
|
||||
entity.Property(e => e.IsConfirmed)
|
||||
.IsRequired()
|
||||
.HasDefaultValue(false);
|
||||
entity.Property(e => e.TrackId)
|
||||
.HasMaxLength(100)
|
||||
.IsRequired(false);
|
||||
entity.Property(e => e.CsfrToken)
|
||||
.HasMaxLength(200)
|
||||
.IsRequired(false);
|
||||
entity.HasIndex(e => e.UserId)
|
||||
.HasDatabaseName("IX_YandexAuthSessions_UserId");
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user