mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
34 lines
1.4 KiB
C#
34 lines
1.4 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
namespace Marechai.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");
|
|
}
|
|
}
|
|
} |