using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace vendorApproverBackend.Migrations
{
///
public partial class RequestRenewEntity3 : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_request_renews_File_model_approved_design_file_id1",
table: "request_renews");
migrationBuilder.DropForeignKey(
name: "FK_request_renews_File_model_expired_cert_file_id1",
table: "request_renews");
migrationBuilder.DropForeignKey(
name: "FK_request_renews_File_model_ref_orders_file_id1",
table: "request_renews");
migrationBuilder.DropForeignKey(
name: "FK_request_renews_File_model_update_tds_file_id1",
table: "request_renews");
migrationBuilder.DropForeignKey(
name: "FK_request_renews_signatures_signature_id1",
table: "request_renews");
migrationBuilder.DropIndex(
name: "IX_request_renews_approved_design_file_id1",
table: "request_renews");
migrationBuilder.DropIndex(
name: "IX_request_renews_expired_cert_file_id1",
table: "request_renews");
migrationBuilder.DropIndex(
name: "IX_request_renews_ref_orders_file_id1",
table: "request_renews");
migrationBuilder.DropIndex(
name: "IX_request_renews_signature_id1",
table: "request_renews");
migrationBuilder.DropIndex(
name: "IX_request_renews_update_tds_file_id1",
table: "request_renews");
migrationBuilder.DropColumn(
name: "approved_design_file_id1",
table: "request_renews");
migrationBuilder.DropColumn(
name: "expired_cert_file_id1",
table: "request_renews");
migrationBuilder.DropColumn(
name: "ref_orders_file_id1",
table: "request_renews");
migrationBuilder.DropColumn(
name: "signature_id1",
table: "request_renews");
migrationBuilder.DropColumn(
name: "update_tds_file_id1",
table: "request_renews");
migrationBuilder.RenameColumn(
name: "UpdateTDSRemark",
table: "request_renews",
newName: "update_tds_remark");
migrationBuilder.RenameColumn(
name: "ReferenceOrdersRemark",
table: "request_renews",
newName: "reference_orders_remark");
migrationBuilder.RenameColumn(
name: "ExpiredProductCertificateRemark",
table: "request_renews",
newName: "expired_product_certificate_remark");
migrationBuilder.RenameColumn(
name: "ApprovedDesignRemark",
table: "request_renews",
newName: "approved_design_remark");
migrationBuilder.CreateIndex(
name: "IX_request_renews_approved_design_file_id",
table: "request_renews",
column: "approved_design_file_id",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_request_renews_expired_cert_file_id",
table: "request_renews",
column: "expired_cert_file_id",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_request_renews_ref_orders_file_id",
table: "request_renews",
column: "ref_orders_file_id",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_request_renews_signature_id",
table: "request_renews",
column: "signature_id",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_request_renews_update_tds_file_id",
table: "request_renews",
column: "update_tds_file_id",
unique: true);
migrationBuilder.AddForeignKey(
name: "FK_request_renews_File_model_approved_design_file_id",
table: "request_renews",
column: "approved_design_file_id",
principalTable: "File_model",
principalColumn: "id");
migrationBuilder.AddForeignKey(
name: "FK_request_renews_File_model_expired_cert_file_id",
table: "request_renews",
column: "expired_cert_file_id",
principalTable: "File_model",
principalColumn: "id");
migrationBuilder.AddForeignKey(
name: "FK_request_renews_File_model_ref_orders_file_id",
table: "request_renews",
column: "ref_orders_file_id",
principalTable: "File_model",
principalColumn: "id");
migrationBuilder.AddForeignKey(
name: "FK_request_renews_File_model_update_tds_file_id",
table: "request_renews",
column: "update_tds_file_id",
principalTable: "File_model",
principalColumn: "id");
migrationBuilder.AddForeignKey(
name: "FK_request_renews_signatures_signature_id",
table: "request_renews",
column: "signature_id",
principalTable: "signatures",
principalColumn: "id");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_request_renews_File_model_approved_design_file_id",
table: "request_renews");
migrationBuilder.DropForeignKey(
name: "FK_request_renews_File_model_expired_cert_file_id",
table: "request_renews");
migrationBuilder.DropForeignKey(
name: "FK_request_renews_File_model_ref_orders_file_id",
table: "request_renews");
migrationBuilder.DropForeignKey(
name: "FK_request_renews_File_model_update_tds_file_id",
table: "request_renews");
migrationBuilder.DropForeignKey(
name: "FK_request_renews_signatures_signature_id",
table: "request_renews");
migrationBuilder.DropIndex(
name: "IX_request_renews_approved_design_file_id",
table: "request_renews");
migrationBuilder.DropIndex(
name: "IX_request_renews_expired_cert_file_id",
table: "request_renews");
migrationBuilder.DropIndex(
name: "IX_request_renews_ref_orders_file_id",
table: "request_renews");
migrationBuilder.DropIndex(
name: "IX_request_renews_signature_id",
table: "request_renews");
migrationBuilder.DropIndex(
name: "IX_request_renews_update_tds_file_id",
table: "request_renews");
migrationBuilder.RenameColumn(
name: "update_tds_remark",
table: "request_renews",
newName: "UpdateTDSRemark");
migrationBuilder.RenameColumn(
name: "reference_orders_remark",
table: "request_renews",
newName: "ReferenceOrdersRemark");
migrationBuilder.RenameColumn(
name: "expired_product_certificate_remark",
table: "request_renews",
newName: "ExpiredProductCertificateRemark");
migrationBuilder.RenameColumn(
name: "approved_design_remark",
table: "request_renews",
newName: "ApprovedDesignRemark");
migrationBuilder.AddColumn(
name: "approved_design_file_id1",
table: "request_renews",
type: "bigint",
nullable: false,
defaultValue: 0L);
migrationBuilder.AddColumn(
name: "expired_cert_file_id1",
table: "request_renews",
type: "bigint",
nullable: false,
defaultValue: 0L);
migrationBuilder.AddColumn(
name: "ref_orders_file_id1",
table: "request_renews",
type: "bigint",
nullable: false,
defaultValue: 0L);
migrationBuilder.AddColumn(
name: "signature_id1",
table: "request_renews",
type: "bigint",
nullable: false,
defaultValue: 0L);
migrationBuilder.AddColumn(
name: "update_tds_file_id1",
table: "request_renews",
type: "bigint",
nullable: false,
defaultValue: 0L);
migrationBuilder.CreateIndex(
name: "IX_request_renews_approved_design_file_id1",
table: "request_renews",
column: "approved_design_file_id1",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_request_renews_expired_cert_file_id1",
table: "request_renews",
column: "expired_cert_file_id1",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_request_renews_ref_orders_file_id1",
table: "request_renews",
column: "ref_orders_file_id1",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_request_renews_signature_id1",
table: "request_renews",
column: "signature_id1",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_request_renews_update_tds_file_id1",
table: "request_renews",
column: "update_tds_file_id1",
unique: true);
migrationBuilder.AddForeignKey(
name: "FK_request_renews_File_model_approved_design_file_id1",
table: "request_renews",
column: "approved_design_file_id1",
principalTable: "File_model",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_request_renews_File_model_expired_cert_file_id1",
table: "request_renews",
column: "expired_cert_file_id1",
principalTable: "File_model",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_request_renews_File_model_ref_orders_file_id1",
table: "request_renews",
column: "ref_orders_file_id1",
principalTable: "File_model",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_request_renews_File_model_update_tds_file_id1",
table: "request_renews",
column: "update_tds_file_id1",
principalTable: "File_model",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_request_renews_signatures_signature_id1",
table: "request_renews",
column: "signature_id1",
principalTable: "signatures",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
}
}
}