Skip to content

Commit

Permalink
entity migrations changed to include default values on dataset bit fi…
Browse files Browse the repository at this point in the history
…elds
  • Loading branch information
Shaun Krog committed Aug 17, 2022
1 parent ac509d8 commit 6890d75
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,20 @@ public void Configure(EntityTypeBuilder<DatasetCategoryElement> configuration)
.IsRequired();

configuration.Property(c => c.Acute)
.IsRequired();
.IsRequired()
.HasDefaultValue(false);

configuration.Property(c => c.Chronic)
.IsRequired();
.IsRequired()
.HasDefaultValue(false);

configuration.Property(c => c.System)
.IsRequired();
.IsRequired()
.HasDefaultValue(false);

configuration.Property(c => c.Public)
.IsRequired();
.IsRequired()
.HasDefaultValue(false);

configuration.HasOne(d => d.DatasetCategory)
.WithMany(p => p.DatasetCategoryElements)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,20 @@ public void Configure(EntityTypeBuilder<DatasetCategory> configuration)
.HasColumnName("UID");

configuration.Property(c => c.System)
.IsRequired();
.IsRequired()
.HasDefaultValue(false);

configuration.Property(c => c.Acute)
.IsRequired();
.IsRequired()
.HasDefaultValue(false);

configuration.Property(c => c.Chronic)
.IsRequired();
.IsRequired()
.HasDefaultValue(false);

configuration.Property(c => c.Public)
.IsRequired();
.IsRequired()
.HasDefaultValue(false);

configuration.HasOne(d => d.Dataset)
.WithMany(p => p.DatasetCategories)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2318,10 +2318,10 @@ protected override void Up(MigrationBuilder migrationBuilder)
CategoryOrder = table.Column<short>(type: "smallint", nullable: false),
Dataset_Id = table.Column<int>(type: "int", nullable: false),
UID = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
System = table.Column<bool>(type: "bit", nullable: false),
Acute = table.Column<bool>(type: "bit", nullable: false),
Chronic = table.Column<bool>(type: "bit", nullable: false),
Public = table.Column<bool>(type: "bit", nullable: false),
System = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
Acute = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
Chronic = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
Public = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
FriendlyName = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true),
Help = table.Column<string>(type: "nvarchar(350)", maxLength: 350, nullable: true)
},
Expand Down Expand Up @@ -2463,11 +2463,11 @@ protected override void Up(MigrationBuilder migrationBuilder)
FieldOrder = table.Column<short>(type: "smallint", nullable: false),
DatasetCategory_Id = table.Column<int>(type: "int", nullable: false),
DatasetElement_Id = table.Column<int>(type: "int", nullable: false),
Acute = table.Column<bool>(type: "bit", nullable: false),
Chronic = table.Column<bool>(type: "bit", nullable: false),
Acute = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
Chronic = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
UID = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
System = table.Column<bool>(type: "bit", nullable: false),
Public = table.Column<bool>(type: "bit", nullable: false),
System = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
Public = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
FriendlyName = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true),
Help = table.Column<string>(type: "nvarchar(350)", maxLength: 350, nullable: true)
},
Expand Down

0 comments on commit 6890d75

Please sign in to comment.