using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace EntityFramework.Migrations { public partial class initdatatabl : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterDatabase() .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "FileUnits", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), FileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), UnitId = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_FileUnits", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "unit", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Uniacid = table.Column(type: "int", nullable: false), group_id = table.Column(type: "int", nullable: false), category_id = table.Column(type: "int", nullable: false), Latitude = table.Column(type: "float", nullable: false), Longitude = table.Column(type: "float", nullable: false), location_name = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Name = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), important_rating = table.Column(type: "smallint", nullable: false), supervise_level = table.Column(type: "smallint", nullable: false), parent_unit_id = table.Column(type: "int", nullable: false), principal_name = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), principal_phone_num = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), people_num = table.Column(type: "smallint", nullable: false), cover_area = table.Column(type: "int", nullable: false), use_area = table.Column(type: "int", nullable: false), Imgs = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Remark = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Attachments = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), operator_id = table.Column(type: "int", nullable: false), upt_time = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_unit", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "unit_category", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Uniacid = table.Column(type: "int", nullable: false), group_id = table.Column(type: "int", nullable: false), Sort = table.Column(type: "int", nullable: false), Name = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Icon = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), operator_id = table.Column(type: "int", nullable: false), upt_time = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_unit_category", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "unit_equipment", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Uniacid = table.Column(type: "int", nullable: false), unit_id = table.Column(type: "int", nullable: false), Name = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Count = table.Column(type: "int", nullable: false), status_info = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Type = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), model = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), buy_time = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Imgs = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Remark = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), operator_id = table.Column(type: "int", nullable: false), upt_time = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_unit_equipment", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "unit_firemen", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Uniacid = table.Column(type: "int", nullable: false), unit_id = table.Column(type: "int", nullable: false), Sort = table.Column(type: "smallint", nullable: false), Name = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Gender = table.Column(type: "int", nullable: false), BirthDay = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Job = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), phone_num = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), train_exp = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), licence_code = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), licence_valid_date = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Imgs = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Remark = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), operator_id = table.Column(type: "int", nullable: false), upt_time = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_unit_firemen", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "UploadedFiles", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), OriginalName = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), FileName = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ContentType = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Extension = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Path = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), UploadedTime = table.Column(type: "datetime(6)", nullable: false), UploadedBy = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false), DeleteBy = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), DeleteTime = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_UploadedFiles", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "water", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Uniacid = table.Column(type: "int", nullable: false), group_id = table.Column(type: "int", nullable: false), Latitude = table.Column(type: "float", nullable: false), Longitude = table.Column(type: "float", nullable: false), location_name = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), category_id = table.Column(type: "int", nullable: false), Type = table.Column(type: "smallint", nullable: false), Code = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Status = table.Column(type: "smallint", nullable: false), guanwang_type = table.Column(type: "smallint", nullable: false), guanwang_diam = table.Column(type: "float", nullable: false), guanwang_pressure = table.Column(type: "float", nullable: false), supply_company = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), principal_name = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), principal_phone_num = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), install_date = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), change_date = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), cancel_date = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Imgs = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Remark = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), operator_id = table.Column(type: "int", nullable: false), upt_time = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_water", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "FileUnits"); migrationBuilder.DropTable( name: "unit"); migrationBuilder.DropTable( name: "unit_category"); migrationBuilder.DropTable( name: "unit_equipment"); migrationBuilder.DropTable( name: "unit_firemen"); migrationBuilder.DropTable( name: "UploadedFiles"); migrationBuilder.DropTable( name: "water"); } } }