using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace vendorApproverBackend.Migrations
{
///
public partial class AssessmentReportEntity : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AssessmentReports",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
CreatedById = table.Column(type: "bigint", nullable: false),
PrequalificationRequestId = table.Column(type: "bigint", nullable: false),
timestmp = table.Column(type: "timestamp with time zone", nullable: false),
AuditVisit = table.Column(type: "jsonb", nullable: true),
DocumentationReview = table.Column(type: "jsonb", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AssessmentReports", x => x.Id);
table.ForeignKey(
name: "FK_AssessmentReports_PrequalificationRequests_Prequalification~",
column: x => x.PrequalificationRequestId,
principalTable: "PrequalificationRequests",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AssessmentReports_users_table_CreatedById",
column: x => x.CreatedById,
principalTable: "users_table",
principalColumn: "user_id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_AssessmentReports_CreatedById",
table: "AssessmentReports",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_AssessmentReports_PrequalificationRequestId",
table: "AssessmentReports",
column: "PrequalificationRequestId",
unique: true);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AssessmentReports");
}
}
}