DocSpace-buildtools/migrations/postgre/WebhooksDbContext/20220816111541_WebhooksDbContext_Upgrade1.cs

71 lines
2.2 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ASC.Migrations.PostgreSql.Migrations.WebhooksDb
{
public partial class WebhooksDbContext_Upgrade1 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "event",
table: "webhooks_logs",
newName: "route");
migrationBuilder.AlterColumn<string>(
name: "response_payload",
table: "webhooks_logs",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "json",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "request_payload",
table: "webhooks_logs",
type: "text",
nullable: false,
oldClrType: typeof(string),
oldType: "json");
migrationBuilder.AddColumn<string>(
name: "method",
table: "webhooks_logs",
type: "varchar",
maxLength: 100,
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "method",
table: "webhooks_logs");
migrationBuilder.RenameColumn(
name: "route",
table: "webhooks_logs",
newName: "event");
migrationBuilder.AlterColumn<string>(
name: "response_payload",
table: "webhooks_logs",
type: "json",
nullable: true,
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "request_payload",
table: "webhooks_logs",
type: "json",
nullable: false,
oldClrType: typeof(string),
oldType: "text");
}
}
}