这是基于vue-vben-admin 模板适用于abp Vnext的前端管理项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

104 lines
5.7 KiB

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LY.MicroService.WebhooksManagement.Migrations
{
public partial class AddModuleWebHooksManagement : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "WebhooksManagement_WebhookEvents",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
WebhookName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Data = table.Column<string>(type: "longtext", maxLength: 2147483647, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false)
},
constraints: table =>
{
table.PrimaryKey("PK_WebhooksManagement_WebhookEvents", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "WebhooksManagement_WebhookSubscriptions",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
WebhookUri = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Secret = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
Webhooks = table.Column<string>(type: "longtext", maxLength: 2147483647, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Headers = table.Column<string>(type: "longtext", maxLength: 2147483647, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_WebhooksManagement_WebhookSubscriptions", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "WebhooksManagement_WebhookSendAttempts",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
WebhookEventId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
WebhookSubscriptionId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Response = table.Column<string>(type: "longtext", maxLength: 2147483647, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ResponseStatusCode = table.Column<int>(type: "int", nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_WebhooksManagement_WebhookSendAttempts", x => x.Id);
table.ForeignKey(
name: "FK_WebhooksManagement_WebhookSendAttempts_WebhooksManagement_We~",
column: x => x.WebhookEventId,
principalTable: "WebhooksManagement_WebhookEvents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_WebhooksManagement_WebhookSendAttempts_WebhookEventId",
table: "WebhooksManagement_WebhookSendAttempts",
column: "WebhookEventId",
unique: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "WebhooksManagement_WebhookSendAttempts");
migrationBuilder.DropTable(
name: "WebhooksManagement_WebhookSubscriptions");
migrationBuilder.DropTable(
name: "WebhooksManagement_WebhookEvents");
}
}
}