using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace AGSS.Migrations { /// public partial class AddMenuTable : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Menus", columns: table => new { Uuid = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), ParentId = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), Path = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), Label = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), Icon = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), MenuCode = table.Column(type: "character varying(500)", maxLength: 500, nullable: true), Adaptability = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), Component = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), Sort = table.Column(type: "integer", nullable: false), Status = table.Column(type: "character varying(1)", maxLength: 1, nullable: false), Query = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), CreateTime = table.Column(type: "timestamp with time zone", nullable: false), UpdateTime = table.Column(type: "timestamp with time zone", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Menus", x => x.Uuid); table.ForeignKey( name: "FK_Menus_Menus_ParentId", column: x => x.ParentId, principalTable: "Menus", principalColumn: "Uuid", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_Menus_ParentId", table: "Menus", column: "ParentId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Menus"); } } }