61 lines
1.8 KiB
C#
61 lines
1.8 KiB
C#
|
using System;
|
|||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace DatabaseImplement.Migrations
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
public partial class dates_migration : Migration
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.AddColumn<DateTime>(
|
|||
|
name: "DateArriving",
|
|||
|
table: "Supplies",
|
|||
|
type: "timestamp with time zone",
|
|||
|
nullable: true);
|
|||
|
|
|||
|
migrationBuilder.AddColumn<DateTime>(
|
|||
|
name: "DateComplete",
|
|||
|
table: "Supplies",
|
|||
|
type: "timestamp with time zone",
|
|||
|
nullable: true);
|
|||
|
|
|||
|
migrationBuilder.CreateIndex(
|
|||
|
name: "IX_MediaFiles_ProductId",
|
|||
|
table: "MediaFiles",
|
|||
|
column: "ProductId");
|
|||
|
|
|||
|
migrationBuilder.AddForeignKey(
|
|||
|
name: "FK_MediaFiles_Products_ProductId",
|
|||
|
table: "MediaFiles",
|
|||
|
column: "ProductId",
|
|||
|
principalTable: "Products",
|
|||
|
principalColumn: "Id",
|
|||
|
onDelete: ReferentialAction.Cascade);
|
|||
|
}
|
|||
|
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropForeignKey(
|
|||
|
name: "FK_MediaFiles_Products_ProductId",
|
|||
|
table: "MediaFiles");
|
|||
|
|
|||
|
migrationBuilder.DropIndex(
|
|||
|
name: "IX_MediaFiles_ProductId",
|
|||
|
table: "MediaFiles");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "DateArriving",
|
|||
|
table: "Supplies");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "DateComplete",
|
|||
|
table: "Supplies");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|