using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace YD_WeChatApplet.Api.Migrations { public partial class init001 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "TestTable", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(100)", nullable: false, comment: "Name"), Json = table.Column(type: "nvarchar(100)", nullable: false, comment: "Json") }, constraints: table => { table.PrimaryKey("PK_TestTable", x => x.Id); }); migrationBuilder.CreateTable( name: "User", columns: table => new { User_Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), UserName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "帐号"), Gender = table.Column(type: "int", nullable: true, comment: "性别"), HeadImageUrl = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false, comment: "头像"), Role_Id = table.Column(type: "int", nullable: false, comment: "角色Id"), RoleName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false, comment: "角色"), UserTrueName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false, comment: "姓名"), UserPwd = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false, comment: "密码"), PhoneNo = table.Column(type: "nvarchar(11)", maxLength: 11, nullable: false, comment: "手机号"), Enable = table.Column(type: "tinyint", nullable: false, comment: "是否可用"), wx_OpenID = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "微信OpenId"), wx_UnionID = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "微信UnionId"), wx_HeadImgUrl = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true, comment: "微信头像"), wx_NickName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "微信昵称"), CreateID = table.Column(type: "int", nullable: true, comment: "CreateID"), Address = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false, comment: "地址"), Email = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "Email"), Creator = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false, comment: "创建人"), ModifyID = table.Column(type: "int", nullable: true, comment: "ModifyID"), Modifier = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false, comment: "修改人"), ModifyDate = table.Column(type: "datetime", nullable: true, comment: "修改时间"), LastLoginDate = table.Column(type: "datetime", nullable: true, comment: "最后登陆时间"), LastModifyPwdDate = table.Column(type: "datetime", nullable: true, comment: "最后密码修改时间"), Remark = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false, comment: "备注") }, constraints: table => { table.PrimaryKey("PK_User", x => x.User_Id); }); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "TestTable"); migrationBuilder.DropTable( name: "User"); } } }