using System;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
#nullable disable
|
|
namespace FlexJobApi.Database.Migrations.Migrations
|
{
|
/// <inheritdoc />
|
public partial class UpdateEnterpriseWallet0903 : Migration
|
{
|
/// <inheritdoc />
|
protected override void Up(MigrationBuilder migrationBuilder)
|
{
|
migrationBuilder.AddColumn<string>(
|
name: "AccountBookId",
|
table: "EnterpriseWallet",
|
type: "nvarchar(max)",
|
nullable: true);
|
|
migrationBuilder.AddColumn<int>(
|
name: "AccountBookStatus",
|
table: "EnterpriseWallet",
|
type: "int",
|
nullable: true);
|
|
migrationBuilder.AddColumn<decimal>(
|
name: "Balance",
|
table: "EnterpriseWallet",
|
type: "decimal(18,2)",
|
nullable: false,
|
defaultValue: 0m);
|
|
migrationBuilder.AddColumn<string>(
|
name: "BankAccName",
|
table: "EnterpriseWallet",
|
type: "nvarchar(max)",
|
nullable: true);
|
|
migrationBuilder.AddColumn<string>(
|
name: "CardBank",
|
table: "EnterpriseWallet",
|
type: "nvarchar(max)",
|
nullable: true);
|
|
migrationBuilder.AddColumn<string>(
|
name: "CardBranch",
|
table: "EnterpriseWallet",
|
type: "nvarchar(max)",
|
nullable: true);
|
|
migrationBuilder.AddColumn<string>(
|
name: "CardDeposit",
|
table: "EnterpriseWallet",
|
type: "nvarchar(max)",
|
nullable: true);
|
|
migrationBuilder.AddColumn<string>(
|
name: "CardLocation",
|
table: "EnterpriseWallet",
|
type: "nvarchar(max)",
|
nullable: true);
|
|
migrationBuilder.AddColumn<string>(
|
name: "CardNo",
|
table: "EnterpriseWallet",
|
type: "nvarchar(max)",
|
nullable: true);
|
|
migrationBuilder.CreateTable(
|
name: "EnterpriseWalletTransaction",
|
columns: table => new
|
{
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
WalletId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
Type = table.Column<int>(type: "int", nullable: false),
|
Code = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
Amount = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
Balance = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
OrderId = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
Status = table.Column<int>(type: "int", nullable: false),
|
Sort = table.Column<int>(type: "int", nullable: false),
|
TraceId = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
CreatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
|
CreatedUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
CreatedEnterpriseId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
UpdatedTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
|
UpdatedUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false)
|
},
|
constraints: table =>
|
{
|
table.PrimaryKey("PK_EnterpriseWalletTransaction", x => x.Id);
|
table.ForeignKey(
|
name: "FK_EnterpriseWalletTransaction_EnterpriseWallet_WalletId",
|
column: x => x.WalletId,
|
principalTable: "EnterpriseWallet",
|
principalColumn: "Id",
|
onDelete: ReferentialAction.Cascade);
|
});
|
|
migrationBuilder.CreateIndex(
|
name: "IX_EnterpriseWalletTransaction_WalletId",
|
table: "EnterpriseWalletTransaction",
|
column: "WalletId");
|
}
|
|
/// <inheritdoc />
|
protected override void Down(MigrationBuilder migrationBuilder)
|
{
|
migrationBuilder.DropTable(
|
name: "EnterpriseWalletTransaction");
|
|
migrationBuilder.DropColumn(
|
name: "AccountBookId",
|
table: "EnterpriseWallet");
|
|
migrationBuilder.DropColumn(
|
name: "AccountBookStatus",
|
table: "EnterpriseWallet");
|
|
migrationBuilder.DropColumn(
|
name: "Balance",
|
table: "EnterpriseWallet");
|
|
migrationBuilder.DropColumn(
|
name: "BankAccName",
|
table: "EnterpriseWallet");
|
|
migrationBuilder.DropColumn(
|
name: "CardBank",
|
table: "EnterpriseWallet");
|
|
migrationBuilder.DropColumn(
|
name: "CardBranch",
|
table: "EnterpriseWallet");
|
|
migrationBuilder.DropColumn(
|
name: "CardDeposit",
|
table: "EnterpriseWallet");
|
|
migrationBuilder.DropColumn(
|
name: "CardLocation",
|
table: "EnterpriseWallet");
|
|
migrationBuilder.DropColumn(
|
name: "CardNo",
|
table: "EnterpriseWallet");
|
}
|
}
|
}
|