mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Remove user's logo in db
This commit is contained in:
parent
530811b699
commit
8b92d0525f
@ -64,11 +64,6 @@ namespace Kyoo.Abstractions.Models
|
||||
/// <inheritdoc />
|
||||
public DateTime AddedDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A logo is a small image representing the resource.
|
||||
/// </summary>
|
||||
public Image? Logo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// User settings
|
||||
/// </summary>
|
||||
|
@ -60,8 +60,6 @@ public class UserRepository(DatabaseContext database, IThumbnailsManager thumbs)
|
||||
{
|
||||
await base.Create(obj);
|
||||
_database.Entry(obj).State = EntityState.Added;
|
||||
if (obj.Logo != null)
|
||||
_database.Entry(obj).Reference(x => x.Logo).TargetEntry!.State = EntityState.Added;
|
||||
await _database.SaveChangesAsync(() => Get(obj.Slug));
|
||||
await IRepository<User>.OnResourceCreated(obj);
|
||||
return obj;
|
||||
|
@ -327,7 +327,6 @@ namespace Kyoo.Postgresql
|
||||
)!
|
||||
)
|
||||
.HasColumnType("json");
|
||||
modelBuilder.Entity<User>().OwnsOne(x => x.Logo);
|
||||
|
||||
modelBuilder
|
||||
.Entity<MovieWatchStatus>()
|
||||
|
1276
back/src/Kyoo.Postgresql/Migrations/20240204193443_RemoveUserLogo.Designer.cs
generated
Normal file
1276
back/src/Kyoo.Postgresql/Migrations/20240204193443_RemoveUserLogo.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,37 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Kyoo.Postgresql.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class RemoveUserLogo : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "logo_blurhash",
|
||||
table: "users");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "logo_source",
|
||||
table: "users");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "logo_blurhash",
|
||||
table: "users",
|
||||
type: "character varying(32)",
|
||||
maxLength: 32,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "logo_source",
|
||||
table: "users",
|
||||
type: "text",
|
||||
nullable: true);
|
||||
}
|
||||
}
|
||||
}
|
@ -2,8 +2,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Kyoo.Abstractions.Models;
|
||||
using Kyoo.Postgresql;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
@ -1200,37 +1203,6 @@ namespace Kyoo.Postgresql.Migrations
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kyoo.Abstractions.Models.User", b =>
|
||||
{
|
||||
b.OwnsOne("Kyoo.Abstractions.Models.Image", "Logo", b1 =>
|
||||
{
|
||||
b1.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("id");
|
||||
|
||||
b1.Property<string>("Blurhash")
|
||||
.IsRequired()
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("character varying(32)")
|
||||
.HasColumnName("logo_blurhash");
|
||||
|
||||
b1.Property<string>("Source")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("logo_source");
|
||||
|
||||
b1.HasKey("UserId");
|
||||
|
||||
b1.ToTable("users");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("UserId")
|
||||
.HasConstraintName("fk_users_users_id");
|
||||
});
|
||||
|
||||
b.Navigation("Logo");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("link_collection_movie", b =>
|
||||
{
|
||||
b.HasOne("Kyoo.Abstractions.Models.Collection", null)
|
||||
|
Loading…
x
Reference in New Issue
Block a user