mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Migrate to dotnet8 (#350)
This commit is contained in:
commit
6143125f7a
@ -1,4 +1,4 @@
|
||||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0 as builder
|
||||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 as builder
|
||||
ARG TARGETARCH
|
||||
WORKDIR /kyoo
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:7.0
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0
|
||||
RUN apt-get update && apt-get install -y curl
|
||||
WORKDIR /app
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<LangVersion>preview</LangVersion>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<LangVersion>default</LangVersion>
|
||||
<Company>Kyoo</Company>
|
||||
<Authors>Kyoo</Authors>
|
||||
<Copyright>Copyright (c) Kyoo</Copyright>
|
||||
|
@ -7,13 +7,13 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Autofac" Version="7.1.0" />
|
||||
<PackageReference Include="Dapper" Version="2.1.24" />
|
||||
<PackageReference Include="Autofac" Version="8.0.0" />
|
||||
<PackageReference Include="Dapper" Version="2.1.35" />
|
||||
<PackageReference Include="EntityFrameworkCore.Projectables" Version="4.1.4-prebeta" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
|
||||
<PackageReference Include="Sprache" Version="2.3.1" />
|
||||
<PackageReference Include="System.ComponentModel.Composition" Version="7.0.0" />
|
||||
<PackageReference Include="System.ComponentModel.Composition" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -17,7 +17,6 @@
|
||||
// along with Kyoo. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Kyoo.Abstractions.Models.Exceptions;
|
||||
|
||||
@ -25,28 +24,11 @@ namespace Kyoo.Abstractions.Models.Exceptions;
|
||||
/// An exception raised when an item already exists in the database.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class DuplicatedItemException : Exception
|
||||
public class DuplicatedItemException(object? existing = null)
|
||||
: Exception("Already exists in the database.")
|
||||
{
|
||||
/// <summary>
|
||||
/// The existing object.
|
||||
/// </summary>
|
||||
public object? Existing { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="DuplicatedItemException"/> with the default message.
|
||||
/// </summary>
|
||||
/// <param name="existing">The existing object.</param>
|
||||
public DuplicatedItemException(object? existing = null)
|
||||
: base("Already exists in the database.")
|
||||
{
|
||||
Existing = existing;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The serialization constructor.
|
||||
/// </summary>
|
||||
/// <param name="info">Serialization infos</param>
|
||||
/// <param name="context">The serialization context</param>
|
||||
protected DuplicatedItemException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context) { }
|
||||
public object? Existing { get; } = existing;
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
// along with Kyoo. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Kyoo.Abstractions.Models.Exceptions;
|
||||
|
||||
@ -39,12 +38,4 @@ public class ItemNotFoundException : Exception
|
||||
/// <param name="message">The message of the exception</param>
|
||||
public ItemNotFoundException(string message)
|
||||
: base(message) { }
|
||||
|
||||
/// <summary>
|
||||
/// The serialization constructor
|
||||
/// </summary>
|
||||
/// <param name="info">Serialization infos</param>
|
||||
/// <param name="context">The serialization context</param>
|
||||
protected ItemNotFoundException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context) { }
|
||||
}
|
||||
|
@ -17,7 +17,6 @@
|
||||
// along with Kyoo. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Kyoo.Abstractions.Models.Exceptions;
|
||||
|
||||
@ -29,7 +28,4 @@ public class UnauthorizedException : Exception
|
||||
|
||||
public UnauthorizedException(string message)
|
||||
: base(message) { }
|
||||
|
||||
protected UnauthorizedException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context) { }
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.12" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.3" />
|
||||
<PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
|
||||
|
||||
<ProjectReference Include="../Kyoo.Abstractions/Kyoo.Abstractions.csproj" />
|
||||
|
@ -446,7 +446,7 @@ public class AuthApi(
|
||||
{
|
||||
Stream img = await thumbs.GetUserImage(User.GetIdOrThrow());
|
||||
// Allow clients to cache the image for 6 month.
|
||||
Response.Headers.Add("Cache-Control", $"public, max-age={60 * 60 * 24 * 31 * 6}");
|
||||
Response.Headers.CacheControl = $"public, max-age={60 * 60 * 24 * 31 * 6}";
|
||||
return File(img, "image/webp", true);
|
||||
}
|
||||
|
||||
|
@ -6,14 +6,14 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AspNetCore.Proxy" Version="4.4.0" />
|
||||
<PackageReference Include="AspNetCore.Proxy" Version="4.5.0" />
|
||||
<PackageReference Include="Blurhash.SkiaSharp" Version="2.0.0" />
|
||||
<PackageReference Include="Dapper" Version="2.1.24" />
|
||||
<PackageReference Include="InterpolatedSql.Dapper" Version="2.1.0" />
|
||||
<PackageReference Include="FlexLabs.EntityFrameworkCore.Upsert" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.9" />
|
||||
<PackageReference Include="SkiaSharp" Version="2.88.6" />
|
||||
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.6" />
|
||||
<PackageReference Include="Dapper" Version="2.1.35" />
|
||||
<PackageReference Include="InterpolatedSql.Dapper" Version="2.3.0" />
|
||||
<PackageReference Include="FlexLabs.EntityFrameworkCore.Upsert" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />
|
||||
<PackageReference Include="SkiaSharp" Version="2.88.7" />
|
||||
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.7" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -74,10 +74,10 @@ public class CrudThumbsApi<T> : CrudApi<T>
|
||||
if (!identifier.Match(id => false, slug => slug == "random"))
|
||||
{
|
||||
// Allow clients to cache the image for 6 month.
|
||||
Response.Headers.Add("Cache-Control", $"public, max-age={60 * 60 * 24 * 31 * 6}");
|
||||
Response.Headers.CacheControl = $"public, max-age={60 * 60 * 24 * 31 * 6}";
|
||||
}
|
||||
else
|
||||
Response.Headers.Add("Cache-Control", $"public, no-store");
|
||||
Response.Headers.CacheControl = $"public, no-store";
|
||||
return PhysicalFile(Path.GetFullPath(path), "image/webp", true);
|
||||
}
|
||||
|
||||
|
@ -59,11 +59,11 @@ public class UserApi(ILibraryManager libraryManager, IThumbnailsManager thumbs)
|
||||
);
|
||||
Stream img = await thumbs.GetUserImage(gid);
|
||||
if (identifier.Is("random"))
|
||||
Response.Headers.Add("Cache-Control", $"public, no-store");
|
||||
Response.Headers.CacheControl = $"public, no-store";
|
||||
else
|
||||
{
|
||||
// Allow clients to cache the image for 6 month.
|
||||
Response.Headers.Add("Cache-Control", $"public, max-age={60 * 60 * 24 * 31 * 6}");
|
||||
Response.Headers.CacheControl = $"public, max-age={60 * 60 * 24 * 31 * 6}";
|
||||
}
|
||||
return File(img, "image/webp", true);
|
||||
}
|
||||
|
@ -10,14 +10,14 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Serilog" Version="3.0.1" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0" />
|
||||
<PackageReference Include="Serilog" Version="3.1.1" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
|
||||
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
|
||||
<PackageReference Include="Serilog.Expressions" Version="3.4.1" />
|
||||
<PackageReference Include="Serilog.Expressions" Version="4.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.SyslogMessages" Version="3.0.1" />
|
||||
<PackageReference Include="System.Collections.Immutable" Version="7.0.0" />
|
||||
<PackageReference Include="Autofac" Version="7.1.0" />
|
||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="8.0.0" />
|
||||
<PackageReference Include="System.Collections.Immutable" Version="8.0.0" />
|
||||
<PackageReference Include="Autofac" Version="8.0.0" />
|
||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="9.0.0" />
|
||||
<PackageReference Include="Autofac.Extras.AttributeMetadata" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -136,42 +136,12 @@ public class PluginsStartup
|
||||
/// A simple host service provider used to activate plugins instance.
|
||||
/// The same services as a generic host are available and an <see cref="ILoggerFactory"/> has been added.
|
||||
/// </summary>
|
||||
private class HostServiceProvider : IServiceProvider
|
||||
private class HostServiceProvider(
|
||||
IWebHostEnvironment hostEnvironment,
|
||||
IConfiguration configuration,
|
||||
ILoggerFactory loggerFactory
|
||||
) : IServiceProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// The host environment that could be used by plugins to configure themself.
|
||||
/// </summary>
|
||||
private readonly IWebHostEnvironment _hostEnvironment;
|
||||
|
||||
/// <summary>
|
||||
/// The configuration context.
|
||||
/// </summary>
|
||||
private readonly IConfiguration _configuration;
|
||||
|
||||
/// <summary>
|
||||
/// A logger factory used to create a logger for the plugin manager.
|
||||
/// </summary>
|
||||
private readonly ILoggerFactory _loggerFactory;
|
||||
|
||||
/// <summary>
|
||||
/// Create a new <see cref="HostServiceProvider"/> that will return given services when asked.
|
||||
/// </summary>
|
||||
/// <param name="hostEnvironment">
|
||||
/// The host environment that could be used by plugins to configure themself.
|
||||
/// </param>
|
||||
/// <param name="configuration">The configuration context</param>
|
||||
/// <param name="loggerFactory">A logger factory used to create a logger for the plugin manager.</param>
|
||||
public HostServiceProvider(
|
||||
IWebHostEnvironment hostEnvironment,
|
||||
IConfiguration configuration,
|
||||
ILoggerFactory loggerFactory
|
||||
)
|
||||
{
|
||||
_hostEnvironment = hostEnvironment;
|
||||
_configuration = configuration;
|
||||
_loggerFactory = loggerFactory;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public object GetService(Type serviceType)
|
||||
{
|
||||
@ -179,20 +149,45 @@ public class PluginsStartup
|
||||
serviceType == typeof(IWebHostEnvironment)
|
||||
|| serviceType == typeof(IHostEnvironment)
|
||||
)
|
||||
return _hostEnvironment;
|
||||
return hostEnvironment;
|
||||
if (serviceType == typeof(IConfiguration))
|
||||
return _configuration;
|
||||
if (serviceType.GetGenericTypeDefinition() == typeof(ILogger<>))
|
||||
return configuration;
|
||||
if (serviceType == typeof(IServiceProviderIsService))
|
||||
return new ProviderIsService();
|
||||
if (
|
||||
serviceType.IsGenericType
|
||||
&& serviceType.GetGenericTypeDefinition() == typeof(ILogger<>)
|
||||
)
|
||||
{
|
||||
return Utility.RunGenericMethod<object>(
|
||||
typeof(LoggerFactoryExtensions),
|
||||
nameof(LoggerFactoryExtensions.CreateLogger),
|
||||
serviceType.GetGenericArguments().First(),
|
||||
_loggerFactory
|
||||
loggerFactory
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
throw new ArgumentException(
|
||||
$"{serviceType.Name} is not available in configuration stpe"
|
||||
);
|
||||
}
|
||||
|
||||
public class ProviderIsService : IServiceProviderIsService
|
||||
{
|
||||
public bool IsService(Type serviceType)
|
||||
{
|
||||
Type[] supported =
|
||||
[
|
||||
typeof(IWebHostEnvironment),
|
||||
typeof(IHostEnvironment),
|
||||
typeof(IConfiguration),
|
||||
typeof(IServiceProviderIsService),
|
||||
];
|
||||
if (supported.Contains(serviceType))
|
||||
return true;
|
||||
return serviceType.IsGenericType
|
||||
&& serviceType.GetGenericTypeDefinition() == typeof(ILogger<>);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MeiliSearch" Version="0.14.6" />
|
||||
<PackageReference Include="MeiliSearch" Version="0.15.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -6,16 +6,16 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Dapper" Version="2.1.24" />
|
||||
<PackageReference Include="EFCore.NamingConventions" Version="7.0.2" />
|
||||
<PackageReference Include="Dapper" Version="2.1.35" />
|
||||
<PackageReference Include="EFCore.NamingConventions" Version="8.0.3" />
|
||||
<PackageReference Include="EntityFrameworkCore.Projectables" Version="4.1.4-prebeta" />
|
||||
<PackageReference Include="InterpolatedSql.Dapper" Version="2.1.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.12">
|
||||
<PackageReference Include="InterpolatedSql.Dapper" Version="2.3.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.3">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="7.0.12" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.11" />
|
||||
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="8.0.3" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -22,203 +22,199 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Kyoo.Postgresql.Migrations
|
||||
namespace Kyoo.Postgresql.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class Watchlist : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Watchlist : Migration
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder
|
||||
.AlterDatabase()
|
||||
.Annotation(
|
||||
"Npgsql:Enum:genre",
|
||||
"action,adventure,animation,comedy,crime,documentary,drama,family,fantasy,history,horror,music,mystery,romance,science_fiction,thriller,war,western"
|
||||
)
|
||||
.Annotation("Npgsql:Enum:status", "unknown,finished,airing,planned")
|
||||
.Annotation("Npgsql:Enum:watch_status", "completed,watching,droped,planned")
|
||||
.OldAnnotation(
|
||||
"Npgsql:Enum:genre",
|
||||
"action,adventure,animation,comedy,crime,documentary,drama,family,fantasy,history,horror,music,mystery,romance,science_fiction,thriller,war,western"
|
||||
)
|
||||
.OldAnnotation("Npgsql:Enum:status", "unknown,finished,airing,planned");
|
||||
migrationBuilder
|
||||
.AlterDatabase()
|
||||
.Annotation(
|
||||
"Npgsql:Enum:genre",
|
||||
"action,adventure,animation,comedy,crime,documentary,drama,family,fantasy,history,horror,music,mystery,romance,science_fiction,thriller,war,western"
|
||||
)
|
||||
.Annotation("Npgsql:Enum:status", "unknown,finished,airing,planned")
|
||||
.Annotation("Npgsql:Enum:watch_status", "completed,watching,droped,planned")
|
||||
.OldAnnotation(
|
||||
"Npgsql:Enum:genre",
|
||||
"action,adventure,animation,comedy,crime,documentary,drama,family,fantasy,history,horror,music,mystery,romance,science_fiction,thriller,war,western"
|
||||
)
|
||||
.OldAnnotation("Npgsql:Enum:status", "unknown,finished,airing,planned");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "episode_watch_status",
|
||||
columns: table => new
|
||||
{
|
||||
user_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
episode_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
added_date = table.Column<DateTime>(
|
||||
type: "timestamp with time zone",
|
||||
nullable: false,
|
||||
defaultValueSql: "now() at time zone 'utc'"
|
||||
),
|
||||
played_date = table.Column<DateTime>(
|
||||
type: "timestamp with time zone",
|
||||
nullable: true
|
||||
),
|
||||
status = table.Column<WatchStatus>(type: "watch_status", nullable: false),
|
||||
watched_time = table.Column<int>(type: "integer", nullable: true),
|
||||
watched_percent = table.Column<int>(type: "integer", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey(
|
||||
"pk_episode_watch_status",
|
||||
x => new { x.user_id, x.episode_id }
|
||||
);
|
||||
table.ForeignKey(
|
||||
name: "fk_episode_watch_status_episodes_episode_id",
|
||||
column: x => x.episode_id,
|
||||
principalTable: "episodes",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
table.ForeignKey(
|
||||
name: "fk_episode_watch_status_users_user_id",
|
||||
column: x => x.user_id,
|
||||
principalTable: "users",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
}
|
||||
);
|
||||
migrationBuilder.CreateTable(
|
||||
name: "episode_watch_status",
|
||||
columns: table => new
|
||||
{
|
||||
user_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
episode_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
added_date = table.Column<DateTime>(
|
||||
type: "timestamp with time zone",
|
||||
nullable: false,
|
||||
defaultValueSql: "now() at time zone 'utc'"
|
||||
),
|
||||
played_date = table.Column<DateTime>(
|
||||
type: "timestamp with time zone",
|
||||
nullable: true
|
||||
),
|
||||
status = table.Column<WatchStatus>(type: "watch_status", nullable: false),
|
||||
watched_time = table.Column<int>(type: "integer", nullable: true),
|
||||
watched_percent = table.Column<int>(type: "integer", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_episode_watch_status", x => new { x.user_id, x.episode_id });
|
||||
table.ForeignKey(
|
||||
name: "fk_episode_watch_status_episodes_episode_id",
|
||||
column: x => x.episode_id,
|
||||
principalTable: "episodes",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
table.ForeignKey(
|
||||
name: "fk_episode_watch_status_users_user_id",
|
||||
column: x => x.user_id,
|
||||
principalTable: "users",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "movie_watch_status",
|
||||
columns: table => new
|
||||
{
|
||||
user_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
movie_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
added_date = table.Column<DateTime>(
|
||||
type: "timestamp with time zone",
|
||||
nullable: false,
|
||||
defaultValueSql: "now() at time zone 'utc'"
|
||||
),
|
||||
played_date = table.Column<DateTime>(
|
||||
type: "timestamp with time zone",
|
||||
nullable: true
|
||||
),
|
||||
status = table.Column<WatchStatus>(type: "watch_status", nullable: false),
|
||||
watched_time = table.Column<int>(type: "integer", nullable: true),
|
||||
watched_percent = table.Column<int>(type: "integer", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_movie_watch_status", x => new { x.user_id, x.movie_id });
|
||||
table.ForeignKey(
|
||||
name: "fk_movie_watch_status_movies_movie_id",
|
||||
column: x => x.movie_id,
|
||||
principalTable: "movies",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
table.ForeignKey(
|
||||
name: "fk_movie_watch_status_users_user_id",
|
||||
column: x => x.user_id,
|
||||
principalTable: "users",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
}
|
||||
);
|
||||
migrationBuilder.CreateTable(
|
||||
name: "movie_watch_status",
|
||||
columns: table => new
|
||||
{
|
||||
user_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
movie_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
added_date = table.Column<DateTime>(
|
||||
type: "timestamp with time zone",
|
||||
nullable: false,
|
||||
defaultValueSql: "now() at time zone 'utc'"
|
||||
),
|
||||
played_date = table.Column<DateTime>(
|
||||
type: "timestamp with time zone",
|
||||
nullable: true
|
||||
),
|
||||
status = table.Column<WatchStatus>(type: "watch_status", nullable: false),
|
||||
watched_time = table.Column<int>(type: "integer", nullable: true),
|
||||
watched_percent = table.Column<int>(type: "integer", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_movie_watch_status", x => new { x.user_id, x.movie_id });
|
||||
table.ForeignKey(
|
||||
name: "fk_movie_watch_status_movies_movie_id",
|
||||
column: x => x.movie_id,
|
||||
principalTable: "movies",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
table.ForeignKey(
|
||||
name: "fk_movie_watch_status_users_user_id",
|
||||
column: x => x.user_id,
|
||||
principalTable: "users",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "show_watch_status",
|
||||
columns: table => new
|
||||
{
|
||||
user_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
show_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
added_date = table.Column<DateTime>(
|
||||
type: "timestamp with time zone",
|
||||
nullable: false,
|
||||
defaultValueSql: "now() at time zone 'utc'"
|
||||
),
|
||||
played_date = table.Column<DateTime>(
|
||||
type: "timestamp with time zone",
|
||||
nullable: true
|
||||
),
|
||||
status = table.Column<WatchStatus>(type: "watch_status", nullable: false),
|
||||
unseen_episodes_count = table.Column<int>(type: "integer", nullable: false),
|
||||
next_episode_id = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
watched_time = table.Column<int>(type: "integer", nullable: true),
|
||||
watched_percent = table.Column<int>(type: "integer", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_show_watch_status", x => new { x.user_id, x.show_id });
|
||||
table.ForeignKey(
|
||||
name: "fk_show_watch_status_episodes_next_episode_id",
|
||||
column: x => x.next_episode_id,
|
||||
principalTable: "episodes",
|
||||
principalColumn: "id"
|
||||
);
|
||||
table.ForeignKey(
|
||||
name: "fk_show_watch_status_shows_show_id",
|
||||
column: x => x.show_id,
|
||||
principalTable: "shows",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
table.ForeignKey(
|
||||
name: "fk_show_watch_status_users_user_id",
|
||||
column: x => x.user_id,
|
||||
principalTable: "users",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
}
|
||||
);
|
||||
migrationBuilder.CreateTable(
|
||||
name: "show_watch_status",
|
||||
columns: table => new
|
||||
{
|
||||
user_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
show_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
added_date = table.Column<DateTime>(
|
||||
type: "timestamp with time zone",
|
||||
nullable: false,
|
||||
defaultValueSql: "now() at time zone 'utc'"
|
||||
),
|
||||
played_date = table.Column<DateTime>(
|
||||
type: "timestamp with time zone",
|
||||
nullable: true
|
||||
),
|
||||
status = table.Column<WatchStatus>(type: "watch_status", nullable: false),
|
||||
unseen_episodes_count = table.Column<int>(type: "integer", nullable: false),
|
||||
next_episode_id = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
watched_time = table.Column<int>(type: "integer", nullable: true),
|
||||
watched_percent = table.Column<int>(type: "integer", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_show_watch_status", x => new { x.user_id, x.show_id });
|
||||
table.ForeignKey(
|
||||
name: "fk_show_watch_status_episodes_next_episode_id",
|
||||
column: x => x.next_episode_id,
|
||||
principalTable: "episodes",
|
||||
principalColumn: "id"
|
||||
);
|
||||
table.ForeignKey(
|
||||
name: "fk_show_watch_status_shows_show_id",
|
||||
column: x => x.show_id,
|
||||
principalTable: "shows",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
table.ForeignKey(
|
||||
name: "fk_show_watch_status_users_user_id",
|
||||
column: x => x.user_id,
|
||||
principalTable: "users",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_episode_watch_status_episode_id",
|
||||
table: "episode_watch_status",
|
||||
column: "episode_id"
|
||||
);
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_episode_watch_status_episode_id",
|
||||
table: "episode_watch_status",
|
||||
column: "episode_id"
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_movie_watch_status_movie_id",
|
||||
table: "movie_watch_status",
|
||||
column: "movie_id"
|
||||
);
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_movie_watch_status_movie_id",
|
||||
table: "movie_watch_status",
|
||||
column: "movie_id"
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_show_watch_status_next_episode_id",
|
||||
table: "show_watch_status",
|
||||
column: "next_episode_id"
|
||||
);
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_show_watch_status_next_episode_id",
|
||||
table: "show_watch_status",
|
||||
column: "next_episode_id"
|
||||
);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_show_watch_status_show_id",
|
||||
table: "show_watch_status",
|
||||
column: "show_id"
|
||||
);
|
||||
}
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_show_watch_status_show_id",
|
||||
table: "show_watch_status",
|
||||
column: "show_id"
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(name: "episode_watch_status");
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(name: "episode_watch_status");
|
||||
|
||||
migrationBuilder.DropTable(name: "movie_watch_status");
|
||||
migrationBuilder.DropTable(name: "movie_watch_status");
|
||||
|
||||
migrationBuilder.DropTable(name: "show_watch_status");
|
||||
migrationBuilder.DropTable(name: "show_watch_status");
|
||||
|
||||
migrationBuilder
|
||||
.AlterDatabase()
|
||||
.Annotation(
|
||||
"Npgsql:Enum:genre",
|
||||
"action,adventure,animation,comedy,crime,documentary,drama,family,fantasy,history,horror,music,mystery,romance,science_fiction,thriller,war,western"
|
||||
)
|
||||
.Annotation("Npgsql:Enum:status", "unknown,finished,airing,planned")
|
||||
.OldAnnotation(
|
||||
"Npgsql:Enum:genre",
|
||||
"action,adventure,animation,comedy,crime,documentary,drama,family,fantasy,history,horror,music,mystery,romance,science_fiction,thriller,war,western"
|
||||
)
|
||||
.OldAnnotation("Npgsql:Enum:status", "unknown,finished,airing,planned")
|
||||
.OldAnnotation("Npgsql:Enum:watch_status", "completed,watching,droped,planned");
|
||||
}
|
||||
migrationBuilder
|
||||
.AlterDatabase()
|
||||
.Annotation(
|
||||
"Npgsql:Enum:genre",
|
||||
"action,adventure,animation,comedy,crime,documentary,drama,family,fantasy,history,horror,music,mystery,romance,science_fiction,thriller,war,western"
|
||||
)
|
||||
.Annotation("Npgsql:Enum:status", "unknown,finished,airing,planned")
|
||||
.OldAnnotation(
|
||||
"Npgsql:Enum:genre",
|
||||
"action,adventure,animation,comedy,crime,documentary,drama,family,fantasy,history,horror,music,mystery,romance,science_fiction,thriller,war,western"
|
||||
)
|
||||
.OldAnnotation("Npgsql:Enum:status", "unknown,finished,airing,planned")
|
||||
.OldAnnotation("Npgsql:Enum:watch_status", "completed,watching,droped,planned");
|
||||
}
|
||||
}
|
||||
|
@ -2,27 +2,26 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Kyoo.Postgresql.Migrations
|
||||
namespace Kyoo.Postgresql.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class Settings : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Settings : Migration
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "settings",
|
||||
table: "users",
|
||||
type: "json",
|
||||
nullable: false,
|
||||
defaultValue: "{}"
|
||||
);
|
||||
}
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "settings",
|
||||
table: "users",
|
||||
type: "json",
|
||||
nullable: false,
|
||||
defaultValue: "{}"
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(name: "settings", table: "users");
|
||||
}
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(name: "settings", table: "users");
|
||||
}
|
||||
}
|
||||
|
@ -1,58 +1,57 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Kyoo.Postgresql.Migrations
|
||||
namespace Kyoo.Postgresql.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class RuntimeNullable : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class RuntimeNullable : Migration
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "runtime",
|
||||
table: "movies",
|
||||
type: "integer",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer"
|
||||
);
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "runtime",
|
||||
table: "movies",
|
||||
type: "integer",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer"
|
||||
);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "runtime",
|
||||
table: "episodes",
|
||||
type: "integer",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer"
|
||||
);
|
||||
}
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "runtime",
|
||||
table: "episodes",
|
||||
type: "integer",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer"
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "runtime",
|
||||
table: "movies",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer",
|
||||
oldNullable: true
|
||||
);
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "runtime",
|
||||
table: "movies",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer",
|
||||
oldNullable: true
|
||||
);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "runtime",
|
||||
table: "episodes",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer",
|
||||
oldNullable: true
|
||||
);
|
||||
}
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "runtime",
|
||||
table: "episodes",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer",
|
||||
oldNullable: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1,35 +1,34 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Kyoo.Postgresql.Migrations
|
||||
namespace Kyoo.Postgresql.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class RemoveUserLogo : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class RemoveUserLogo : Migration
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(name: "logo_blurhash", table: "users");
|
||||
migrationBuilder.DropColumn(name: "logo_blurhash", table: "users");
|
||||
|
||||
migrationBuilder.DropColumn(name: "logo_source", 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
|
||||
);
|
||||
/// <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
|
||||
);
|
||||
}
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "logo_source",
|
||||
table: "users",
|
||||
type: "text",
|
||||
nullable: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -3,66 +3,65 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Kyoo.Postgresql.Migrations
|
||||
namespace Kyoo.Postgresql.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class AddIssues : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddIssues : Migration
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_show_watch_status_episodes_next_episode_id",
|
||||
table: "show_watch_status"
|
||||
);
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_show_watch_status_episodes_next_episode_id",
|
||||
table: "show_watch_status"
|
||||
);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "issues",
|
||||
columns: table => new
|
||||
{
|
||||
domain = table.Column<string>(type: "text", nullable: false),
|
||||
cause = table.Column<string>(type: "text", nullable: false),
|
||||
reason = table.Column<string>(type: "text", nullable: false),
|
||||
extra = table.Column<string>(type: "json", nullable: false),
|
||||
added_date = table.Column<DateTime>(
|
||||
type: "timestamp with time zone",
|
||||
nullable: false,
|
||||
defaultValueSql: "now() at time zone 'utc'"
|
||||
)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_issues", x => new { x.domain, x.cause });
|
||||
}
|
||||
);
|
||||
migrationBuilder.CreateTable(
|
||||
name: "issues",
|
||||
columns: table => new
|
||||
{
|
||||
domain = table.Column<string>(type: "text", nullable: false),
|
||||
cause = table.Column<string>(type: "text", nullable: false),
|
||||
reason = table.Column<string>(type: "text", nullable: false),
|
||||
extra = table.Column<string>(type: "json", nullable: false),
|
||||
added_date = table.Column<DateTime>(
|
||||
type: "timestamp with time zone",
|
||||
nullable: false,
|
||||
defaultValueSql: "now() at time zone 'utc'"
|
||||
)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_issues", x => new { x.domain, x.cause });
|
||||
}
|
||||
);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_show_watch_status_episodes_next_episode_id",
|
||||
table: "show_watch_status",
|
||||
column: "next_episode_id",
|
||||
principalTable: "episodes",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.SetNull
|
||||
);
|
||||
}
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_show_watch_status_episodes_next_episode_id",
|
||||
table: "show_watch_status",
|
||||
column: "next_episode_id",
|
||||
principalTable: "episodes",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.SetNull
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_show_watch_status_episodes_next_episode_id",
|
||||
table: "show_watch_status"
|
||||
);
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_show_watch_status_episodes_next_episode_id",
|
||||
table: "show_watch_status"
|
||||
);
|
||||
|
||||
migrationBuilder.DropTable(name: "issues");
|
||||
migrationBuilder.DropTable(name: "issues");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_show_watch_status_episodes_next_episode_id",
|
||||
table: "show_watch_status",
|
||||
column: "next_episode_id",
|
||||
principalTable: "episodes",
|
||||
principalColumn: "id"
|
||||
);
|
||||
}
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_show_watch_status_episodes_next_episode_id",
|
||||
table: "show_watch_status",
|
||||
column: "next_episode_id",
|
||||
principalTable: "episodes",
|
||||
principalColumn: "id"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -2,21 +2,20 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Kyoo.Postgresql.Migrations
|
||||
namespace Kyoo.Postgresql.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class AddPlayPermission : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddPlayPermission : Migration
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
// language=PostgreSQL
|
||||
migrationBuilder.Sql(
|
||||
"update users set permissions = ARRAY_APPEND(permissions, 'overall.play');"
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder) { }
|
||||
// language=PostgreSQL
|
||||
migrationBuilder.Sql(
|
||||
"update users set permissions = ARRAY_APPEND(permissions, 'overall.play');"
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder) { }
|
||||
}
|
||||
|
@ -2,27 +2,26 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Kyoo.Postgresql.Migrations
|
||||
namespace Kyoo.Postgresql.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class AddUserExternalId : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddUserExternalId : Migration
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "external_id",
|
||||
table: "users",
|
||||
type: "json",
|
||||
nullable: false,
|
||||
defaultValue: "{}"
|
||||
);
|
||||
}
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "external_id",
|
||||
table: "users",
|
||||
type: "json",
|
||||
nullable: false,
|
||||
defaultValue: "{}"
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(name: "external_id", table: "users");
|
||||
}
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(name: "external_id", table: "users");
|
||||
}
|
||||
}
|
||||
|
@ -2,37 +2,36 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Kyoo.Postgresql.Migrations
|
||||
namespace Kyoo.Postgresql.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class MakePasswordOptional : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class MakePasswordOptional : Migration
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "password",
|
||||
table: "users",
|
||||
type: "text",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "text"
|
||||
);
|
||||
}
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "password",
|
||||
table: "users",
|
||||
type: "text",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "text"
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "password",
|
||||
table: "users",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "text",
|
||||
oldNullable: true
|
||||
);
|
||||
}
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "password",
|
||||
table: "users",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "text",
|
||||
oldNullable: true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NSwag.AspNetCore" Version="13.20.0" />
|
||||
<PackageReference Include="NSwag.AspNetCore" Version="14.0.3" />
|
||||
<ProjectReference Include="../Kyoo.Abstractions/Kyoo.Abstractions.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -51,7 +51,6 @@ public class SwaggerModule : IPlugin
|
||||
document.Version = Assembly.GetExecutingAssembly().GetName().Version!.ToString(3);
|
||||
document.DocumentName = "v1";
|
||||
document.UseControllerSummaryAsTagDescription = true;
|
||||
document.GenerateExamples = true;
|
||||
document.PostProcess = options =>
|
||||
{
|
||||
options.Info.Contact = new OpenApiContact
|
||||
@ -82,7 +81,7 @@ public class SwaggerModule : IPlugin
|
||||
!= AlternativeRoute;
|
||||
return true;
|
||||
});
|
||||
document.SchemaGenerator.Settings.TypeMappers.Add(
|
||||
document.SchemaSettings.TypeMappers.Add(
|
||||
new PrimitiveTypeMapper(
|
||||
typeof(Identifier),
|
||||
x =>
|
||||
|
Loading…
x
Reference in New Issue
Block a user