72 lines
4.4 KiB
C#
72 lines
4.4 KiB
C#
![]() |
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<int>(type: "int", nullable: false, comment: "Id")
|
|||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|||
|
Name = table.Column<string>(type: "nvarchar(100)", nullable: false, comment: "Name"),
|
|||
|
Json = table.Column<string>(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<int>(type: "int", nullable: false, comment: "Id")
|
|||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|||
|
UserName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "帐号"),
|
|||
|
Gender = table.Column<int>(type: "int", nullable: true, comment: "性别"),
|
|||
|
HeadImageUrl = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false, comment: "头像"),
|
|||
|
Role_Id = table.Column<int>(type: "int", nullable: false, comment: "角色Id"),
|
|||
|
RoleName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false, comment: "角色"),
|
|||
|
UserTrueName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false, comment: "姓名"),
|
|||
|
UserPwd = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false, comment: "密码"),
|
|||
|
PhoneNo = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: false, comment: "手机号"),
|
|||
|
Enable = table.Column<byte>(type: "tinyint", nullable: false, comment: "是否可用"),
|
|||
|
wx_OpenID = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "微信OpenId"),
|
|||
|
wx_UnionID = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "微信UnionId"),
|
|||
|
wx_HeadImgUrl = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true, comment: "微信头像"),
|
|||
|
wx_NickName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "微信昵称"),
|
|||
|
CreateID = table.Column<int>(type: "int", nullable: true, comment: "CreateID"),
|
|||
|
Address = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false, comment: "地址"),
|
|||
|
Email = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "Email"),
|
|||
|
Creator = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false, comment: "创建人"),
|
|||
|
ModifyID = table.Column<int>(type: "int", nullable: true, comment: "ModifyID"),
|
|||
|
Modifier = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false, comment: "修改人"),
|
|||
|
ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
|
|||
|
LastLoginDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "最后登陆时间"),
|
|||
|
LastModifyPwdDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "最后密码修改时间"),
|
|||
|
Remark = table.Column<string>(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");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|