feat(dal,api): в таблицу Tnk, добавлено поле ShortName
This commit is contained in:
3932
PARR.DAL/Migrations/20251208235159_tblTnkAddShortName.Designer.cs
generated
Normal file
3932
PARR.DAL/Migrations/20251208235159_tblTnkAddShortName.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
56
PARR.DAL/Migrations/20251208235159_tblTnkAddShortName.cs
Normal file
56
PARR.DAL/Migrations/20251208235159_tblTnkAddShortName.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class tblTnkAddShortName : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Tnks_EsppId",
|
||||
table: "Tnks");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "EsppId",
|
||||
table: "Tnks",
|
||||
type: "integer",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ShortName",
|
||||
table: "Tnks",
|
||||
type: "text",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ShortName",
|
||||
table: "Tnks");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "EsppId",
|
||||
table: "Tnks",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Tnks_EsppId",
|
||||
table: "Tnks",
|
||||
column: "EsppId",
|
||||
unique: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2777,21 +2777,21 @@ namespace PARR.DAL.Migrations
|
||||
b.Property<DateTimeOffset?>("DateModified")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int>("EsppId")
|
||||
b.Property<int?>("EsppId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ShortName")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("SubprocessId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EsppId")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("SubprocessId");
|
||||
|
||||
b.ToTable("Tnks");
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PARR.DAL.Models.Base;
|
||||
using PARR.DAL.Models.Base;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace PARR.DAL.Models
|
||||
{
|
||||
[Table("Tnks")]
|
||||
[Index(nameof(EsppId), IsUnique = true)]
|
||||
//[Index(nameof(EsppId), IsUnique = true)]
|
||||
public class Tnk : IBase
|
||||
{
|
||||
[Key]
|
||||
@@ -18,7 +17,12 @@ namespace PARR.DAL.Models
|
||||
|
||||
public required string Name { get; set; }
|
||||
|
||||
public int EsppId { get; set; }
|
||||
/// <summary>
|
||||
/// Краткое наименование, применяется в шорткоде "%ТНК-КРАТКО%"
|
||||
/// </summary>
|
||||
public string? ShortName { get; set; }
|
||||
|
||||
public int? EsppId { get; set; }
|
||||
|
||||
public Guid SubprocessId { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user