Migration to modify required fields on games and dependent entities

This commit is contained in:
Pat Hartl 2023-01-14 15:10:20 -06:00
parent 3c62e795e5
commit 6156c87135
3 changed files with 1124 additions and 19 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,87 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LANCommander.Migrations
{
public partial class UpdateActionAndMultiplayerModelRequired : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "MultiplayerModes",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AlterColumn<string>(
name: "WorkingDirectory",
table: "Actions",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AlterColumn<string>(
name: "Path",
table: "Actions",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AlterColumn<string>(
name: "Arguments",
table: "Actions",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "Description",
table: "MultiplayerModes",
type: "TEXT",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "WorkingDirectory",
table: "Actions",
type: "TEXT",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Path",
table: "Actions",
type: "TEXT",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Arguments",
table: "Actions",
type: "TEXT",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
}
}
}

View file

@ -29,7 +29,7 @@ namespace LANCommander.Migrations
b.HasIndex("GamesId"); b.HasIndex("GamesId");
b.ToTable("CategoryGame", (string)null); b.ToTable("CategoryGame");
}); });
modelBuilder.Entity("GameDeveloper", b => modelBuilder.Entity("GameDeveloper", b =>
@ -44,7 +44,7 @@ namespace LANCommander.Migrations
b.HasIndex("GameId"); b.HasIndex("GameId");
b.ToTable("GameDeveloper", (string)null); b.ToTable("GameDeveloper");
}); });
modelBuilder.Entity("GameGenre", b => modelBuilder.Entity("GameGenre", b =>
@ -59,7 +59,7 @@ namespace LANCommander.Migrations
b.HasIndex("GenresId"); b.HasIndex("GenresId");
b.ToTable("GameGenre", (string)null); b.ToTable("GameGenre");
}); });
modelBuilder.Entity("GamePublisher", b => modelBuilder.Entity("GamePublisher", b =>
@ -74,7 +74,7 @@ namespace LANCommander.Migrations
b.HasIndex("PublisherId"); b.HasIndex("PublisherId");
b.ToTable("GamePublisher", (string)null); b.ToTable("GamePublisher");
}); });
modelBuilder.Entity("GameTag", b => modelBuilder.Entity("GameTag", b =>
@ -89,7 +89,7 @@ namespace LANCommander.Migrations
b.HasIndex("TagsId"); b.HasIndex("TagsId");
b.ToTable("GameTag", (string)null); b.ToTable("GameTag");
}); });
modelBuilder.Entity("LANCommander.Data.Models.Action", b => modelBuilder.Entity("LANCommander.Data.Models.Action", b =>
@ -99,7 +99,6 @@ namespace LANCommander.Migrations
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Arguments") b.Property<string>("Arguments")
.IsRequired()
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<Guid?>("CreatedById") b.Property<Guid?>("CreatedById")
@ -116,7 +115,6 @@ namespace LANCommander.Migrations
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Path") b.Property<string>("Path")
.IsRequired()
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<bool>("PrimaryAction") b.Property<bool>("PrimaryAction")
@ -129,7 +127,6 @@ namespace LANCommander.Migrations
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("WorkingDirectory") b.Property<string>("WorkingDirectory")
.IsRequired()
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.HasKey("Id"); b.HasKey("Id");
@ -140,7 +137,7 @@ namespace LANCommander.Migrations
b.HasIndex("UpdatedById"); b.HasIndex("UpdatedById");
b.ToTable("Actions", (string)null); b.ToTable("Actions");
}); });
modelBuilder.Entity("LANCommander.Data.Models.Archive", b => modelBuilder.Entity("LANCommander.Data.Models.Archive", b =>
@ -194,7 +191,7 @@ namespace LANCommander.Migrations
b.HasIndex("UpdatedById"); b.HasIndex("UpdatedById");
b.ToTable("Archive", (string)null); b.ToTable("Archive");
}); });
modelBuilder.Entity("LANCommander.Data.Models.Category", b => modelBuilder.Entity("LANCommander.Data.Models.Category", b =>
@ -230,7 +227,7 @@ namespace LANCommander.Migrations
b.HasIndex("UpdatedById"); b.HasIndex("UpdatedById");
b.ToTable("Categories", (string)null); b.ToTable("Categories");
}); });
modelBuilder.Entity("LANCommander.Data.Models.Company", b => modelBuilder.Entity("LANCommander.Data.Models.Company", b =>
@ -261,7 +258,7 @@ namespace LANCommander.Migrations
b.HasIndex("UpdatedById"); b.HasIndex("UpdatedById");
b.ToTable("Companies", (string)null); b.ToTable("Companies");
}); });
modelBuilder.Entity("LANCommander.Data.Models.Game", b => modelBuilder.Entity("LANCommander.Data.Models.Game", b =>
@ -313,7 +310,7 @@ namespace LANCommander.Migrations
b.HasIndex("UpdatedById"); b.HasIndex("UpdatedById");
b.ToTable("Games", (string)null); b.ToTable("Games");
}); });
modelBuilder.Entity("LANCommander.Data.Models.Genre", b => modelBuilder.Entity("LANCommander.Data.Models.Genre", b =>
@ -344,7 +341,7 @@ namespace LANCommander.Migrations
b.HasIndex("UpdatedById"); b.HasIndex("UpdatedById");
b.ToTable("Genres", (string)null); b.ToTable("Genres");
}); });
modelBuilder.Entity("LANCommander.Data.Models.Key", b => modelBuilder.Entity("LANCommander.Data.Models.Key", b =>
@ -404,7 +401,7 @@ namespace LANCommander.Migrations
b.HasIndex("UpdatedById"); b.HasIndex("UpdatedById");
b.ToTable("Keys", (string)null); b.ToTable("Keys");
}); });
modelBuilder.Entity("LANCommander.Data.Models.MultiplayerMode", b => modelBuilder.Entity("LANCommander.Data.Models.MultiplayerMode", b =>
@ -420,10 +417,10 @@ namespace LANCommander.Migrations
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<string>("Description") b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<Guid>("GameId") b.Property<Guid?>("GameId")
.IsRequired()
.HasColumnType("TEXT"); .HasColumnType("TEXT");
b.Property<int>("MaxPlayers") b.Property<int>("MaxPlayers")
@ -455,7 +452,7 @@ namespace LANCommander.Migrations
b.HasIndex("UpdatedById"); b.HasIndex("UpdatedById");
b.ToTable("MultiplayerModes", (string)null); b.ToTable("MultiplayerModes");
}); });
modelBuilder.Entity("LANCommander.Data.Models.Role", b => modelBuilder.Entity("LANCommander.Data.Models.Role", b =>
@ -513,7 +510,7 @@ namespace LANCommander.Migrations
b.HasIndex("UpdatedById"); b.HasIndex("UpdatedById");
b.ToTable("Tags", (string)null); b.ToTable("Tags");
}); });
modelBuilder.Entity("LANCommander.Data.Models.User", b => modelBuilder.Entity("LANCommander.Data.Models.User", b =>