using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace TakeoutSaaS.Infrastructure.Identity.Migrations { /// public partial class AddEntityComments : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterTable( name: "mini_users", comment: "小程序用户实体。"); migrationBuilder.AlterTable( name: "identity_users", comment: "管理后台账户实体(平台管理员、租户管理员或商户员工)。"); migrationBuilder.AlterColumn( name: "UpdatedBy", table: "mini_users", type: "uuid", nullable: true, comment: "最后更新人用户标识,匿名或系统操作时为 null。", oldClrType: typeof(Guid), oldType: "uuid", oldNullable: true); migrationBuilder.AlterColumn( name: "UpdatedAt", table: "mini_users", type: "timestamp with time zone", nullable: true, comment: "最近一次更新时间(UTC),从未更新时为 null。", oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "UnionId", table: "mini_users", type: "character varying(128)", maxLength: 128, nullable: true, comment: "微信 UnionId,可能为空。", oldClrType: typeof(string), oldType: "character varying(128)", oldMaxLength: 128, oldNullable: true); migrationBuilder.AlterColumn( name: "TenantId", table: "mini_users", type: "uuid", nullable: false, comment: "所属租户 ID。", oldClrType: typeof(Guid), oldType: "uuid"); migrationBuilder.AlterColumn( name: "OpenId", table: "mini_users", type: "character varying(128)", maxLength: 128, nullable: false, comment: "微信 OpenId。", oldClrType: typeof(string), oldType: "character varying(128)", oldMaxLength: 128); migrationBuilder.AlterColumn( name: "Nickname", table: "mini_users", type: "character varying(64)", maxLength: 64, nullable: false, comment: "昵称。", oldClrType: typeof(string), oldType: "character varying(64)", oldMaxLength: 64); migrationBuilder.AlterColumn( name: "DeletedBy", table: "mini_users", type: "uuid", nullable: true, comment: "删除人用户标识(软删除),未删除时为 null。", oldClrType: typeof(Guid), oldType: "uuid", oldNullable: true); migrationBuilder.AlterColumn( name: "DeletedAt", table: "mini_users", type: "timestamp with time zone", nullable: true, comment: "软删除时间(UTC),未删除时为 null。", oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "CreatedBy", table: "mini_users", type: "uuid", nullable: true, comment: "创建人用户标识,匿名或系统操作时为 null。", oldClrType: typeof(Guid), oldType: "uuid", oldNullable: true); migrationBuilder.AlterColumn( name: "CreatedAt", table: "mini_users", type: "timestamp with time zone", nullable: false, comment: "创建时间(UTC)。", oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "Avatar", table: "mini_users", type: "character varying(256)", maxLength: 256, nullable: true, comment: "头像地址。", oldClrType: typeof(string), oldType: "character varying(256)", oldMaxLength: 256, oldNullable: true); migrationBuilder.AlterColumn( name: "Id", table: "mini_users", type: "uuid", nullable: false, comment: "实体唯一标识。", oldClrType: typeof(Guid), oldType: "uuid"); migrationBuilder.AlterColumn( name: "UpdatedBy", table: "identity_users", type: "uuid", nullable: true, comment: "最后更新人用户标识,匿名或系统操作时为 null。", oldClrType: typeof(Guid), oldType: "uuid", oldNullable: true); migrationBuilder.AlterColumn( name: "UpdatedAt", table: "identity_users", type: "timestamp with time zone", nullable: true, comment: "最近一次更新时间(UTC),从未更新时为 null。", oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "TenantId", table: "identity_users", type: "uuid", nullable: false, comment: "所属租户 ID。", oldClrType: typeof(Guid), oldType: "uuid"); migrationBuilder.AlterColumn( name: "Roles", table: "identity_users", type: "text", nullable: false, comment: "角色集合。", oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "Permissions", table: "identity_users", type: "text", nullable: false, comment: "权限集合。", oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "PasswordHash", table: "identity_users", type: "character varying(256)", maxLength: 256, nullable: false, comment: "密码哈希。", oldClrType: typeof(string), oldType: "character varying(256)", oldMaxLength: 256); migrationBuilder.AlterColumn( name: "MerchantId", table: "identity_users", type: "uuid", nullable: true, comment: "所属商户(平台管理员为空)。", oldClrType: typeof(Guid), oldType: "uuid", oldNullable: true); migrationBuilder.AlterColumn( name: "DisplayName", table: "identity_users", type: "character varying(64)", maxLength: 64, nullable: false, comment: "展示名称。", oldClrType: typeof(string), oldType: "character varying(64)", oldMaxLength: 64); migrationBuilder.AlterColumn( name: "DeletedBy", table: "identity_users", type: "uuid", nullable: true, comment: "删除人用户标识(软删除),未删除时为 null。", oldClrType: typeof(Guid), oldType: "uuid", oldNullable: true); migrationBuilder.AlterColumn( name: "DeletedAt", table: "identity_users", type: "timestamp with time zone", nullable: true, comment: "软删除时间(UTC),未删除时为 null。", oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true); migrationBuilder.AlterColumn( name: "CreatedBy", table: "identity_users", type: "uuid", nullable: true, comment: "创建人用户标识,匿名或系统操作时为 null。", oldClrType: typeof(Guid), oldType: "uuid", oldNullable: true); migrationBuilder.AlterColumn( name: "CreatedAt", table: "identity_users", type: "timestamp with time zone", nullable: false, comment: "创建时间(UTC)。", oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AlterColumn( name: "Avatar", table: "identity_users", type: "character varying(256)", maxLength: 256, nullable: true, comment: "头像地址。", oldClrType: typeof(string), oldType: "character varying(256)", oldMaxLength: 256, oldNullable: true); migrationBuilder.AlterColumn( name: "Account", table: "identity_users", type: "character varying(64)", maxLength: 64, nullable: false, comment: "登录账号。", oldClrType: typeof(string), oldType: "character varying(64)", oldMaxLength: 64); migrationBuilder.AlterColumn( name: "Id", table: "identity_users", type: "uuid", nullable: false, comment: "实体唯一标识。", oldClrType: typeof(Guid), oldType: "uuid"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.AlterTable( name: "mini_users", oldComment: "小程序用户实体。"); migrationBuilder.AlterTable( name: "identity_users", oldComment: "管理后台账户实体(平台管理员、租户管理员或商户员工)。"); migrationBuilder.AlterColumn( name: "UpdatedBy", table: "mini_users", type: "uuid", nullable: true, oldClrType: typeof(Guid), oldType: "uuid", oldNullable: true, oldComment: "最后更新人用户标识,匿名或系统操作时为 null。"); migrationBuilder.AlterColumn( name: "UpdatedAt", table: "mini_users", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true, oldComment: "最近一次更新时间(UTC),从未更新时为 null。"); migrationBuilder.AlterColumn( name: "UnionId", table: "mini_users", type: "character varying(128)", maxLength: 128, nullable: true, oldClrType: typeof(string), oldType: "character varying(128)", oldMaxLength: 128, oldNullable: true, oldComment: "微信 UnionId,可能为空。"); migrationBuilder.AlterColumn( name: "TenantId", table: "mini_users", type: "uuid", nullable: false, oldClrType: typeof(Guid), oldType: "uuid", oldComment: "所属租户 ID。"); migrationBuilder.AlterColumn( name: "OpenId", table: "mini_users", type: "character varying(128)", maxLength: 128, nullable: false, oldClrType: typeof(string), oldType: "character varying(128)", oldMaxLength: 128, oldComment: "微信 OpenId。"); migrationBuilder.AlterColumn( name: "Nickname", table: "mini_users", type: "character varying(64)", maxLength: 64, nullable: false, oldClrType: typeof(string), oldType: "character varying(64)", oldMaxLength: 64, oldComment: "昵称。"); migrationBuilder.AlterColumn( name: "DeletedBy", table: "mini_users", type: "uuid", nullable: true, oldClrType: typeof(Guid), oldType: "uuid", oldNullable: true, oldComment: "删除人用户标识(软删除),未删除时为 null。"); migrationBuilder.AlterColumn( name: "DeletedAt", table: "mini_users", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true, oldComment: "软删除时间(UTC),未删除时为 null。"); migrationBuilder.AlterColumn( name: "CreatedBy", table: "mini_users", type: "uuid", nullable: true, oldClrType: typeof(Guid), oldType: "uuid", oldNullable: true, oldComment: "创建人用户标识,匿名或系统操作时为 null。"); migrationBuilder.AlterColumn( name: "CreatedAt", table: "mini_users", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldComment: "创建时间(UTC)。"); migrationBuilder.AlterColumn( name: "Avatar", table: "mini_users", type: "character varying(256)", maxLength: 256, nullable: true, oldClrType: typeof(string), oldType: "character varying(256)", oldMaxLength: 256, oldNullable: true, oldComment: "头像地址。"); migrationBuilder.AlterColumn( name: "Id", table: "mini_users", type: "uuid", nullable: false, oldClrType: typeof(Guid), oldType: "uuid", oldComment: "实体唯一标识。"); migrationBuilder.AlterColumn( name: "UpdatedBy", table: "identity_users", type: "uuid", nullable: true, oldClrType: typeof(Guid), oldType: "uuid", oldNullable: true, oldComment: "最后更新人用户标识,匿名或系统操作时为 null。"); migrationBuilder.AlterColumn( name: "UpdatedAt", table: "identity_users", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true, oldComment: "最近一次更新时间(UTC),从未更新时为 null。"); migrationBuilder.AlterColumn( name: "TenantId", table: "identity_users", type: "uuid", nullable: false, oldClrType: typeof(Guid), oldType: "uuid", oldComment: "所属租户 ID。"); migrationBuilder.AlterColumn( name: "Roles", table: "identity_users", type: "text", nullable: false, oldClrType: typeof(string), oldType: "text", oldComment: "角色集合。"); migrationBuilder.AlterColumn( name: "Permissions", table: "identity_users", type: "text", nullable: false, oldClrType: typeof(string), oldType: "text", oldComment: "权限集合。"); migrationBuilder.AlterColumn( name: "PasswordHash", table: "identity_users", type: "character varying(256)", maxLength: 256, nullable: false, oldClrType: typeof(string), oldType: "character varying(256)", oldMaxLength: 256, oldComment: "密码哈希。"); migrationBuilder.AlterColumn( name: "MerchantId", table: "identity_users", type: "uuid", nullable: true, oldClrType: typeof(Guid), oldType: "uuid", oldNullable: true, oldComment: "所属商户(平台管理员为空)。"); migrationBuilder.AlterColumn( name: "DisplayName", table: "identity_users", type: "character varying(64)", maxLength: 64, nullable: false, oldClrType: typeof(string), oldType: "character varying(64)", oldMaxLength: 64, oldComment: "展示名称。"); migrationBuilder.AlterColumn( name: "DeletedBy", table: "identity_users", type: "uuid", nullable: true, oldClrType: typeof(Guid), oldType: "uuid", oldNullable: true, oldComment: "删除人用户标识(软删除),未删除时为 null。"); migrationBuilder.AlterColumn( name: "DeletedAt", table: "identity_users", type: "timestamp with time zone", nullable: true, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldNullable: true, oldComment: "软删除时间(UTC),未删除时为 null。"); migrationBuilder.AlterColumn( name: "CreatedBy", table: "identity_users", type: "uuid", nullable: true, oldClrType: typeof(Guid), oldType: "uuid", oldNullable: true, oldComment: "创建人用户标识,匿名或系统操作时为 null。"); migrationBuilder.AlterColumn( name: "CreatedAt", table: "identity_users", type: "timestamp with time zone", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone", oldComment: "创建时间(UTC)。"); migrationBuilder.AlterColumn( name: "Avatar", table: "identity_users", type: "character varying(256)", maxLength: 256, nullable: true, oldClrType: typeof(string), oldType: "character varying(256)", oldMaxLength: 256, oldNullable: true, oldComment: "头像地址。"); migrationBuilder.AlterColumn( name: "Account", table: "identity_users", type: "character varying(64)", maxLength: 64, nullable: false, oldClrType: typeof(string), oldType: "character varying(64)", oldMaxLength: 64, oldComment: "登录账号。"); migrationBuilder.AlterColumn( name: "Id", table: "identity_users", type: "uuid", nullable: false, oldClrType: typeof(Guid), oldType: "uuid", oldComment: "实体唯一标识。"); } } }