mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-10-02 03:53:24 +00:00
71 lines
2.1 KiB
C#
71 lines
2.1 KiB
C#
|
|
using System;
|
|||
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|
|||
|
|
#nullable disable
|
|||
|
|
|
|||
|
|
namespace Data.SeaHavenIndustries.Migrations
|
|||
|
|
{
|
|||
|
|
/// <inheritdoc />
|
|||
|
|
public partial class AddDispatchNumberAndCommentDispatchId : Migration
|
|||
|
|
{
|
|||
|
|
/// <inheritdoc />
|
|||
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
|
{
|
|||
|
|
migrationBuilder.AddColumn<DateTime>(
|
|||
|
|
name: "CompletedDate",
|
|||
|
|
table: "Dispatches",
|
|||
|
|
type: "datetime2",
|
|||
|
|
nullable: true);
|
|||
|
|
|
|||
|
|
migrationBuilder.AddColumn<string>(
|
|||
|
|
name: "DispatchNumber",
|
|||
|
|
table: "Dispatches",
|
|||
|
|
type: "nvarchar(max)",
|
|||
|
|
nullable: true);
|
|||
|
|
|
|||
|
|
migrationBuilder.AddColumn<int>(
|
|||
|
|
name: "DispatchId",
|
|||
|
|
table: "Comments",
|
|||
|
|
type: "int",
|
|||
|
|
nullable: true);
|
|||
|
|
|
|||
|
|
migrationBuilder.CreateIndex(
|
|||
|
|
name: "IX_Comments_DispatchId",
|
|||
|
|
table: "Comments",
|
|||
|
|
column: "DispatchId");
|
|||
|
|
|
|||
|
|
migrationBuilder.AddForeignKey(
|
|||
|
|
name: "FK_Comments_Dispatches_DispatchId",
|
|||
|
|
table: "Comments",
|
|||
|
|
column: "DispatchId",
|
|||
|
|
principalTable: "Dispatches",
|
|||
|
|
principalColumn: "Id",
|
|||
|
|
onDelete: ReferentialAction.Restrict);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <inheritdoc />
|
|||
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
|
{
|
|||
|
|
migrationBuilder.DropForeignKey(
|
|||
|
|
name: "FK_Comments_Dispatches_DispatchId",
|
|||
|
|
table: "Comments");
|
|||
|
|
|
|||
|
|
migrationBuilder.DropIndex(
|
|||
|
|
name: "IX_Comments_DispatchId",
|
|||
|
|
table: "Comments");
|
|||
|
|
|
|||
|
|
migrationBuilder.DropColumn(
|
|||
|
|
name: "CompletedDate",
|
|||
|
|
table: "Dispatches");
|
|||
|
|
|
|||
|
|
migrationBuilder.DropColumn(
|
|||
|
|
name: "DispatchNumber",
|
|||
|
|
table: "Dispatches");
|
|||
|
|
|
|||
|
|
migrationBuilder.DropColumn(
|
|||
|
|
name: "DispatchId",
|
|||
|
|
table: "Comments");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|