PhoneToolMX/PhoneToolMX.Models/Migrations/20231020040540_ExtensionPassword.cs
snow flurry 4fb88d6cbb Move Password from Phone to Extension
I misunderstood pjsip's concept of endpoints/AoRs. Multiple devices can be bound to a single endpoint, which in turn can have multiple AoRs. So the password should be bound to an Extension, not a Phone.
2023-10-20 12:57:22 -07:00

38 lines
1.1 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PhoneToolMX.Models.Migrations
{
public partial class ExtensionPassword : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Password",
table: "Phones");
migrationBuilder.AddColumn<string>(
name: "Password",
table: "Extensions",
type: "text",
nullable: true,
defaultValueSql: "encode(gen_random_bytes(18), 'base64')");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Password",
table: "Extensions");
migrationBuilder.AddColumn<string>(
name: "Password",
table: "Phones",
type: "text",
nullable: true,
defaultValueSql: "encode(gen_random_bytes(18), 'base64')");
}
}
}