71 lines
2.3 KiB
C#
71 lines
2.3 KiB
C#
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace DamageAssesment.Api.Documents.Migrations
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
public partial class DocumentTranslation : Migration
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "description",
|
|||
|
table: "Documents");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "title",
|
|||
|
table: "Documents");
|
|||
|
|
|||
|
migrationBuilder.AddColumn<bool>(
|
|||
|
name: "IsAttachment",
|
|||
|
table: "LinkTypes",
|
|||
|
type: "bit",
|
|||
|
nullable: false,
|
|||
|
defaultValue: false);
|
|||
|
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "DocumentsTranslations",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
Id = table.Column<int>(type: "int", nullable: false)
|
|||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|||
|
DocumentId = table.Column<int>(type: "int", nullable: false),
|
|||
|
title = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|||
|
description = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|||
|
Language = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
|||
|
},
|
|||
|
constraints: table =>
|
|||
|
{
|
|||
|
table.PrimaryKey("PK_DocumentsTranslations", x => x.Id);
|
|||
|
});
|
|||
|
}
|
|||
|
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "DocumentsTranslations");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "IsAttachment",
|
|||
|
table: "LinkTypes");
|
|||
|
|
|||
|
migrationBuilder.AddColumn<string>(
|
|||
|
name: "description",
|
|||
|
table: "Documents",
|
|||
|
type: "nvarchar(max)",
|
|||
|
nullable: false,
|
|||
|
defaultValue: "");
|
|||
|
|
|||
|
migrationBuilder.AddColumn<string>(
|
|||
|
name: "title",
|
|||
|
table: "Documents",
|
|||
|
type: "nvarchar(max)",
|
|||
|
nullable: false,
|
|||
|
defaultValue: "");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|