DocSpace-client/migrations/mysql/NotifyDbContext/20221019144352_NotifyDbContextMigrate.cs
2022-10-19 17:46:47 +03:00

81 lines
3.9 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace ASC.Migrations.MySql.Migrations
{
public partial class NotifyDbContextMigrate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "notify_info",
columns: table => new
{
notify_id = table.Column<int>(type: "int", nullable: false),
state = table.Column<int>(type: "int", nullable: false, defaultValueSql: "'0'"),
attempts = table.Column<int>(type: "int", nullable: false, defaultValueSql: "'0'"),
modify_date = table.Column<DateTime>(type: "datetime", nullable: false),
priority = table.Column<int>(type: "int", nullable: false, defaultValueSql: "'0'")
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => x.notify_id);
})
.Annotation("MySql:CharSet", "utf8");
migrationBuilder.CreateTable(
name: "notify_queue",
columns: table => new
{
notify_id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
tenant_id = table.Column<int>(type: "int", nullable: false),
sender = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
reciever = table.Column<string>(type: "varchar(255)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
subject = table.Column<string>(type: "varchar(1024)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
content_type = table.Column<string>(type: "varchar(64)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
content = table.Column<string>(type: "text", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
sender_type = table.Column<string>(type: "varchar(64)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
reply_to = table.Column<string>(type: "varchar(1024)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
creation_date = table.Column<DateTime>(type: "datetime", nullable: false),
attachments = table.Column<string>(type: "text", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8"),
auto_submitted = table.Column<string>(type: "varchar(64)", nullable: true, collation: "utf8_general_ci")
.Annotation("MySql:CharSet", "utf8")
},
constraints: table =>
{
table.PrimaryKey("PRIMARY", x => x.notify_id);
})
.Annotation("MySql:CharSet", "utf8");
migrationBuilder.CreateIndex(
name: "state",
table: "notify_info",
column: "state");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "notify_info");
migrationBuilder.DropTable(
name: "notify_queue");
}
}
}