本文整理汇总了C#中MigrationBuilder.CreatePostgresExtension方法的典型用法代码示例。如果您正苦于以下问题:C# MigrationBuilder.CreatePostgresExtension方法的具体用法?C# MigrationBuilder.CreatePostgresExtension怎么用?C# MigrationBuilder.CreatePostgresExtension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MigrationBuilder
的用法示例。
在下文中一共展示了MigrationBuilder.CreatePostgresExtension方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Up
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreatePostgresExtension("uuid-ossp");
migrationBuilder.CreateTable(
name: "Departments",
columns: table => new
{
Id = table.Column<Guid>(nullable: false)
.Annotation("Npgsql:ValueGeneratedOnAdd", true),
Code = table.Column<string>(nullable: true),
ContactNumber = table.Column<string>(nullable: true),
CreateTime = table.Column<DateTime>(nullable: true),
CreateUserId = table.Column<Guid>(nullable: false),
IsDeleted = table.Column<int>(nullable: false),
Manager = table.Column<string>(nullable: true),
Name = table.Column<string>(nullable: true),
ParentId = table.Column<Guid>(nullable: false),
Remarks = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Departments", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Menus",
columns: table => new
{
Id = table.Column<Guid>(nullable: false)
.Annotation("Npgsql:ValueGeneratedOnAdd", true),
Code = table.Column<string>(nullable: true),
Icon = table.Column<string>(nullable: true),
Name = table.Column<string>(nullable: true),
ParentId = table.Column<Guid>(nullable: false),
Remarks = table.Column<string>(nullable: true),
SerialNumber = table.Column<int>(nullable: false),
Type = table.Column<int>(nullable: false),
Url = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Menus", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Roles",
columns: table => new
{
Id = table.Column<Guid>(nullable: false)
.Annotation("Npgsql:ValueGeneratedOnAdd", true),
Code = table.Column<string>(nullable: true),
CreateTime = table.Column<DateTime>(nullable: true),
CreateUserId = table.Column<Guid>(nullable: false),
Name = table.Column<string>(nullable: true),
Remarks = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Roles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Users",
columns: table => new
{
Id = table.Column<Guid>(nullable: false)
.Annotation("Npgsql:ValueGeneratedOnAdd", true),
CreateTime = table.Column<DateTime>(nullable: true),
CreateUserId = table.Column<Guid>(nullable: false),
DepartmentId = table.Column<Guid>(nullable: false),
EMail = table.Column<string>(nullable: true),
IsDeleted = table.Column<int>(nullable: false),
LastLoginTime = table.Column<DateTime>(nullable: false),
LoginTimes = table.Column<int>(nullable: false),
MobileNumber = table.Column<string>(nullable: true),
Name = table.Column<string>(nullable: true),
Password = table.Column<string>(nullable: true),
Remarks = table.Column<string>(nullable: true),
UserName = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Users", x => x.Id);
table.ForeignKey(
name: "FK_Users_Departments_DepartmentId",
column: x => x.DepartmentId,
principalTable: "Departments",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "RoleMenus",
columns: table => new
{
RoleId = table.Column<Guid>(nullable: false),
MenuId = table.Column<Guid>(nullable: false),
MenuId1 = table.Column<Guid>(nullable: true)
},
//.........这里部分代码省略.........