complete controllers
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Blahblah.FlowerStory.Server.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddPhotosFlowerForeignKey : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "fid",
|
||||
table: "photos",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_photos_fid",
|
||||
table: "photos",
|
||||
column: "fid");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_photos_flowers_fid",
|
||||
table: "photos",
|
||||
column: "fid",
|
||||
principalTable: "flowers",
|
||||
principalColumn: "fid",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_photos_flowers_fid",
|
||||
table: "photos");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_photos_fid",
|
||||
table: "photos");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "fid",
|
||||
table: "photos");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user