using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DamageAssesment.Api.DocuLinks.Migrations
{
///
public partial class doculinkUpdate : Migration
{
///
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(
name: "CustomOrder",
table: "LinkTypes",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn(
name: "CustomOrder",
table: "Documents",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn(
name: "IsDeleted",
table: "Documents",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.CreateTable(
name: "DoclinksAttachments",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
DocumentId = table.Column(type: "int", nullable: false),
docName = table.Column(type: "nvarchar(max)", nullable: false),
Path = table.Column(type: "nvarchar(max)", nullable: false),
IsAttachments = table.Column(type: "bit", nullable: false),
CustomOrder = table.Column(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DoclinksAttachments", x => x.Id);
});
migrationBuilder.CreateTable(
name: "LinksTranslations",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
LinkTypeId = table.Column(type: "int", nullable: false),
TypeText = table.Column(type: "nvarchar(max)", nullable: false),
Language = table.Column(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_LinksTranslations", x => x.Id);
});
}
///
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(
name: "IsAttachment",
table: "LinkTypes",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn(
name: "TypeText",
table: "LinkTypes",
type: "nvarchar(max)",
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn(
name: "Path",
table: "Documents",
type: "nvarchar(max)",
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn(
name: "docName",
table: "Documents",
type: "nvarchar(max)",
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn(
name: "url",
table: "Documents",
type: "nvarchar(max)",
nullable: false,
defaultValue: "");
}
}
}