using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace vendorApproverBackend.Migrations
{
///
public partial class VendorRequestLetter : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "vendor_request_letters",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Status = table.Column(type: "integer", nullable: false),
SubmissionDate = table.Column(type: "timestamp with time zone", nullable: true),
ApprovalDate = table.Column(type: "timestamp with time zone", nullable: true),
FullName = table.Column(type: "text", nullable: true),
ShortName = table.Column(type: "text", nullable: true),
DateEstablished = table.Column(type: "timestamp with time zone", nullable: true),
OriginCountry = table.Column(type: "text", nullable: true),
VendorGpsCoordinates = table.Column(type: "text", nullable: true),
VendorWebsite = table.Column(type: "text", nullable: true),
OfficeLocation = table.Column(type: "text", nullable: true),
GccCountryName = table.Column(type: "text", nullable: true),
OtherCountryName = table.Column(type: "text", nullable: true),
OmanStreet = table.Column(type: "text", nullable: true),
OmanPoBox = table.Column(type: "text", nullable: true),
OmanTel = table.Column(type: "text", nullable: true),
OmanFax = table.Column(type: "text", nullable: true),
HqStreet = table.Column(type: "text", nullable: true),
HqPoBox = table.Column(type: "text", nullable: true),
HqTel = table.Column(type: "text", nullable: true),
HqFax = table.Column(type: "text", nullable: true),
HqEmail = table.Column(type: "text", nullable: true),
FactoryStreet = table.Column(type: "text", nullable: true),
FactoryPoBox = table.Column(type: "text", nullable: true),
FactoryTel = table.Column(type: "text", nullable: true),
FactoryFax = table.Column(type: "text", nullable: true),
FactoryEmail = table.Column(type: "text", nullable: true),
SalesStreet = table.Column(type: "text", nullable: true),
SalesPoBox = table.Column(type: "text", nullable: true),
SalesTel = table.Column(type: "text", nullable: true),
SalesFax = table.Column(type: "text", nullable: true),
SalesEmail = table.Column(type: "text", nullable: true),
IsBranchInOman = table.Column(type: "boolean", nullable: true),
AgentNames = table.Column(type: "text", nullable: true),
CommercialRegNumber = table.Column(type: "text", nullable: true),
AgentContactPerson = table.Column(type: "text", nullable: true),
AgentDesignation = table.Column(type: "text", nullable: true),
RegisteredHeadOffice = table.Column(type: "text", nullable: true),
GpsCoordinates = table.Column(type: "text", nullable: true),
AgentTel = table.Column(type: "text", nullable: true),
AgentFax = table.Column(type: "text", nullable: true),
AgentEmail = table.Column(type: "text", nullable: true),
AgentWebsite = table.Column(type: "text", nullable: true),
OfficialAgencySubmitted = table.Column(type: "text", nullable: true),
AuthorizedPersonsSubmitted = table.Column(type: "text", nullable: true),
VendorId = table.Column(type: "bigint", nullable: false),
AssignedToManager = table.Column(type: "boolean", nullable: true),
AssociatedCompanies = table.Column(type: "jsonb", nullable: true),
AuthorizedSignatories = table.Column(type: "jsonb", nullable: true),
BoardOfDirectors = table.Column(type: "jsonb", nullable: true),
CertificatesAndLicenses = table.Column(type: "jsonb", nullable: true),
ContactPersons = table.Column(type: "jsonb", nullable: true),
LocalOwners = table.Column(type: "jsonb", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_vendor_request_letters", x => x.Id);
table.ForeignKey(
name: "FK_vendor_request_letters_Vendors_VendorId",
column: x => x.VendorId,
principalTable: "Vendors",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "letter_products",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Category = table.Column(type: "text", nullable: true),
Subcategory = table.Column(type: "text", nullable: true),
ProductName = table.Column(type: "text", nullable: true),
ProductCity = table.Column(type: "text", nullable: true),
ProductCountry = table.Column(type: "text", nullable: true),
ProductType = table.Column(type: "text", nullable: true),
ProductDesc = table.Column(type: "text", nullable: true),
Status = table.Column(type: "integer", nullable: false),
VendorRequestLetterId = table.Column(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_letter_products", x => x.Id);
table.ForeignKey(
name: "FK_letter_products_vendor_request_letters_VendorRequestLetterId",
column: x => x.VendorRequestLetterId,
principalTable: "vendor_request_letters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_letter_products_VendorRequestLetterId",
table: "letter_products",
column: "VendorRequestLetterId");
migrationBuilder.CreateIndex(
name: "IX_vendor_request_letters_VendorId",
table: "vendor_request_letters",
column: "VendorId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "letter_products");
migrationBuilder.DropTable(
name: "vendor_request_letters");
}
}
}