using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Data.SeaHavenIndustries.Migrations
{
///
public partial class quoteschnages : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Quotes",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
QuotId = table.Column(type: "nvarchar(max)", nullable: true),
Date = table.Column(type: "datetime2", nullable: true),
POC = table.Column(type: "nvarchar(max)", nullable: true),
TT = table.Column(type: "nvarchar(max)", nullable: true),
PO = table.Column(type: "nvarchar(max)", nullable: true),
ContactId = table.Column(type: "int", nullable: true),
ProposalforId = table.Column(type: "int", nullable: true),
ProjectName = table.Column(type: "nvarchar(max)", nullable: true),
SiteName = table.Column(type: "nvarchar(max)", nullable: true),
SiteId = table.Column(type: "nvarchar(max)", nullable: true),
ShippingAddress = table.Column(type: "nvarchar(max)", nullable: true),
IsDeleted = table.Column(type: "bit", nullable: true),
createdby = table.Column(type: "nvarchar(max)", nullable: true),
DeleterUserId = table.Column(type: "nvarchar(max)", nullable: true),
DeletionTime = table.Column(type: "datetime2", nullable: true),
CreatedDate = table.Column(type: "datetime2", nullable: true),
LastModificationTime = table.Column(type: "datetime2", nullable: true),
LastModifierUserId = table.Column(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Quotes", x => x.Id);
table.ForeignKey(
name: "FK_Quotes_Contacts_ContactId",
column: x => x.ContactId,
principalTable: "Contacts",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Quotes_workOrders_ProposalforId",
column: x => x.ProposalforId,
principalTable: "workOrders",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "QuotesLineItems",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
LineitemNumber = table.Column(type: "int", nullable: true),
Lineitem = table.Column(type: "decimal(18,2)", nullable: true),
QuoteId = table.Column(type: "int", nullable: true),
IsDeleted = table.Column(type: "bit", nullable: true),
createdby = table.Column(type: "nvarchar(max)", nullable: true),
DeleterUserId = table.Column(type: "nvarchar(max)", nullable: true),
DeletionTime = table.Column(type: "datetime2", nullable: true),
CreatedDate = table.Column(type: "datetime2", nullable: true),
LastModificationTime = table.Column(type: "datetime2", nullable: true),
LastModifierUserId = table.Column(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_QuotesLineItems", x => x.Id);
table.ForeignKey(
name: "FK_QuotesLineItems_Quotes_QuoteId",
column: x => x.QuoteId,
principalTable: "Quotes",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_Quotes_ContactId",
table: "Quotes",
column: "ContactId");
migrationBuilder.CreateIndex(
name: "IX_Quotes_ProposalforId",
table: "Quotes",
column: "ProposalforId");
migrationBuilder.CreateIndex(
name: "IX_QuotesLineItems_QuoteId",
table: "QuotesLineItems",
column: "QuoteId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "QuotesLineItems");
migrationBuilder.DropTable(
name: "Quotes");
}
}
}