Browse Source

feat(webhooks): added ef migrations

pull/532/head
cKey 4 years ago
parent
commit
efdd916e6f
  1. 166
      aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/Migrations/20220326030345_Add-Module-WebHooks-Management.Designer.cs
  2. 104
      aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/Migrations/20220326030345_Add-Module-WebHooks-Management.cs
  3. 164
      aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/Migrations/WebhooksManagementMigrationsDbContextModelSnapshot.cs
  4. 2
      aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/Properties/launchSettings.json
  5. 2
      aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/WebhooksManagementHttpApiHostModule.cs
  6. 42
      aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/appsettings.Development.json

166
aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/Migrations/20220326030345_Add-Module-WebHooks-Management.Designer.cs

@ -0,0 +1,166 @@
// <auto-generated />
using System;
using LY.MicroService.WebhooksManagement.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
#nullable disable
namespace LY.MicroService.WebhooksManagement.Migrations
{
[DbContext(typeof(WebhooksManagementMigrationsDbContext))]
[Migration("20220326030345_Add-Module-WebHooks-Management")]
partial class AddModuleWebHooksManagement
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "6.0.3")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookEventRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<string>("Data")
.HasMaxLength(2147483647)
.HasColumnType("longtext")
.HasColumnName("Data");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<string>("WebhookName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)")
.HasColumnName("WebhookName");
b.HasKey("Id");
b.ToTable("WebhooksManagement_WebhookEvents", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookSendRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<string>("Response")
.HasMaxLength(2147483647)
.HasColumnType("longtext")
.HasColumnName("Response");
b.Property<int?>("ResponseStatusCode")
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<Guid>("WebhookEventId")
.HasColumnType("char(36)");
b.Property<Guid>("WebhookSubscriptionId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("WebhookEventId")
.IsUnique();
b.ToTable("WebhooksManagement_WebhookSendAttempts", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookSubscription", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<string>("Headers")
.HasMaxLength(2147483647)
.HasColumnType("longtext")
.HasColumnName("Headers");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<string>("Secret")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("Secret");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)");
b.Property<string>("WebhookUri")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("WebhookUri");
b.Property<string>("Webhooks")
.HasMaxLength(2147483647)
.HasColumnType("longtext")
.HasColumnName("Webhooks");
b.HasKey("Id");
b.ToTable("WebhooksManagement_WebhookSubscriptions", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookSendRecord", b =>
{
b.HasOne("LINGYUN.Abp.WebhooksManagement.WebhookEventRecord", "WebhookEvent")
.WithOne()
.HasForeignKey("LINGYUN.Abp.WebhooksManagement.WebhookSendRecord", "WebhookEventId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("WebhookEvent");
});
#pragma warning restore 612, 618
}
}
}

104
aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/Migrations/20220326030345_Add-Module-WebHooks-Management.cs

@ -0,0 +1,104 @@
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");
}
}
}

164
aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/Migrations/WebhooksManagementMigrationsDbContextModelSnapshot.cs

@ -0,0 +1,164 @@
// <auto-generated />
using System;
using LY.MicroService.WebhooksManagement.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
#nullable disable
namespace LY.MicroService.WebhooksManagement.Migrations
{
[DbContext(typeof(WebhooksManagementMigrationsDbContext))]
partial class WebhooksManagementMigrationsDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "6.0.3")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookEventRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<string>("Data")
.HasMaxLength(2147483647)
.HasColumnType("longtext")
.HasColumnName("Data");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<string>("WebhookName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)")
.HasColumnName("WebhookName");
b.HasKey("Id");
b.ToTable("WebhooksManagement_WebhookEvents", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookSendRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<string>("Response")
.HasMaxLength(2147483647)
.HasColumnType("longtext")
.HasColumnName("Response");
b.Property<int?>("ResponseStatusCode")
.HasColumnType("int");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<Guid>("WebhookEventId")
.HasColumnType("char(36)");
b.Property<Guid>("WebhookSubscriptionId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("WebhookEventId")
.IsUnique();
b.ToTable("WebhooksManagement_WebhookSendAttempts", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookSubscription", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<string>("Headers")
.HasMaxLength(2147483647)
.HasColumnType("longtext")
.HasColumnName("Headers");
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<string>("Secret")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("Secret");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)");
b.Property<string>("WebhookUri")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("WebhookUri");
b.Property<string>("Webhooks")
.HasMaxLength(2147483647)
.HasColumnType("longtext")
.HasColumnName("Webhooks");
b.HasKey("Id");
b.ToTable("WebhooksManagement_WebhookSubscriptions", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookSendRecord", b =>
{
b.HasOne("LINGYUN.Abp.WebhooksManagement.WebhookEventRecord", "WebhookEvent")
.WithOne()
.HasForeignKey("LINGYUN.Abp.WebhooksManagement.WebhookSendRecord", "WebhookEventId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("WebhookEvent");
});
#pragma warning restore 612, 618
}
}
}

2
aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/Properties/launchSettings.json

@ -8,7 +8,7 @@
}
},
"profiles": {
"LY..WebhooksManagement.HttpApi.Host": {
"LY.MicroService.WebhooksManagement.HttpApi.Host": {
"commandName": "Project",
"launchBrowser": false,
"environmentVariables": {

2
aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/WebhooksManagementHttpApiHostModule.cs

@ -85,6 +85,8 @@ public partial class WebhooksManagementHttpApiHostModule : AbpModule
ConfigureDistributedLock(context.Services, configuration);
ConfigureSeedWorker(context.Services, hostingEnvironment.IsDevelopment());
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());
// context.Services.AddAlwaysAllowAuthorization();
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)

42
aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/appsettings.Development.json

@ -1,22 +1,22 @@
{
"AgileConfig": {
"env": "DEV",
"appId": "LY.MicroService.WebhooksManagement",
"appId": "LINGYUN.Abp.WebhooksManagement",
"secret": "1q2w3E*",
"nodes": "http://127.0.0.1:15000",
"name": "LY.MicroService.WebhooksManagement",
"tag": "LY.MicroService.WebhooksManagement"
"name": "LINGYUN.Abp.WebhooksManagement",
"tag": "LINGYUN.Abp.WebhooksManagement"
},
"App": {
"TrackingEntitiesChanged": true
},
"ConnectionStrings": {
"Default": "Server=127.0.0.1;Database=WebhooksManagement;User Id=root;Password=123456",
"WebhooksManagement": "Server=127.0.0.1;Database=WebhooksManagement;User Id=root;Password=123456",
"AbpSaas": "Server=127.0.0.1;Database=WebhooksManagement;User Id=root;Password=123456",
"AbpFeatureManagement": "Server=127.0.0.1;Database=WebhooksManagement;User Id=root;Password=123456",
"AbpPermissionManagement": "Server=127.0.0.1;Database=WebhooksManagement;User Id=root;Password=123456",
"AbpSettingManagement": "Server=127.0.0.1;Database=WebhooksManagement;User Id=root;Password=123456"
"Default": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456",
"WebhooksManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456",
"AbpSaas": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456",
"AbpFeatureManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456",
"AbpPermissionManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456",
"AbpSettingManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456"
},
"DistributedLock": {
"Redis": {
@ -48,30 +48,14 @@
"FailedRetryCount": 10
},
"MySql": {
"TableNamePrefix": "WebhooksManagement_cap",
"ConnectionString": "Server=127.0.0.1;Database=WebhooksManagement;User Id=root;Password=123456"
},
"SqlServer": {
"TableNamePrefix": "WebhooksManagement_cap",
"ConnectionString": "Server=127.0.0.1;Database=WebhooksManagement;User Id=root;Password=123456"
},
"Sqlite": {
"TableNamePrefix": "WebhooksManagement_cap",
"ConnectionString": "Data Source=./cap.db"
},
"Oracle": {
"TableNamePrefix": "WebhooksManagement_cap",
"ConnectionString": "Data Source=WebhooksManagement;Integrated Security=yes;"
},
"PostgreSql": {
"TableNamePrefix": "WebhooksManagement_cap",
"ConnectionString": "Host=localhost;Port=5432;Database=WebhooksManagement;User ID=root;Password=123456;"
"TableNamePrefix": "wkm",
"ConnectionString": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456"
},
"RabbitMQ": {
"HostName": "127.0.0.1",
"Port": 5672,
"UserName": "admin",
"Password": "123456",
"UserName": "guest",
"Password": "guest",
"ExchangeName": "LINGYUN.Abp.Application",
"VirtualHost": "/"
}

Loading…
Cancel
Save