sunpengfei
18 小时以前 1482f950f2b30835a268ae9e6c6bd817ba47a684
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using Microsoft.EntityFrameworkCore.Migrations;
 
#nullable disable
 
namespace FlexJobApi.Database.Migrations.Migrations
{
    /// <inheritdoc />
    public partial class UpdateUserAuth0911002 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.Sql(@"
UPDATE [User] SET RealMethod = (
  SELECT 
    CASE FaceRealUrl
      WHEN NULL THEN (
        CASE BankCard
          WHEN NULL THEN 10
          ELSE 20
        END
      )
      ELSE 30
    END
  FROM UserAuth 
  WHERE UserAuth.Id = [User].Id
)
WHERE IsReal = 1");
        }
 
        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
 
        }
    }
}