Files
Assistant/backend/Migrations/20260611184536_AddDeviceOwnerFkAndPinSettingsId.cs
T

49 lines
1.5 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace backend.Migrations
{
/// <inheritdoc />
public partial class AddDeviceOwnerFkAndPinSettingsId : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "Id",
table: "SystemSettings",
type: "INTEGER",
nullable: false,
oldClrType: typeof(int),
oldType: "INTEGER")
.OldAnnotation("Sqlite:Autoincrement", true);
migrationBuilder.AddForeignKey(
name: "FK_Devices_AspNetUsers_OwnerUserId",
table: "Devices",
column: "OwnerUserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Devices_AspNetUsers_OwnerUserId",
table: "Devices");
migrationBuilder.AlterColumn<int>(
name: "Id",
table: "SystemSettings",
type: "INTEGER",
nullable: false,
oldClrType: typeof(int),
oldType: "INTEGER")
.Annotation("Sqlite:Autoincrement", true);
}
}
}