forked from ddrilling/AsbCloudServer
96 lines
3.2 KiB
C#
96 lines
3.2 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace AsbCloudDb.Migrations
|
|
{
|
|
public partial class Update_Notification : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "notification_state",
|
|
table: "t_notification");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "notification_transport",
|
|
table: "t_notification");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "time_to_life",
|
|
table: "t_notification");
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "id_transport_type",
|
|
table: "t_notification",
|
|
type: "integer",
|
|
nullable: false,
|
|
defaultValue: 0,
|
|
comment: "Id типа доставки уведомления");
|
|
|
|
migrationBuilder.AddColumn<DateTime>(
|
|
name: "read_date",
|
|
table: "t_notification",
|
|
type: "timestamp with time zone",
|
|
nullable: true,
|
|
comment: "Дата прочтения уведомления");
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "id_category",
|
|
table: "t_help_page",
|
|
type: "integer",
|
|
nullable: false,
|
|
comment: "Id категории файла",
|
|
oldClrType: typeof(int),
|
|
oldType: "integer",
|
|
oldComment: "id категории файла");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "id_transport_type",
|
|
table: "t_notification");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "read_date",
|
|
table: "t_notification");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "notification_state",
|
|
table: "t_notification",
|
|
type: "text",
|
|
nullable: false,
|
|
defaultValue: "",
|
|
comment: "Состояние уведомления");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "notification_transport",
|
|
table: "t_notification",
|
|
type: "text",
|
|
nullable: false,
|
|
defaultValue: "",
|
|
comment: "Метод доставки уведомления");
|
|
|
|
migrationBuilder.AddColumn<TimeSpan>(
|
|
name: "time_to_life",
|
|
table: "t_notification",
|
|
type: "interval",
|
|
nullable: false,
|
|
defaultValue: new TimeSpan(0, 0, 0, 0, 0),
|
|
comment: "Время жизни уведомления");
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "id_category",
|
|
table: "t_help_page",
|
|
type: "integer",
|
|
nullable: false,
|
|
comment: "id категории файла",
|
|
oldClrType: typeof(int),
|
|
oldType: "integer",
|
|
oldComment: "Id категории файла");
|
|
}
|
|
}
|
|
}
|