Commit bf2791a0 authored by Andres Käver's avatar Andres Käver
Browse files

nullables

parent 600e06a3
......@@ -7,8 +7,8 @@ namespace DAL
public class ApplicationDbContext: DbContext
{
public DbSet<Game> Games { get; set; }
public DbSet<GameState> GameStates { get; set; }
public DbSet<Game> Games { get; set; } = default!;
public DbSet<GameState> GameStates { get; set; } = default!;
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
: base(options)
......
......@@ -10,8 +10,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace DAL.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20201120115802_InitialMigration")]
partial class InitialMigration
[Migration("20201127123745_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
......@@ -32,10 +32,12 @@ namespace DAL.Migrations
.HasColumnType("datetime2");
b.Property<string>("PlayerA")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("PlayerB")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
......@@ -58,6 +60,7 @@ namespace DAL.Migrations
.HasColumnType("int");
b.Property<string>("Json")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
......
......@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace DAL.Migrations
{
public partial class InitialMigration : Migration
public partial class Initial : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
......@@ -14,8 +14,8 @@ namespace DAL.Migrations
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
CreationDT = table.Column<DateTime>(type: "datetime2", nullable: false),
PlayerA = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
PlayerB = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true)
PlayerA = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
PlayerB = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false)
},
constraints: table =>
{
......@@ -29,7 +29,7 @@ namespace DAL.Migrations
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
DT = table.Column<DateTime>(type: "datetime2", nullable: false),
Json = table.Column<string>(type: "nvarchar(max)", nullable: true),
Json = table.Column<string>(type: "nvarchar(max)", nullable: false),
GameId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
......
......@@ -30,10 +30,12 @@ namespace DAL.Migrations
.HasColumnType("datetime2");
b.Property<string>("PlayerA")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("PlayerB")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
......@@ -56,6 +58,7 @@ namespace DAL.Migrations
.HasColumnType("int");
b.Property<string>("Json")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
......
b03fc64027fffe6eb4bcc6beb387678622672539
bc6b78ab3ab1b84022ca08e34b80ac5d209a2d3d
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<WarningsAsErrors>CS8600;CS8602;CS8603;CS8613;CS8618;CS8625</WarningsAsErrors>
</PropertyGroup>
</Project>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment