From 6d4340d0ca785f35f02b0f8609be6bb3e15993f5 Mon Sep 17 00:00:00 2001 From: maliming Date: Fri, 1 Oct 2021 17:50:26 +0800 Subject: [PATCH] Update Abp-5_0.md --- docs/en/Migration-Guides/Abp-5_0.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/en/Migration-Guides/Abp-5_0.md b/docs/en/Migration-Guides/Abp-5_0.md index e36e5269cb..a41a794ed6 100644 --- a/docs/en/Migration-Guides/Abp-5_0.md +++ b/docs/en/Migration-Guides/Abp-5_0.md @@ -1,5 +1,33 @@ # ABP Framework v4.x to v5.0 Migration Guide +## IdentityUser + +We added an `IsActive(bool)` property to `IdentityUser` to [control whether it is available](https://github.com/abpframework/abp/pull/10185). **Please set it to `true` of the old user after the upgrade.** + +For EF Core you can change `defaultValue` to `true` in the migration class: +```cs +public partial class AddIsActiveToIdentityUser : Migration +{ + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "IsActive", + table: "AbpUsers", + type: "bit", + nullable: false, + defaultValue: true); // Default is false. + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "IsActive", + table: "AbpUsers"); + } +} +``` + + ## MongoDB ABP Framework will serialize the datetime based on [AbpClockOptions](https://docs.abp.io/en/abp/latest/Timing#clock-options) start from 5.0, before `DateTime` values in MongoDB are [always saved as UTC](https://mongodb.github.io/mongo-csharp-driver/2.13/reference/bson/mapping/#datetime-serialization-options).