using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Ewide.Database.Migrations.Migrations { public partial class v100 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "bs_house_projectinfo"); migrationBuilder.DeleteData( table: "sys_dict_data", keyColumn: "Id", keyValue: "514dbb46-ae79-4c07-96fa-496983765609"); migrationBuilder.DeleteData( table: "sys_dict_data", keyColumn: "Id", keyValue: "6a01e89a-6bbb-4822-b862-8e566b6dde74"); migrationBuilder.DeleteData( table: "sys_dict_data", keyColumn: "Id", keyValue: "dad01f31-bb7f-4696-9e53-ad6d58b366a7"); migrationBuilder.DeleteData( table: "sys_dict_data", keyColumn: "Id", keyValue: "fc843478-1e98-47e8-aaf3-12442fd4cbfc"); migrationBuilder.DeleteData( table: "sys_menu", keyColumn: "Id", keyValue: "142803a5-63de-48be-afa9-3bde8640d580"); migrationBuilder.DeleteData( table: "sys_menu", keyColumn: "Id", keyValue: "235d9a5f-2469-4f17-a98c-45824513d5ae"); migrationBuilder.DeleteData( table: "sys_menu", keyColumn: "Id", keyValue: "4f44d697-5421-487e-9d31-3161aee4b7cc"); migrationBuilder.DeleteData( table: "sys_menu", keyColumn: "Id", keyValue: "8645a374-6939-4dd8-a827-c6a39771f33d"); migrationBuilder.DeleteData( table: "sys_menu", keyColumn: "Id", keyValue: "d5130f78-5d8d-4c8d-b433-f8e6796f0d12"); migrationBuilder.DeleteData( table: "sys_menu", keyColumn: "Id", keyValue: "e7f28efd-2ac4-45c6-a73b-57ef7c5b8c8b"); migrationBuilder.DeleteData( table: "sys_dict_type", keyColumn: "Id", keyValue: "2815b28b-e51d-4dfb-b549-2eaa27d8c23d"); migrationBuilder.DropColumn( name: "JobGroup", table: "sys_timer"); migrationBuilder.DropColumn( name: "TriggerType", table: "sys_timer"); migrationBuilder.AddColumn( name: "SecurityLevel", table: "sys_user", type: "int", nullable: false, defaultValue: 0, comment: "密码安全级别"); migrationBuilder.AddColumn( name: "DoOnce", table: "sys_timer", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "只执行一次"); migrationBuilder.AddColumn( name: "ExecuteType", table: "sys_timer", type: "int", nullable: false, defaultValue: 0, comment: "执行类型"); migrationBuilder.AddColumn( name: "StartNow", table: "sys_timer", type: "tinyint(1)", nullable: false, defaultValue: false, comment: "立即执行"); migrationBuilder.AddColumn( name: "TimerType", table: "sys_timer", type: "int", nullable: false, defaultValue: 0, comment: "定时器类型"); migrationBuilder.AlterColumn( name: "Name", table: "sys_org", type: "varchar(20) CHARACTER SET utf8mb4", maxLength: 20, nullable: true, comment: "名称", oldClrType: typeof(string), oldType: "longtext CHARACTER SET utf8mb4", oldNullable: true, oldComment: "名称"); migrationBuilder.AddColumn( name: "Type", table: "sys_org", type: "int", nullable: false, defaultValue: 0, comment: "机构类型"); migrationBuilder.AlterColumn( name: "ReadTime", table: "sys_notice_user", type: "datetime", nullable: true, comment: "阅读时间", oldClrType: typeof(DateTime), oldType: "datetime", oldComment: "阅读时间"); migrationBuilder.AddColumn( name: "Id", table: "sys_notice_user", type: "varchar(36)", nullable: false, defaultValue: "", comment: "Id主键"); migrationBuilder.AddColumn( name: "CreatedTime", table: "sys_notice_user", type: "datetime", nullable: true, comment: "创建时间"); migrationBuilder.AddColumn( name: "CreatedUserId", table: "sys_notice_user", type: "varchar(36)", nullable: true, comment: "创建者Id"); migrationBuilder.AddColumn( name: "CreatedUserName", table: "sys_notice_user", type: "varchar(20) CHARACTER SET utf8mb4", maxLength: 20, nullable: true, comment: "创建者名称"); migrationBuilder.AddColumn( name: "IsDeleted", table: "sys_notice_user", type: "bit", nullable: false, defaultValue: 0ul, comment: "软删除标记"); migrationBuilder.AddColumn( name: "UpdatedTime", table: "sys_notice_user", type: "datetime", nullable: true, comment: "更新时间"); migrationBuilder.AddColumn( name: "UpdatedUserId", table: "sys_notice_user", type: "varchar(36)", nullable: true, comment: "修改者Id"); migrationBuilder.AddColumn( name: "UpdatedUserName", table: "sys_notice_user", type: "varchar(20) CHARACTER SET utf8mb4", maxLength: 20, nullable: true, comment: "修改者名称"); migrationBuilder.AlterColumn( name: "PublicTime", table: "sys_notice", type: "datetime", nullable: true, comment: "发布时间", oldClrType: typeof(DateTime), oldType: "datetime", oldComment: "发布时间"); migrationBuilder.AlterColumn( name: "CancelTime", table: "sys_notice", type: "datetime", nullable: true, comment: "撤回时间", oldClrType: typeof(DateTime), oldType: "datetime", oldComment: "撤回时间"); migrationBuilder.AddColumn( name: "Attachments", table: "sys_notice", type: "longtext CHARACTER SET utf8mb4", nullable: true, comment: "上传文件id集合"); migrationBuilder.AddColumn( name: "Pid", table: "sys_dict_type", type: "varchar(36)", nullable: true, comment: "父Id"); migrationBuilder.AddColumn( name: "Pids", table: "sys_dict_type", type: "longtext CHARACTER SET utf8mb4", nullable: true, comment: "父Ids"); migrationBuilder.AddColumn( name: "ExtCode", table: "sys_dict_data", type: "longtext CHARACTER SET utf8mb4", nullable: true, comment: "扩展编码,以json形式存储"); migrationBuilder.AddPrimaryKey( name: "PK_sys_notice_user", table: "sys_notice_user", column: "Id"); migrationBuilder.InsertData( table: "sys_tenant", columns: new[] { "Id", "Connection", "CreatedTime", "CreatedUserId", "CreatedUserName", "Email", "Host", "IsDeleted", "Name", "Phone", "Remark", "Schema", "UpdatedTime", "UpdatedUserId", "UpdatedUserName" }, values: new object[,] { { "506a14b7-882d-4548-96fa-a55dbe79bfa1", "Data Source=./Ewide.db", new DateTime(2021, 4, 3, 0, 0, 0, 0, DateTimeKind.Unspecified), null, null, "zuohuaijun@163.com", "localhost:5566", 0ul, "默认租户", "18020030720", null, null, null, null, null }, { "eed8c4a6-70d8-49fd-9566-21a6966bb702", "Data Source=./Dilon_1.db", new DateTime(2021, 4, 3, 0, 0, 0, 0, DateTimeKind.Unspecified), null, null, null, "localhost:5588", 0ul, "其他租户", null, null, null, null, null, null } }); migrationBuilder.UpdateData( table: "sys_user", keyColumn: "Id", keyValue: "16a74726-e156-499f-9942-0e0e24ad0c3f", column: "SecurityLevel", value: 1); migrationBuilder.UpdateData( table: "sys_user", keyColumn: "Id", keyValue: "5398fb9a-2209-4ce7-a2c1-b6a983e502b5", column: "SecurityLevel", value: 1); migrationBuilder.UpdateData( table: "sys_user", keyColumn: "Id", keyValue: "d0ead3dc-5096-4e15-bc6d-f640be5301ec", column: "SecurityLevel", value: 1); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropPrimaryKey( name: "PK_sys_notice_user", table: "sys_notice_user"); migrationBuilder.DeleteData( table: "sys_tenant", keyColumn: "Id", keyValue: "506a14b7-882d-4548-96fa-a55dbe79bfa1"); migrationBuilder.DeleteData( table: "sys_tenant", keyColumn: "Id", keyValue: "eed8c4a6-70d8-49fd-9566-21a6966bb702"); migrationBuilder.DropColumn( name: "SecurityLevel", table: "sys_user"); migrationBuilder.DropColumn( name: "DoOnce", table: "sys_timer"); migrationBuilder.DropColumn( name: "ExecuteType", table: "sys_timer"); migrationBuilder.DropColumn( name: "StartNow", table: "sys_timer"); migrationBuilder.DropColumn( name: "TimerType", table: "sys_timer"); migrationBuilder.DropColumn( name: "Type", table: "sys_org"); migrationBuilder.DropColumn( name: "Id", table: "sys_notice_user"); migrationBuilder.DropColumn( name: "CreatedTime", table: "sys_notice_user"); migrationBuilder.DropColumn( name: "CreatedUserId", table: "sys_notice_user"); migrationBuilder.DropColumn( name: "CreatedUserName", table: "sys_notice_user"); migrationBuilder.DropColumn( name: "IsDeleted", table: "sys_notice_user"); migrationBuilder.DropColumn( name: "UpdatedTime", table: "sys_notice_user"); migrationBuilder.DropColumn( name: "UpdatedUserId", table: "sys_notice_user"); migrationBuilder.DropColumn( name: "UpdatedUserName", table: "sys_notice_user"); migrationBuilder.DropColumn( name: "Attachments", table: "sys_notice"); migrationBuilder.DropColumn( name: "Pid", table: "sys_dict_type"); migrationBuilder.DropColumn( name: "Pids", table: "sys_dict_type"); migrationBuilder.DropColumn( name: "ExtCode", table: "sys_dict_data"); migrationBuilder.AddColumn( name: "JobGroup", table: "sys_timer", type: "longtext CHARACTER SET utf8mb4", nullable: true, comment: "任务分组"); migrationBuilder.AddColumn( name: "TriggerType", table: "sys_timer", type: "int", nullable: false, defaultValue: 0, comment: "触发器类型"); migrationBuilder.AlterColumn( name: "Name", table: "sys_org", type: "longtext CHARACTER SET utf8mb4", nullable: true, comment: "名称", oldClrType: typeof(string), oldType: "varchar(20) CHARACTER SET utf8mb4", oldMaxLength: 20, oldNullable: true, oldComment: "名称"); migrationBuilder.AlterColumn( name: "ReadTime", table: "sys_notice_user", type: "datetime", nullable: false, defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), comment: "阅读时间", oldClrType: typeof(DateTime), oldType: "datetime", oldNullable: true, oldComment: "阅读时间"); migrationBuilder.AlterColumn( name: "PublicTime", table: "sys_notice", type: "datetime", nullable: false, defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), comment: "发布时间", oldClrType: typeof(DateTime), oldType: "datetime", oldNullable: true, oldComment: "发布时间"); migrationBuilder.AlterColumn( name: "CancelTime", table: "sys_notice", type: "datetime", nullable: false, defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), comment: "撤回时间", oldClrType: typeof(DateTime), oldType: "datetime", oldNullable: true, oldComment: "撤回时间"); migrationBuilder.CreateTable( name: "bs_house_projectinfo", columns: table => new { Id = table.Column(type: "varchar(36)", nullable: false, comment: "Id主键"), AreaId = table.Column(type: "varchar(36) CHARACTER SET utf8mb4", maxLength: 36, nullable: false, comment: "区域ID"), AreaName = table.Column(type: "varchar(500) CHARACTER SET utf8mb4", maxLength: 500, nullable: true, comment: "区域名称"), CreatedTime = table.Column(type: "datetime", nullable: true, comment: "创建时间"), CreatedUserId = table.Column(type: "varchar(36)", nullable: true, comment: "创建者Id"), CreatedUserName = table.Column(type: "varchar(20) CHARACTER SET utf8mb4", maxLength: 20, nullable: true, comment: "创建者名称"), IsDeleted = table.Column(type: "bit", nullable: false, comment: "软删除标记"), Name = table.Column(type: "varchar(100) CHARACTER SET utf8mb4", maxLength: 100, nullable: false, comment: "名称"), Note = table.Column(type: "varchar(1000) CHARACTER SET utf8mb4", maxLength: 1000, nullable: true, comment: "备注"), Sort = table.Column(type: "int", nullable: false, comment: "排序"), Type = table.Column(type: "int", nullable: false, comment: "类型"), UpdatedTime = table.Column(type: "datetime", nullable: true, comment: "更新时间"), UpdatedUserId = table.Column(type: "varchar(36)", nullable: true, comment: "修改者Id"), UpdatedUserName = table.Column(type: "varchar(20) CHARACTER SET utf8mb4", maxLength: 20, nullable: true, comment: "修改者名称") }, constraints: table => { table.PrimaryKey("PK_bs_house_projectinfo", x => x.Id); }, comment: "项目表"); migrationBuilder.InsertData( table: "sys_dict_type", columns: new[] { "Id", "Code", "CreatedTime", "CreatedUserId", "CreatedUserName", "IsDeleted", "Name", "Remark", "Sort", "Status", "UpdatedTime", "UpdatedUserId", "UpdatedUserName" }, values: new object[] { "2815b28b-e51d-4dfb-b549-2eaa27d8c23d", "dic_areacode_type", null, null, null, 0ul, "区域编码类型", "区域编码类型", 0, 0, null, null, null }); migrationBuilder.InsertData( table: "sys_menu", columns: new[] { "Id", "Application", "Code", "Component", "CreatedTime", "CreatedUserId", "CreatedUserName", "Icon", "IsDeleted", "Link", "Name", "OpenType", "Permission", "Pid", "Pids", "Redirect", "Remark", "Router", "Sort", "Status", "Type", "UpdatedTime", "UpdatedUserId", "UpdatedUserName", "Visible", "VisibleParent", "Weight" }, values: new object[,] { { "235d9a5f-2469-4f17-a98c-45824513d5ae", "system", "org_areaManage", "system/area/index", null, null, null, null, 0ul, null, "区域管理", 1, null, "f7d60a3f-2de3-4dca-a1d6-385cee9638bc", "[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],", null, null, "/area", 0, 0, 1, null, null, null, 1ul, 0ul, 1 }, { "d5130f78-5d8d-4c8d-b433-f8e6796f0d12", "system", "org_area_add", null, null, null, null, null, 0ul, null, "区域增加", 0, "sysArea:add", "235d9a5f-2469-4f17-a98c-45824513d5ae", "[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[235d9a5f-2469-4f17-a98c-45824513d5ae],", null, null, null, 100, 0, 2, null, null, null, 1ul, 0ul, 1 }, { "4f44d697-5421-487e-9d31-3161aee4b7cc", "system", "org_area_edit", null, null, null, null, null, 0ul, null, "区域编辑", 0, "sysArea:edit", "235d9a5f-2469-4f17-a98c-45824513d5ae", "[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[235d9a5f-2469-4f17-a98c-45824513d5ae],", null, null, null, 100, 0, 2, null, null, null, 1ul, 0ul, 1 }, { "142803a5-63de-48be-afa9-3bde8640d580", "system", "org_area_delete", null, null, null, null, null, 0ul, null, "区域删除", 0, "sysArea:delete", "235d9a5f-2469-4f17-a98c-45824513d5ae", "[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[235d9a5f-2469-4f17-a98c-45824513d5ae],", null, null, null, 100, 0, 2, null, null, null, 1ul, 0ul, 1 }, { "e7f28efd-2ac4-45c6-a73b-57ef7c5b8c8b", "system", "org_area_page", null, null, null, null, null, 0ul, null, "区域查询", 0, "sysArea:page", "235d9a5f-2469-4f17-a98c-45824513d5ae", "[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[235d9a5f-2469-4f17-a98c-45824513d5ae],", null, null, null, 100, 0, 2, null, null, null, 1ul, 0ul, 1 }, { "8645a374-6939-4dd8-a827-c6a39771f33d", "system", "org_area_tree", null, null, null, null, null, 0ul, null, "区域树", 0, "sysArea:tree", "235d9a5f-2469-4f17-a98c-45824513d5ae", "[00000000-0000-0000-0000-000000000000],[f7d60a3f-2de3-4dca-a1d6-385cee9638bc],[235d9a5f-2469-4f17-a98c-45824513d5ae],", null, null, null, 100, 0, 2, null, null, null, 1ul, 0ul, 1 } }); migrationBuilder.UpdateData( table: "sys_timer", keyColumn: "Id", keyValue: "971bc338-0c03-46d4-8113-c7738d54ea18", columns: new[] { "JobGroup", "TriggerType" }, values: new object[] { "默认分组", 1 }); migrationBuilder.InsertData( table: "sys_dict_data", columns: new[] { "Id", "Code", "CreatedTime", "CreatedUserId", "CreatedUserName", "IsDeleted", "Remark", "Sort", "Status", "TypeId", "UpdatedTime", "UpdatedUserId", "UpdatedUserName", "Value" }, values: new object[,] { { "6a01e89a-6bbb-4822-b862-8e566b6dde74", "1", null, null, null, 0ul, "市级编号", 1, 0, "2815b28b-e51d-4dfb-b549-2eaa27d8c23d", null, null, null, "市级编号" }, { "fc843478-1e98-47e8-aaf3-12442fd4cbfc", "2", null, null, null, 0ul, "区县编号", 2, 0, "2815b28b-e51d-4dfb-b549-2eaa27d8c23d", null, null, null, "区县编号" }, { "dad01f31-bb7f-4696-9e53-ad6d58b366a7", "3", null, null, null, 0ul, "乡镇街道编号", 3, 0, "2815b28b-e51d-4dfb-b549-2eaa27d8c23d", null, null, null, "乡镇街道编号" }, { "514dbb46-ae79-4c07-96fa-496983765609", "4", null, null, null, 0ul, "社区/村委会编号", 4, 0, "2815b28b-e51d-4dfb-b549-2eaa27d8c23d", null, null, null, "社区/村委会编号" } }); } } }