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

78 lines
2.4 KiB
C#
Raw Normal View History

using System;
2022-08-16 14:47:40 +00:00
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ASC.Migrations.PostgreSql.Migrations.WebhooksDb
{
public partial class WebhooksDbContext_Upgrade1 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
2022-08-17 09:18:50 +00:00
migrationBuilder.AlterColumn<string>(
name: "uid",
table: "webhooks_logs",
type: "varchar",
maxLength: 50,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "varchar",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "status",
2022-08-16 14:47:40 +00:00
table: "webhooks_logs",
type: "int",
2022-08-16 14:47:40 +00:00
nullable: false,
oldClrType: typeof(string),
oldType: "varchar",
oldMaxLength: 50);
2022-08-16 14:47:40 +00:00
migrationBuilder.AddColumn<DateTime>(
name: "delivery",
2022-08-16 14:47:40 +00:00
table: "webhooks_logs",
type: "datetime",
2022-08-16 14:47:40 +00:00
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "enabled",
table: "webhooks_config",
type: "boolean",
nullable: false,
defaultValueSql: "true");
2022-08-16 14:47:40 +00:00
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "delivery",
2022-08-16 14:47:40 +00:00
table: "webhooks_logs");
migrationBuilder.DropColumn(
name: "enabled",
table: "webhooks_config");
2022-08-16 14:47:40 +00:00
2022-08-17 09:18:50 +00:00
migrationBuilder.AlterColumn<string>(
name: "uid",
table: "webhooks_logs",
type: "varchar",
maxLength: 50,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar",
oldMaxLength: 50);
2022-08-16 14:47:40 +00:00
migrationBuilder.AlterColumn<string>(
name: "status",
2022-08-16 14:47:40 +00:00
table: "webhooks_logs",
type: "varchar",
maxLength: 50,
2022-08-16 14:47:40 +00:00
nullable: false,
oldClrType: typeof(int),
oldType: "int");
2022-08-16 14:47:40 +00:00
}
}
}