using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace vendorApproverBackend.Migrations
{
///
public partial class AddClarificationRequestRenew : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "request_renew_clarifications",
columns: table => new
{
id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
request_renew_id = table.Column(type: "bigint", nullable: false),
sender_id = table.Column(type: "bigint", nullable: false),
message = table.Column(type: "TEXT", nullable: false),
timestmp = table.Column(type: "timestamp without time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_request_renew_clarifications", x => x.id);
table.ForeignKey(
name: "FK_request_renew_clarifications_request_renews_request_renew_id",
column: x => x.request_renew_id,
principalTable: "request_renews",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_request_renew_clarifications_users_table_sender_id",
column: x => x.sender_id,
principalTable: "users_table",
principalColumn: "user_id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_request_renew_clarifications_request_renew_id",
table: "request_renew_clarifications",
column: "request_renew_id");
migrationBuilder.CreateIndex(
name: "IX_request_renew_clarifications_sender_id",
table: "request_renew_clarifications",
column: "sender_id");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "request_renew_clarifications");
}
}
}