sunpengfei
13 小时以前 c682cd59ded8e71957a802dd4f8dcf58e0113c0f
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
      WHEN FaceRealUrl IS NULL THEN (
        CASE
          WHEN BankCard IS 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)
        {
 
        }
    }
}