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.
103 lines
5.5 KiB
103 lines
5.5 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: "AbpWebhooksEvents",
|
|
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_AbpWebhooksEvents", x => x.Id);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpWebhooksSubscriptions",
|
|
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_AbpWebhooksSubscriptions", x => x.Id);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpWebhooksSendAttempts",
|
|
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_AbpWebhooksSendAttempts", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_AbpWebhooksSendAttempts_AbpWebhooksEvents_WebhookEventId",
|
|
column: x => x.WebhookEventId,
|
|
principalTable: "AbpWebhooksEvents",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpWebhooksSendAttempts_WebhookEventId",
|
|
table: "AbpWebhooksSendAttempts",
|
|
column: "WebhookEventId");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "AbpWebhooksSendAttempts");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpWebhooksSubscriptions");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpWebhooksEvents");
|
|
}
|
|
}
|
|
}
|
|
|