Use license table in machine photos.

This commit is contained in:
2019-05-27 18:03:08 +01:00
parent 82956c6b77
commit 574176ee4c
7 changed files with 5452 additions and 8 deletions

View File

@@ -0,0 +1,34 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Cicm.Database.Migrations
{
public partial class UseLicenseInMachinePhoto : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex("IX_MachinePhotos_License", "MachinePhotos");
migrationBuilder.DropColumn("License", "MachinePhotos");
migrationBuilder.AddColumn<int>("LicenseId", "MachinePhotos", nullable: false, defaultValue: 0);
migrationBuilder.CreateIndex("IX_MachinePhotos_LicenseId", "MachinePhotos", "LicenseId");
migrationBuilder.AddForeignKey("FK_MachinePhotos_Licenses_LicenseId", "MachinePhotos", "LicenseId",
"Licenses", principalColumn: "Id", onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey("FK_MachinePhotos_Licenses_LicenseId", "MachinePhotos");
migrationBuilder.DropIndex("IX_MachinePhotos_LicenseId", "MachinePhotos");
migrationBuilder.DropColumn("LicenseId", "MachinePhotos");
migrationBuilder.AddColumn<string>("License", "MachinePhotos", nullable: true);
migrationBuilder.CreateIndex("IX_MachinePhotos_License", "MachinePhotos", "License");
}
}
}