Add native Bifrost identity registration
This commit is contained in:
parent
445c27978b
commit
23c02be2a6
17 changed files with 366 additions and 29 deletions
|
|
@ -0,0 +1,54 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bifrost.Web.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[Migration("20260622165000_AddBifrostNativeIdentity")]
|
||||
public partial class AddBifrostNativeIdentity : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "BifrostIdentity",
|
||||
table: "UserAccounts",
|
||||
type: "character varying(120)",
|
||||
maxLength: 120,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "NormalizedBifrostIdentity",
|
||||
table: "UserAccounts",
|
||||
type: "character varying(120)",
|
||||
maxLength: 120,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_UserAccounts_NormalizedBifrostIdentity",
|
||||
table: "UserAccounts",
|
||||
column: "NormalizedBifrostIdentity",
|
||||
unique: true,
|
||||
filter: "\"NormalizedBifrostIdentity\" <> ''");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_UserAccounts_NormalizedBifrostIdentity",
|
||||
table: "UserAccounts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BifrostIdentity",
|
||||
table: "UserAccounts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "NormalizedBifrostIdentity",
|
||||
table: "UserAccounts");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1227,6 +1227,11 @@ namespace Bifrost.Web.Data.Migrations
|
|||
.HasMaxLength(500)
|
||||
.HasColumnType("character varying(500)");
|
||||
|
||||
b.Property<string>("BifrostIdentity")
|
||||
.IsRequired()
|
||||
.HasMaxLength(120)
|
||||
.HasColumnType("character varying(120)");
|
||||
|
||||
b.Property<DateTimeOffset>("CreatedAtUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
|
|
@ -1251,6 +1256,11 @@ namespace Bifrost.Web.Data.Migrations
|
|||
b.Property<DateTimeOffset>("LastSeenAtUtc")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("NormalizedBifrostIdentity")
|
||||
.IsRequired()
|
||||
.HasMaxLength(120)
|
||||
.HasColumnType("character varying(120)");
|
||||
|
||||
b.Property<string>("NormalizedGitHubLogin")
|
||||
.IsRequired()
|
||||
.HasMaxLength(120)
|
||||
|
|
@ -1266,6 +1276,10 @@ namespace Bifrost.Web.Data.Migrations
|
|||
.IsUnique()
|
||||
.HasFilter("\"HeimdallAccountId\" <> ''");
|
||||
|
||||
b.HasIndex("NormalizedBifrostIdentity")
|
||||
.IsUnique()
|
||||
.HasFilter("\"NormalizedBifrostIdentity\" <> ''");
|
||||
|
||||
b.HasIndex("NormalizedGitHubLogin")
|
||||
.IsUnique()
|
||||
.HasFilter("\"NormalizedGitHubLogin\" <> ''");
|
||||
|
|
|
|||
Loading…
Reference in a new issue