using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace ASC.Webhooks.Migrations { public partial class WebhooksDbContextMySql : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterDatabase() .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "webhooks_config", columns: table => new { ConfigID = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), TenantId = table.Column(type: "int unsigned", nullable: false), URI = table.Column(type: "varchar(50)", maxLength: 50, nullable: true, defaultValueSql: "''") .Annotation("MySql:CharSet", "utf8mb4"), SecretKey = table.Column(type: "varchar(50)", maxLength: 50, nullable: true, defaultValueSql: "''") .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PRIMARY", x => x.ConfigID); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "webhooks_payload", columns: table => new { ID = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), ConfigID = table.Column(type: "int", nullable: false), TenantID = table.Column(type: "int unsigned", nullable: false), Data = table.Column(type: "json", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), Event = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Status = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PRIMARY", x => x.ID); }) .Annotation("MySql:CharSet", "utf8mb4"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "webhooks_config"); migrationBuilder.DropTable( name: "webhooks_payload"); } } }