|
|
|
|
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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
|
|
|
|
FileId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
|
|
|
|
UnitId = table.Column<int>(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<int>(type: "int", nullable: false)
|
|
|
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
|
|
|
Uniacid = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
group_id = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
category_id = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
Latitude = table.Column<float>(type: "float", nullable: false),
|
|
|
|
|
Longitude = table.Column<float>(type: "float", nullable: false),
|
|
|
|
|
location_name = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Name = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
important_rating = table.Column<short>(type: "smallint", nullable: false),
|
|
|
|
|
supervise_level = table.Column<short>(type: "smallint", nullable: false),
|
|
|
|
|
parent_unit_id = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
principal_name = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
principal_phone_num = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
people_num = table.Column<short>(type: "smallint", nullable: false),
|
|
|
|
|
cover_area = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
use_area = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
Imgs = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Remark = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Attachments = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
operator_id = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
upt_time = table.Column<DateTime>(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<int>(type: "int", nullable: false)
|
|
|
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
|
|
|
Uniacid = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
group_id = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
Sort = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
Name = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Icon = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
operator_id = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
upt_time = table.Column<DateTime>(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<int>(type: "int", nullable: false)
|
|
|
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
|
|
|
Uniacid = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
unit_id = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
Name = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Count = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
status_info = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Type = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
model = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
buy_time = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Imgs = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Remark = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
operator_id = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
upt_time = table.Column<DateTime>(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<int>(type: "int", nullable: false)
|
|
|
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
|
|
|
Uniacid = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
unit_id = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
Sort = table.Column<short>(type: "smallint", nullable: false),
|
|
|
|
|
Name = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Gender = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
BirthDay = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Job = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
phone_num = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
train_exp = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
licence_code = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
licence_valid_date = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Imgs = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Remark = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
operator_id = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
upt_time = table.Column<DateTime>(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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
|
|
|
|
OriginalName = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
FileName = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
ContentType = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Extension = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Path = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
UploadedTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
|
|
|
|
UploadedBy = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
|
|
|
|
DeleteBy = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
|
|
|
|
DeleteTime = table.Column<DateTime>(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<int>(type: "int", nullable: false)
|
|
|
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
|
|
|
|
Uniacid = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
group_id = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
Latitude = table.Column<float>(type: "float", nullable: false),
|
|
|
|
|
Longitude = table.Column<float>(type: "float", nullable: false),
|
|
|
|
|
location_name = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
category_id = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
Type = table.Column<short>(type: "smallint", nullable: false),
|
|
|
|
|
Code = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Status = table.Column<short>(type: "smallint", nullable: false),
|
|
|
|
|
guanwang_type = table.Column<short>(type: "smallint", nullable: false),
|
|
|
|
|
guanwang_diam = table.Column<float>(type: "float", nullable: false),
|
|
|
|
|
guanwang_pressure = table.Column<float>(type: "float", nullable: false),
|
|
|
|
|
supply_company = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
principal_name = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
principal_phone_num = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
install_date = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
change_date = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
cancel_date = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Imgs = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
Remark = table.Column<string>(type: "longtext", nullable: true)
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
|
|
|
operator_id = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
upt_time = table.Column<DateTime>(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");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|