shoc-legacy/Data.SeaHavenIndustries/Migrations/20231219120924_quoteschnages.cs
2024-09-28 14:58:36 -04:00

110 lines
5.3 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Data.SeaHavenIndustries.Migrations
{
/// <inheritdoc />
public partial class quoteschnages : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Quotes",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
QuotId = table.Column<string>(type: "nvarchar(max)", nullable: true),
Date = table.Column<DateTime>(type: "datetime2", nullable: true),
POC = table.Column<string>(type: "nvarchar(max)", nullable: true),
TT = table.Column<string>(type: "nvarchar(max)", nullable: true),
PO = table.Column<string>(type: "nvarchar(max)", nullable: true),
ContactId = table.Column<int>(type: "int", nullable: true),
ProposalforId = table.Column<int>(type: "int", nullable: true),
ProjectName = table.Column<string>(type: "nvarchar(max)", nullable: true),
SiteName = table.Column<string>(type: "nvarchar(max)", nullable: true),
SiteId = table.Column<string>(type: "nvarchar(max)", nullable: true),
ShippingAddress = table.Column<string>(type: "nvarchar(max)", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: true),
createdby = table.Column<string>(type: "nvarchar(max)", nullable: true),
DeleterUserId = table.Column<string>(type: "nvarchar(max)", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
CreatedDate = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierUserId = table.Column<int>(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<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
LineitemNumber = table.Column<int>(type: "int", nullable: true),
Lineitem = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
QuoteId = table.Column<int>(type: "int", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: true),
createdby = table.Column<string>(type: "nvarchar(max)", nullable: true),
DeleterUserId = table.Column<string>(type: "nvarchar(max)", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
CreatedDate = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierUserId = table.Column<int>(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");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "QuotesLineItems");
migrationBuilder.DropTable(
name: "Quotes");
}
}
}