DD.WellWorkover.Cloud/AsbCloudDb/Migrations/20220520095808_AddDeillerModel.cs
2022-06-10 11:58:49 +05:00

88 lines
3.4 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class AddDeillerModel : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "caption",
table: "t_well_type",
type: "character varying(255)",
maxLength: 255,
nullable: false,
defaultValue: "",
comment: "Название",
oldClrType: typeof(string),
oldType: "character varying(255)",
oldMaxLength: 255,
oldNullable: true,
oldComment: "Название");
migrationBuilder.AlterColumn<string>(
name: "caption",
table: "t_well_section_type",
type: "character varying(255)",
maxLength: 255,
nullable: false,
defaultValue: "",
comment: "Название",
oldClrType: typeof(string),
oldType: "character varying(255)",
oldMaxLength: 255,
oldNullable: true,
oldComment: "Название");
migrationBuilder.CreateTable(
name: "t_driller",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор")
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
name = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Имя"),
surname = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Фамилия"),
patronymic = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Отчество")
},
constraints: table =>
{
table.PrimaryKey("PK_t_driller", x => x.id);
},
comment: "Бурильщик");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "t_driller");
migrationBuilder.AlterColumn<string>(
name: "caption",
table: "t_well_type",
type: "character varying(255)",
maxLength: 255,
nullable: true,
comment: "Название",
oldClrType: typeof(string),
oldType: "character varying(255)",
oldMaxLength: 255,
oldComment: "Название");
migrationBuilder.AlterColumn<string>(
name: "caption",
table: "t_well_section_type",
type: "character varying(255)",
maxLength: 255,
nullable: true,
comment: "Название",
oldClrType: typeof(string),
oldType: "character varying(255)",
oldMaxLength: 255,
oldComment: "Название");
}
}
}