mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 20:24:27 -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 />
|
/// <inheritdoc />
|
||||||
public DateTime AddedDate { get; set; }
|
public DateTime AddedDate { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// A logo is a small image representing the resource.
|
|
||||||
/// </summary>
|
|
||||||
public Image? Logo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// User settings
|
/// User settings
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -60,8 +60,6 @@ public class UserRepository(DatabaseContext database, IThumbnailsManager thumbs)
|
|||||||
{
|
{
|
||||||
await base.Create(obj);
|
await base.Create(obj);
|
||||||
_database.Entry(obj).State = EntityState.Added;
|
_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 _database.SaveChangesAsync(() => Get(obj.Slug));
|
||||||
await IRepository<User>.OnResourceCreated(obj);
|
await IRepository<User>.OnResourceCreated(obj);
|
||||||
return obj;
|
return obj;
|
||||||
|
@ -327,7 +327,6 @@ namespace Kyoo.Postgresql
|
|||||||
)!
|
)!
|
||||||
)
|
)
|
||||||
.HasColumnType("json");
|
.HasColumnType("json");
|
||||||
modelBuilder.Entity<User>().OwnsOne(x => x.Logo);
|
|
||||||
|
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.Entity<MovieWatchStatus>()
|
.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;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Kyoo.Abstractions.Models;
|
using Kyoo.Abstractions.Models;
|
||||||
|
using Kyoo.Postgresql;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
@ -1200,37 +1203,6 @@ namespace Kyoo.Postgresql.Migrations
|
|||||||
b.Navigation("User");
|
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 =>
|
modelBuilder.Entity("link_collection_movie", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Kyoo.Abstractions.Models.Collection", null)
|
b.HasOne("Kyoo.Abstractions.Models.Collection", null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user