145 lines
4.8 KiB
C#
145 lines
4.8 KiB
C#
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace DamageAssesment.Api.DocuLinks.Migrations
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
public partial class doculinkUpdate : Migration
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "IsAttachment",
|
|||
|
table: "LinkTypes");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "TypeText",
|
|||
|
table: "LinkTypes");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "Path",
|
|||
|
table: "Documents");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "docName",
|
|||
|
table: "Documents");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "url",
|
|||
|
table: "Documents");
|
|||
|
|
|||
|
migrationBuilder.AddColumn<int>(
|
|||
|
name: "CustomOrder",
|
|||
|
table: "LinkTypes",
|
|||
|
type: "int",
|
|||
|
nullable: false,
|
|||
|
defaultValue: 0);
|
|||
|
|
|||
|
migrationBuilder.AddColumn<int>(
|
|||
|
name: "CustomOrder",
|
|||
|
table: "Documents",
|
|||
|
type: "int",
|
|||
|
nullable: false,
|
|||
|
defaultValue: 0);
|
|||
|
|
|||
|
migrationBuilder.AddColumn<bool>(
|
|||
|
name: "IsDeleted",
|
|||
|
table: "Documents",
|
|||
|
type: "bit",
|
|||
|
nullable: false,
|
|||
|
defaultValue: false);
|
|||
|
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "DoclinksAttachments",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
Id = table.Column<int>(type: "int", nullable: false)
|
|||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|||
|
DocumentId = table.Column<int>(type: "int", nullable: false),
|
|||
|
docName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|||
|
Path = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|||
|
IsAttachments = table.Column<bool>(type: "bit", nullable: false),
|
|||
|
CustomOrder = table.Column<int>(type: "int", nullable: false)
|
|||
|
},
|
|||
|
constraints: table =>
|
|||
|
{
|
|||
|
table.PrimaryKey("PK_DoclinksAttachments", x => x.Id);
|
|||
|
});
|
|||
|
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "LinksTranslations",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
Id = table.Column<int>(type: "int", nullable: false)
|
|||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|||
|
LinkTypeId = table.Column<int>(type: "int", nullable: false),
|
|||
|
TypeText = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|||
|
Language = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
|||
|
},
|
|||
|
constraints: table =>
|
|||
|
{
|
|||
|
table.PrimaryKey("PK_LinksTranslations", x => x.Id);
|
|||
|
});
|
|||
|
}
|
|||
|
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "DoclinksAttachments");
|
|||
|
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "LinksTranslations");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "CustomOrder",
|
|||
|
table: "LinkTypes");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "CustomOrder",
|
|||
|
table: "Documents");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "IsDeleted",
|
|||
|
table: "Documents");
|
|||
|
|
|||
|
migrationBuilder.AddColumn<bool>(
|
|||
|
name: "IsAttachment",
|
|||
|
table: "LinkTypes",
|
|||
|
type: "bit",
|
|||
|
nullable: false,
|
|||
|
defaultValue: false);
|
|||
|
|
|||
|
migrationBuilder.AddColumn<string>(
|
|||
|
name: "TypeText",
|
|||
|
table: "LinkTypes",
|
|||
|
type: "nvarchar(max)",
|
|||
|
nullable: false,
|
|||
|
defaultValue: "");
|
|||
|
|
|||
|
migrationBuilder.AddColumn<string>(
|
|||
|
name: "Path",
|
|||
|
table: "Documents",
|
|||
|
type: "nvarchar(max)",
|
|||
|
nullable: false,
|
|||
|
defaultValue: "");
|
|||
|
|
|||
|
migrationBuilder.AddColumn<string>(
|
|||
|
name: "docName",
|
|||
|
table: "Documents",
|
|||
|
type: "nvarchar(max)",
|
|||
|
nullable: false,
|
|||
|
defaultValue: "");
|
|||
|
|
|||
|
migrationBuilder.AddColumn<string>(
|
|||
|
name: "url",
|
|||
|
table: "Documents",
|
|||
|
type: "nvarchar(max)",
|
|||
|
nullable: false,
|
|||
|
defaultValue: "");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|