DD.WellWorkover.Cloud/AsbCloudDb/Migrations/20220815093950_AddDataDefault_SubsystemFiller.cs

105 lines
3.5 KiB
C#
Raw Normal View History

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class AddDataDefault_SubsystemFiller : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "name",
table: "t_subsystem",
type: "character varying(255)",
maxLength: 255,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(255)",
oldMaxLength: 255,
oldNullable: true);
migrationBuilder.InsertData(
table: "t_subsystem",
columns: new[] { "id", "description", "name" },
values: new object[,]
{
{ 1, "Ручной", "Ручной" },
{ 2, "Бурение в роторе", "Бурение в роторе" },
{ 3, "Проработка", "Проработка" },
{ 4, "Бурение в слайде", "Бурение в слайде" },
{ 5, "Спуск СПО", "Спуск СПО" },
{ 6, "Подъем СПО", "Подъем СПО" },
{ 7, "Подъем с проработкой", "Подъем с проработкой" },
{ 11, "Блокировка", "Блокировка" },
{ 65536, "Spin master", "Spin master" },
{ 65537, "Torque master", "Torque master" }
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "t_subsystem",
keyColumn: "id",
keyValue: 1);
migrationBuilder.DeleteData(
table: "t_subsystem",
keyColumn: "id",
keyValue: 2);
migrationBuilder.DeleteData(
table: "t_subsystem",
keyColumn: "id",
keyValue: 3);
migrationBuilder.DeleteData(
table: "t_subsystem",
keyColumn: "id",
keyValue: 4);
migrationBuilder.DeleteData(
table: "t_subsystem",
keyColumn: "id",
keyValue: 5);
migrationBuilder.DeleteData(
table: "t_subsystem",
keyColumn: "id",
keyValue: 6);
migrationBuilder.DeleteData(
table: "t_subsystem",
keyColumn: "id",
keyValue: 7);
migrationBuilder.DeleteData(
table: "t_subsystem",
keyColumn: "id",
keyValue: 11);
migrationBuilder.DeleteData(
table: "t_subsystem",
keyColumn: "id",
keyValue: 65536);
migrationBuilder.DeleteData(
table: "t_subsystem",
keyColumn: "id",
keyValue: 65537);
migrationBuilder.AlterColumn<string>(
name: "name",
table: "t_subsystem",
type: "character varying(255)",
maxLength: 255,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(255)",
oldMaxLength: 255);
}
}
}