2024-07-04 11:02:45 +05:00
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
2023-02-17 17:58:07 +05:00
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
namespace AsbCloudDb.Migrations
|
|
|
|
{
|
|
|
|
public partial class Enable_nullable_on_Permission_Measure : Migration
|
|
|
|
{
|
|
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
|
|
{
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
|
|
name: "name",
|
|
|
|
table: "t_permission",
|
|
|
|
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: "name",
|
|
|
|
table: "t_measure_category",
|
|
|
|
type: "text",
|
|
|
|
nullable: false,
|
|
|
|
defaultValue: "",
|
|
|
|
comment: "Название категории",
|
|
|
|
oldClrType: typeof(string),
|
|
|
|
oldType: "text",
|
|
|
|
oldNullable: true,
|
|
|
|
oldComment: "Название категории");
|
|
|
|
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
|
|
name: "data",
|
|
|
|
table: "t_measure",
|
|
|
|
type: "jsonb",
|
|
|
|
nullable: false,
|
|
|
|
defaultValue: "{}",
|
|
|
|
comment: "Данные таблицы последних данных",
|
|
|
|
oldClrType: typeof(string),
|
|
|
|
oldType: "jsonb",
|
|
|
|
oldNullable: true,
|
|
|
|
oldComment: "Данные таблицы последних данных");
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
{
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
|
|
name: "name",
|
|
|
|
table: "t_permission",
|
|
|
|
type: "character varying(255)",
|
|
|
|
maxLength: 255,
|
|
|
|
nullable: true,
|
|
|
|
comment: "Название",
|
|
|
|
oldClrType: typeof(string),
|
|
|
|
oldType: "character varying(255)",
|
|
|
|
oldMaxLength: 255,
|
|
|
|
oldComment: "Название");
|
|
|
|
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
|
|
name: "name",
|
|
|
|
table: "t_measure_category",
|
|
|
|
type: "text",
|
|
|
|
nullable: true,
|
|
|
|
comment: "Название категории",
|
|
|
|
oldClrType: typeof(string),
|
|
|
|
oldType: "text",
|
|
|
|
oldComment: "Название категории");
|
|
|
|
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
|
|
name: "data",
|
|
|
|
table: "t_measure",
|
|
|
|
type: "jsonb",
|
|
|
|
nullable: true,
|
|
|
|
comment: "Данные таблицы последних данных",
|
|
|
|
oldClrType: typeof(string),
|
|
|
|
oldType: "jsonb",
|
|
|
|
oldComment: "Данные таблицы последних данных");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|