Files
2026-05-09 17:06:30 +08:00

79 lines
4.7 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace GroupService.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class add_column : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "group_invitations",
columns: table => new
{
GroupId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
OperatorId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
State = table.Column<int>(type: "int", nullable: false),
GroupProfile_Avatar = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false),
GroupProfile_GroupName = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false),
OperatorProfile_Avatar = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true),
OperatorProfile_NickName = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false),
UserProfile_Avatar = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true),
UserProfile_NickName = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false),
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false),
CreationTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false),
Deletion = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
ModificationTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_group_invitations", x => new { x.GroupId, x.UserId });
})
.Annotation("MySql:Charset", "utf8mb4");
migrationBuilder.CreateTable(
name: "group_join_requests",
columns: table => new
{
GroupId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
OperatorId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
State = table.Column<int>(type: "int", nullable: false),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:Charset", "utf8mb4"),
GroupProfile_Avatar = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false),
GroupProfile_GroupName = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false),
OperatorProfile_Avatar = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true),
OperatorProfile_NickName = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false),
UserProfile_Avatar = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true),
UserProfile_NickName = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false),
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false),
CreationTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false),
Deletion = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
ModificationTime = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_group_join_requests", x => new { x.GroupId, x.UserId });
})
.Annotation("MySql:Charset", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "group_invitations");
migrationBuilder.DropTable(
name: "group_join_requests");
}
}
}