Add runtime nullable migration

This commit is contained in:
Zoe Roux 2024-01-20 16:43:14 +01:00
parent c0e6012d70
commit 7a8cc242ae
3 changed files with 1367 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,58 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Kyoo.Postgresql.Migrations
{
/// <inheritdoc />
public partial class RuntimeNullable : Migration
{
/// <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: "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
);
migrationBuilder.AlterColumn<int>(
name: "runtime",
table: "episodes",
type: "integer",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "integer",
oldNullable: true
);
}
}
}

View File

@ -110,7 +110,7 @@ namespace Kyoo.Postgresql.Migrations
.HasColumnType("timestamp with time zone")
.HasColumnName("release_date");
b.Property<int>("Runtime")
b.Property<int?>("Runtime")
.HasColumnType("integer")
.HasColumnName("runtime");
@ -240,7 +240,7 @@ namespace Kyoo.Postgresql.Migrations
.HasColumnType("integer")
.HasColumnName("rating");
b.Property<int>("Runtime")
b.Property<int?>("Runtime")
.HasColumnType("integer")
.HasColumnName("runtime");