add init service to create housemaster and master app
This commit is contained in:
parent
81f93c5dd1
commit
1ad7e3d66a
28
obj/Data.EntityFrameworkCore.targets
Normal file
28
obj/Data.EntityFrameworkCore.targets
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Target Name="GetEFProjectMetadata">
|
||||||
|
<MSBuild Condition=" '$(TargetFramework)' == '' "
|
||||||
|
Projects="$(MSBuildProjectFile)"
|
||||||
|
Targets="GetEFProjectMetadata"
|
||||||
|
Properties="TargetFramework=$(TargetFrameworks.Split(';')[0]);EFProjectMetadataFile=$(EFProjectMetadataFile)" />
|
||||||
|
<ItemGroup Condition=" '$(TargetFramework)' != '' ">
|
||||||
|
<EFProjectMetadata Include="AssemblyName: $(AssemblyName)" />
|
||||||
|
<EFProjectMetadata Include="Language: $(Language)" />
|
||||||
|
<EFProjectMetadata Include="OutputPath: $(OutputPath)" />
|
||||||
|
<EFProjectMetadata Include="Platform: $(Platform)" />
|
||||||
|
<EFProjectMetadata Include="PlatformTarget: $(PlatformTarget)" />
|
||||||
|
<EFProjectMetadata Include="ProjectAssetsFile: $(ProjectAssetsFile)" />
|
||||||
|
<EFProjectMetadata Include="ProjectDir: $(ProjectDir)" />
|
||||||
|
<EFProjectMetadata Include="RootNamespace: $(RootNamespace)" />
|
||||||
|
<EFProjectMetadata Include="RuntimeFrameworkVersion: $(RuntimeFrameworkVersion)" />
|
||||||
|
<EFProjectMetadata Include="TargetFileName: $(TargetFileName)" />
|
||||||
|
<EFProjectMetadata Include="TargetFrameworkMoniker: $(TargetFrameworkMoniker)" />
|
||||||
|
<EFProjectMetadata Include="Nullable: $(Nullable)" />
|
||||||
|
<EFProjectMetadata Include="TargetFramework: $(TargetFramework)" />
|
||||||
|
<EFProjectMetadata Include="TargetPlatformIdentifier: $(TargetPlatformIdentifier)" />
|
||||||
|
</ItemGroup>
|
||||||
|
<WriteLinesToFile Condition=" '$(TargetFramework)' != '' "
|
||||||
|
File="$(EFProjectMetadataFile)"
|
||||||
|
Lines="@(EFProjectMetadata)" />
|
||||||
|
</Target>
|
||||||
|
</Project>
|
||||||
@ -1,3 +1,3 @@
|
|||||||
@echo off
|
@echo off
|
||||||
set /p migrationName="Migration Name: "
|
set /p migrationName="Migration Name: "
|
||||||
dotnet ef migrations add %migrationName% --startup-project "../Api" --project "../Data" --context ApplicationContext
|
dotnet ef migrations add %migrationName% --startup-project "../src/dotnet/Suspectus.Gandalf.Palantir.Api" --project "../src/dotnet/Suspectus.Gandalf.Palantir.Data" --context ApplicationContext
|
||||||
@ -1,2 +1,2 @@
|
|||||||
@echo off
|
@echo off
|
||||||
dotnet ef database update --startup-project "../Api" --project "../Data" --context ApplicationContext
|
dotnet ef database update --startup-project "../src/dotnet/Suspectus.Gandalf.Palantir.Api" --project "../src/dotnet/Suspectus.Gandalf.Palantir.Data" --context ApplicationContext
|
||||||
13
src/dotnet/.idea/.idea.Suspectus.Gandalf/.idea/dataSources.xml
generated
Normal file
13
src/dotnet/.idea/.idea.Suspectus.Gandalf/.idea/dataSources.xml
generated
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||||
|
<data-source source="LOCAL" name="gandalf_reborn@localhost" uuid="e99e792b-4896-4d0b-a502-dddde8f7cd81">
|
||||||
|
<driver-ref>postgresql</driver-ref>
|
||||||
|
<synchronize>true</synchronize>
|
||||||
|
<configured-by-url>true</configured-by-url>
|
||||||
|
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
|
||||||
|
<jdbc-url>jdbc:postgresql://localhost:5432/gandalf_reborn?logServerErrorDetail=True&password=root&user=root</jdbc-url>
|
||||||
|
<working-dir>$ProjectFileDir$</working-dir>
|
||||||
|
</data-source>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@ -4,6 +4,7 @@ using HashidsNet;
|
|||||||
using Microsoft.AspNetCore.Identity;
|
using Microsoft.AspNetCore.Identity;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Suspectus.Gandalf.Palantir.Abstractions;
|
using Suspectus.Gandalf.Palantir.Abstractions;
|
||||||
|
using Suspectus.Gandalf.Palantir.Api.Services;
|
||||||
using Suspectus.Gandalf.Palantir.Security.Scheme;
|
using Suspectus.Gandalf.Palantir.Security.Scheme;
|
||||||
using Suspectus.Gandalf.Palantir.Data.Database;
|
using Suspectus.Gandalf.Palantir.Data.Database;
|
||||||
using Suspectus.Gandalf.Palantir.Data.Database.Repositories;
|
using Suspectus.Gandalf.Palantir.Data.Database.Repositories;
|
||||||
@ -51,13 +52,13 @@ builder.Services.AddMediatR(config =>
|
|||||||
{
|
{
|
||||||
config.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
|
config.RegisterServicesFromAssembly(Assembly.GetExecutingAssembly());
|
||||||
});
|
});
|
||||||
|
builder.Services.AddTransient<InitService>();
|
||||||
builder.Services.AddOpenApi();
|
builder.Services.AddOpenApi();
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
var scope = app.Services.CreateScope();
|
var scope = app.Services.CreateScope();
|
||||||
var applicationContext = scope.ServiceProvider.GetRequiredService<ApplicationContext>();
|
var initService = scope.ServiceProvider.GetRequiredService<InitService>();
|
||||||
applicationContext.Database.EnsureCreated();
|
await initService.InitializeAsync();
|
||||||
applicationContext.AddVersionTriggers();
|
|
||||||
|
|
||||||
// Configure the HTTP request pipeline.
|
// Configure the HTTP request pipeline.
|
||||||
if (app.Environment.IsDevelopment())
|
if (app.Environment.IsDevelopment())
|
||||||
|
|||||||
@ -0,0 +1,134 @@
|
|||||||
|
using MediatR;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Suspectus.Gandalf.Palantir.Abstractions;
|
||||||
|
using Suspectus.Gandalf.Palantir.Api.Commands;
|
||||||
|
using Suspectus.Gandalf.Palantir.Api.Extensions;
|
||||||
|
using Suspectus.Gandalf.Palantir.Data.Database;
|
||||||
|
using Suspectus.Gandalf.Palantir.Data.Entities.App;
|
||||||
|
using Suspectus.Gandalf.Palantir.Data.Entities.Base;
|
||||||
|
using Suspectus.Gandalf.Palantir.Data.Entities.Subject;
|
||||||
|
using Suspectus.Gandalf.Palantir.Data.Entities.Subject.SignIn;
|
||||||
|
using Suspectus.Gandalf.Palantir.Data.Entities.Tenant;
|
||||||
|
|
||||||
|
namespace Suspectus.Gandalf.Palantir.Api.Services;
|
||||||
|
|
||||||
|
public class InitService
|
||||||
|
{
|
||||||
|
private const string HousemasterUserName = "housemaster";
|
||||||
|
|
||||||
|
private readonly ApplicationContext _applicationContext;
|
||||||
|
private readonly IMediator _mediator;
|
||||||
|
private readonly ILogger<InitService> _logger;
|
||||||
|
private readonly InvokerContext _invokerContext;
|
||||||
|
|
||||||
|
public InitService(ApplicationContext applicationContext, IMediator mediator, ILogger<InitService> logger, InvokerContext invokerContext)
|
||||||
|
{
|
||||||
|
_applicationContext = applicationContext;
|
||||||
|
_mediator = mediator;
|
||||||
|
_logger = logger;
|
||||||
|
_invokerContext = invokerContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static string GeneratePassword(int length = 20)
|
||||||
|
{
|
||||||
|
const string chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||||
|
var random = new Random();
|
||||||
|
return new string(
|
||||||
|
Enumerable.Repeat(0, length)
|
||||||
|
.Select(_ => chars[random.Next(chars.Length)]).ToArray()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task InitializeDatabaseAsync()
|
||||||
|
{
|
||||||
|
await _applicationContext.Database.EnsureCreatedAsync();
|
||||||
|
await _applicationContext.AddVersionTriggers();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task InitializeMaster()
|
||||||
|
{
|
||||||
|
var masterTenant = await _applicationContext.Tenants.SingleOrDefaultAsync(x => x.Id == 0);
|
||||||
|
|
||||||
|
if (masterTenant is not null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var masterTenantPassword = GeneratePassword();
|
||||||
|
var masterTenantPasswordHashResult = await _mediator.Send(new HashPasswordCommand { RawPassword = masterTenantPassword });
|
||||||
|
|
||||||
|
if (masterTenantPasswordHashResult.IsFaulted)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var masterTenantPasswordHash = masterTenantPasswordHashResult.GetValue();
|
||||||
|
|
||||||
|
var housemasterUser = new SubjectEntity
|
||||||
|
{
|
||||||
|
Visibility = EntityVisibility.Active,
|
||||||
|
Name = HousemasterUserName,
|
||||||
|
SignInMethods =
|
||||||
|
[
|
||||||
|
new SignInEntity
|
||||||
|
{
|
||||||
|
Visibility = EntityVisibility.Active,
|
||||||
|
Method = SignInMethod.Simple,
|
||||||
|
IsLegacy = false,
|
||||||
|
PasswordHash = masterTenantPasswordHash
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
_applicationContext.Subjects.Add(housemasterUser);
|
||||||
|
await _applicationContext.SaveChangesAsync();
|
||||||
|
|
||||||
|
_invokerContext.Invoker = new Invoker
|
||||||
|
{
|
||||||
|
SubjectId = housemasterUser.Id!.Value,
|
||||||
|
TenantAuthorityDictionary = new Dictionary<string, HashSet<string>>(),
|
||||||
|
AppAuthorityDictionary = new Dictionary<string, HashSet<string>>(),
|
||||||
|
IsAuthenticated = true
|
||||||
|
};
|
||||||
|
|
||||||
|
masterTenant = new TenantEntity
|
||||||
|
{
|
||||||
|
Visibility = EntityVisibility.Active,
|
||||||
|
Name = "Master",
|
||||||
|
OwnerId = housemasterUser.Id!.Value,
|
||||||
|
};
|
||||||
|
|
||||||
|
_applicationContext.Tenants.Add(masterTenant);
|
||||||
|
await _applicationContext.SaveChangesAsync();
|
||||||
|
|
||||||
|
var masterApp = new AppEntity
|
||||||
|
{
|
||||||
|
Visibility = EntityVisibility.Active,
|
||||||
|
TenantId = masterTenant.Id!.Value,
|
||||||
|
Name = "Master"
|
||||||
|
};
|
||||||
|
|
||||||
|
_applicationContext.Apps.Add(masterApp);
|
||||||
|
await _applicationContext.SaveChangesAsync();
|
||||||
|
|
||||||
|
var appSubjectRelation = new AppSubjectRelationEntity
|
||||||
|
{
|
||||||
|
AppId = masterApp.Id!.Value,
|
||||||
|
SubjectId = housemasterUser.Id!.Value
|
||||||
|
};
|
||||||
|
|
||||||
|
_applicationContext.AppSubjectRelations.Add(appSubjectRelation);
|
||||||
|
await _applicationContext.SaveChangesAsync();
|
||||||
|
|
||||||
|
_logger.LogInformation($"""
|
||||||
|
----- Housemaster initial login information -----
|
||||||
|
username: {housemasterUser.Name}
|
||||||
|
password: {masterTenantPassword}
|
||||||
|
Please change the password after the first login.
|
||||||
|
-------------------------------------------------
|
||||||
|
""");
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task InitializeAsync()
|
||||||
|
{
|
||||||
|
await InitializeDatabaseAsync();
|
||||||
|
await InitializeMaster();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -117,7 +117,7 @@ public sealed class ApplicationContext(DbContextOptions<ApplicationContext> opti
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddVersionTriggers()
|
public async Task AddVersionTriggers()
|
||||||
{
|
{
|
||||||
foreach (var (entityType, versionType) in EntityToVersionEntityMap)
|
foreach (var (entityType, versionType) in EntityToVersionEntityMap)
|
||||||
{
|
{
|
||||||
@ -159,7 +159,7 @@ public sealed class ApplicationContext(DbContextOptions<ApplicationContext> opti
|
|||||||
""";
|
""";
|
||||||
|
|
||||||
#pragma warning disable EF1002
|
#pragma warning disable EF1002
|
||||||
Database.ExecuteSqlRaw(sql);
|
await Database.ExecuteSqlRawAsync(sql);
|
||||||
#pragma warning restore EF1002
|
#pragma warning restore EF1002
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,14 +12,14 @@ public abstract class CoreContext<T>(DbContextOptions<T> options) : DbContext(op
|
|||||||
{
|
{
|
||||||
public DbSet<TenantEntity> Tenants { get; set; }
|
public DbSet<TenantEntity> Tenants { get; set; }
|
||||||
public DbSet<SubjectEntity> Subjects { get; set; }
|
public DbSet<SubjectEntity> Subjects { get; set; }
|
||||||
public DbSet<AppRelationEntity> Apps { get; set; }
|
public DbSet<AppEntity> Apps { get; set; }
|
||||||
public DbSet<TenantSubjectRelationEntity> TenantSubjectRelations { get; set; }
|
public DbSet<TenantSubjectRelationEntity> TenantSubjectRelations { get; set; }
|
||||||
public DbSet<AppSubjectRelationEntity> AppSubjectRelations { get; set; }
|
public DbSet<AppSubjectRelationEntity> AppSubjectRelations { get; set; }
|
||||||
public DbSet<AuthorityEntity> AuthorityEntities { get; set; }
|
public DbSet<AuthorityEntity> AuthorityEntities { get; set; }
|
||||||
public DbSet<TokenMetadataEntity> TokenMetadata { get; set; }
|
public DbSet<TokenMetadataEntity> TokenMetadata { get; set; }
|
||||||
public DbSet<AuthCodeEntity> AuthCodes { get; set; }
|
public DbSet<AuthCodeEntity> AuthCodes { get; set; }
|
||||||
|
|
||||||
public DbSet<AppRelationVersionEntity> AppsVersions { get; set; }
|
public DbSet<AppVersionEntity> AppsVersions { get; set; }
|
||||||
public DbSet<TenantVersionEntity> TenantVersions { get; set; }
|
public DbSet<TenantVersionEntity> TenantVersions { get; set; }
|
||||||
public DbSet<AppSubjectRelationVersionEntity> AppSubjectRelationVersions { get; set; }
|
public DbSet<AppSubjectRelationVersionEntity> AppSubjectRelationVersions { get; set; }
|
||||||
public DbSet<TenantSubjectRelationVersionEntity> TenantSubjectRelationVersions { get; set; }
|
public DbSet<TenantSubjectRelationVersionEntity> TenantSubjectRelationVersions { get; set; }
|
||||||
@ -93,14 +93,6 @@ public abstract class CoreContext<T>(DbContextOptions<T> options) : DbContext(op
|
|||||||
.HasIndex(x => x.Name)
|
.HasIndex(x => x.Name)
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
|
||||||
subjectBuilder
|
|
||||||
.HasData(new SubjectEntity
|
|
||||||
{
|
|
||||||
Id = 1,
|
|
||||||
Visibility = EntityVisibility.Active,
|
|
||||||
Name = "chris"
|
|
||||||
});
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region SighnIns
|
#region SighnIns
|
||||||
@ -115,7 +107,7 @@ public abstract class CoreContext<T>(DbContextOptions<T> options) : DbContext(op
|
|||||||
|
|
||||||
#region App
|
#region App
|
||||||
|
|
||||||
var appBuilder = builder.Entity<AppRelationEntity>();
|
var appBuilder = builder.Entity<AppEntity>();
|
||||||
|
|
||||||
appBuilder
|
appBuilder
|
||||||
.HasMany(x => x.Subjects)
|
.HasMany(x => x.Subjects)
|
||||||
|
|||||||
@ -5,22 +5,22 @@ using Suspectus.Gandalf.Palantir.Data.Entities.Version;
|
|||||||
|
|
||||||
namespace Suspectus.Gandalf.Palantir.Data.Entities.App;
|
namespace Suspectus.Gandalf.Palantir.Data.Entities.App;
|
||||||
|
|
||||||
public class AppRelationEntity : AppRelationData, IVersionableEntity
|
public class AppEntity : AppData, IVersionableEntity
|
||||||
{
|
{
|
||||||
public TenantEntity? Tenant { get; set; }
|
public TenantEntity? Tenant { get; set; }
|
||||||
public HashSet<SubjectEntity> Subjects { get; set; } = [];
|
public HashSet<SubjectEntity> Subjects { get; set; } = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AppRelationVersionEntity : AppRelationData, IVersionEntity<AppRelationEntity>
|
public class AppVersionEntity : AppData, IVersionEntity<AppEntity>
|
||||||
{
|
{
|
||||||
public SubjectEntity? Suspect { get; set; }
|
public SubjectEntity? Suspect { get; set; }
|
||||||
public long SuspectId { get; set; }
|
public long SuspectId { get; set; }
|
||||||
public VersionAction Action { get; set; }
|
public VersionAction Action { get; set; }
|
||||||
public DateTimeOffset At { get; set; }
|
public DateTimeOffset At { get; set; }
|
||||||
public AppRelationEntity? Reference { get; set; }
|
public AppEntity? Reference { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class AppRelationData : TenantRelationData
|
public abstract class AppData : TenantRelationData
|
||||||
{
|
{
|
||||||
public required string Name { get; set; }
|
public required string Name { get; set; }
|
||||||
}
|
}
|
||||||
@ -9,7 +9,7 @@ namespace Suspectus.Gandalf.Palantir.Data.Entities.App;
|
|||||||
public class AppSubjectRelationEntity : AppSubjectRelationData<long>, IMappingEntity, IVersionableEntity
|
public class AppSubjectRelationEntity : AppSubjectRelationData<long>, IMappingEntity, IVersionableEntity
|
||||||
{
|
{
|
||||||
public HashSet<AuthorityEntity> InternalAuthorities { get; set; } = [];
|
public HashSet<AuthorityEntity> InternalAuthorities { get; set; } = [];
|
||||||
public AppRelationEntity? App { get; set; }
|
public AppEntity? App { get; set; }
|
||||||
public SubjectEntity? Subject { get; set; }
|
public SubjectEntity? Subject { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,5 +10,5 @@ public class SubjectEntity : VisibilityData
|
|||||||
public required string Name { get; set; }
|
public required string Name { get; set; }
|
||||||
public HashSet<SignInEntity> SignInMethods { get; set; } = [];
|
public HashSet<SignInEntity> SignInMethods { get; set; } = [];
|
||||||
public HashSet<TenantEntity> Tenants { get; set; } = [];
|
public HashSet<TenantEntity> Tenants { get; set; } = [];
|
||||||
public HashSet<AppRelationEntity> Apps { get; set; } = [];
|
public HashSet<AppEntity> Apps { get; set; } = [];
|
||||||
}
|
}
|
||||||
@ -8,7 +8,7 @@ public class TenantEntity : TenantData, IVersionableEntity
|
|||||||
{
|
{
|
||||||
public SubjectEntity? Owner { get; set; }
|
public SubjectEntity? Owner { get; set; }
|
||||||
public HashSet<SubjectEntity> Subjects { get; set; } = [];
|
public HashSet<SubjectEntity> Subjects { get; set; } = [];
|
||||||
public HashSet<AppRelationEntity> Apps { get; set; } = [];
|
public HashSet<AppEntity> Apps { get; set; } = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IVersionableEntity;
|
public interface IVersionableEntity;
|
||||||
|
|||||||
718
src/dotnet/Suspectus.Gandalf.Palantir.Data/Migrations/20250525155339_cringe1.Designer.cs
generated
Normal file
718
src/dotnet/Suspectus.Gandalf.Palantir.Data/Migrations/20250525155339_cringe1.Designer.cs
generated
Normal file
@ -0,0 +1,718 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
using Suspectus.Gandalf.Palantir.Data.Database;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace W542.GandalfReborn.Data.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(ApplicationContext))]
|
||||||
|
[Migration("20250525155339_cringe1")]
|
||||||
|
partial class cringe1
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "9.0.2")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppRelationEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("TenantId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<string>("Visibility")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("TenantId");
|
||||||
|
|
||||||
|
b.ToTable("AppRelation", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppRelationVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("At")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Action")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("SuspectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("TenantId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<string>("Visibility")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id", "At");
|
||||||
|
|
||||||
|
b.HasIndex("SuspectId");
|
||||||
|
|
||||||
|
b.ToTable("AppRelationVersion", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppSubjectRelationEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("AppId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("SubjectId", "AppId");
|
||||||
|
|
||||||
|
b.HasIndex("AppId");
|
||||||
|
|
||||||
|
b.ToTable("AppSubjectRelation", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppSubjectRelationVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("AppId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("At")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Action")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("SuspectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("SubjectId", "AppId", "At");
|
||||||
|
|
||||||
|
b.HasIndex("SuspectId");
|
||||||
|
|
||||||
|
b.ToTable("AppSubjectRelationVersion", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("AppId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("InternalAuthorityId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("SubjectId", "AppId", "InternalAuthorityId");
|
||||||
|
|
||||||
|
b.HasIndex("InternalAuthorityId");
|
||||||
|
|
||||||
|
b.ToTable("AppSubjectRelationInternalAuthorityRelation", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("AppId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("InternalAuthorityId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("At")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Action")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("SuspectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("SubjectId", "AppId", "InternalAuthorityId", "At");
|
||||||
|
|
||||||
|
b.HasIndex("SuspectId");
|
||||||
|
|
||||||
|
b.ToTable("AppSubjectRelationInternalAuthorityRelationVersion", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.AuthCodeEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Algorithm")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Challenge")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Code")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("Expiration")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<bool>("IsRevoked")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("AuthCode", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.AuthorityEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Type")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("Name")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("Authority", "gr");
|
||||||
|
|
||||||
|
b.HasData(
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = 1L,
|
||||||
|
Description = "Allows users to read tenants",
|
||||||
|
Name = "Tenant_Read",
|
||||||
|
Type = "Tenant"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = 2L,
|
||||||
|
Description = "Allows users to read apps",
|
||||||
|
Name = "App_Read",
|
||||||
|
Type = "App"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("TenantId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("InternalAuthorityId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("SubjectId", "TenantId", "InternalAuthorityId");
|
||||||
|
|
||||||
|
b.HasIndex("InternalAuthorityId");
|
||||||
|
|
||||||
|
b.ToTable("TenantSubjectRelationInternalAuthorityRelation", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("TenantId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("InternalAuthorityId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("At")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Action")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("SuspectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("SubjectId", "TenantId", "InternalAuthorityId", "At");
|
||||||
|
|
||||||
|
b.HasIndex("SuspectId");
|
||||||
|
|
||||||
|
b.ToTable("TenantSubjectRelationInternalAuthorityRelationVersion", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.TokenMetadataEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("Expiration")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<bool>("IsRevoked")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("TokenType")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("UsedBy")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("TokenMetadata", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SignIn.SignInEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLegacy")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("Method")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("PasswordHash")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<string>("Visibility")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("Email")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.HasIndex("SubjectId");
|
||||||
|
|
||||||
|
b.ToTable("SignIn", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Visibility")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("Name")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("Subject", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("OwnerId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<string>("Visibility")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("OwnerId");
|
||||||
|
|
||||||
|
b.ToTable("Tenant", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantSubjectRelationEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("TenantId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("SubjectId", "TenantId");
|
||||||
|
|
||||||
|
b.HasIndex("TenantId");
|
||||||
|
|
||||||
|
b.ToTable("TenantSubjectRelation", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantSubjectRelationVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("TenantId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("At")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Action")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("SuspectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("SubjectId", "TenantId", "At");
|
||||||
|
|
||||||
|
b.HasIndex("SuspectId");
|
||||||
|
|
||||||
|
b.ToTable("TenantSubjectRelationVersion", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("At")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Action")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("OwnerId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("SuspectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<string>("Visibility")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id", "At");
|
||||||
|
|
||||||
|
b.HasIndex("SuspectId");
|
||||||
|
|
||||||
|
b.ToTable("TenantVersion", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppRelationEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantEntity", "Tenant")
|
||||||
|
.WithMany("Apps")
|
||||||
|
.HasForeignKey("TenantId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Tenant");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppRelationVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.App.AppRelationEntity", "Reference")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("Id")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Suspect")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SuspectId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Reference");
|
||||||
|
|
||||||
|
b.Navigation("Suspect");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppSubjectRelationEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.App.AppRelationEntity", "App")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("AppId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Subject")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SubjectId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("App");
|
||||||
|
|
||||||
|
b.Navigation("Subject");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppSubjectRelationVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Suspect")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SuspectId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.App.AppSubjectRelationEntity", "Reference")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SubjectId", "AppId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Reference");
|
||||||
|
|
||||||
|
b.Navigation("Suspect");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Security.AuthorityEntity", "InternalAuthority")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("InternalAuthorityId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.App.AppSubjectRelationEntity", "AppSubjectRelation")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SubjectId", "AppId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("AppSubjectRelation");
|
||||||
|
|
||||||
|
b.Navigation("InternalAuthority");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Suspect")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SuspectId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationEntity", "Reference")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SubjectId", "AppId", "InternalAuthorityId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Reference");
|
||||||
|
|
||||||
|
b.Navigation("Suspect");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Security.AuthorityEntity", "InternalAuthority")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("InternalAuthorityId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantSubjectRelationEntity", "TenantSubjectRelation")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SubjectId", "TenantId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("InternalAuthority");
|
||||||
|
|
||||||
|
b.Navigation("TenantSubjectRelation");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Suspect")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SuspectId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationEntity", "Reference")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SubjectId", "TenantId", "InternalAuthorityId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Reference");
|
||||||
|
|
||||||
|
b.Navigation("Suspect");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SignIn.SignInEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Subject")
|
||||||
|
.WithMany("SignInMethods")
|
||||||
|
.HasForeignKey("SubjectId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Subject");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Owner")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("OwnerId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Owner");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantSubjectRelationEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Subject")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SubjectId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantEntity", "Tenant")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("TenantId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Subject");
|
||||||
|
|
||||||
|
b.Navigation("Tenant");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantSubjectRelationVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Suspect")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SuspectId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantSubjectRelationEntity", "Reference")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SubjectId", "TenantId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Reference");
|
||||||
|
|
||||||
|
b.Navigation("Suspect");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantEntity", "Reference")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("Id")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Suspect")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SuspectId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Reference");
|
||||||
|
|
||||||
|
b.Navigation("Suspect");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("SignInMethods");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantEntity", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Apps");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace W542.GandalfReborn.Data.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class cringe1 : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DeleteData(
|
||||||
|
schema: "gr",
|
||||||
|
table: "Subject",
|
||||||
|
keyColumn: "Id",
|
||||||
|
keyValue: 1L);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.InsertData(
|
||||||
|
schema: "gr",
|
||||||
|
table: "Subject",
|
||||||
|
columns: new[] { "Id", "Name", "Visibility" },
|
||||||
|
values: new object[] { 1L, "chris", "Active" });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
718
src/dotnet/Suspectus.Gandalf.Palantir.Data/Migrations/20250525162427_cringe2.Designer.cs
generated
Normal file
718
src/dotnet/Suspectus.Gandalf.Palantir.Data/Migrations/20250525162427_cringe2.Designer.cs
generated
Normal file
@ -0,0 +1,718 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
using Suspectus.Gandalf.Palantir.Data.Database;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace W542.GandalfReborn.Data.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(ApplicationContext))]
|
||||||
|
[Migration("20250525162427_cringe2")]
|
||||||
|
partial class cringe2
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "9.0.2")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("TenantId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<string>("Visibility")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("TenantId");
|
||||||
|
|
||||||
|
b.ToTable("App", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppSubjectRelationEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("AppId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("SubjectId", "AppId");
|
||||||
|
|
||||||
|
b.HasIndex("AppId");
|
||||||
|
|
||||||
|
b.ToTable("AppSubjectRelation", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppSubjectRelationVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("AppId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("At")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Action")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("SuspectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("SubjectId", "AppId", "At");
|
||||||
|
|
||||||
|
b.HasIndex("SuspectId");
|
||||||
|
|
||||||
|
b.ToTable("AppSubjectRelationVersion", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("At")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Action")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("SuspectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("TenantId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<string>("Visibility")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id", "At");
|
||||||
|
|
||||||
|
b.HasIndex("SuspectId");
|
||||||
|
|
||||||
|
b.ToTable("AppVersion", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("AppId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("InternalAuthorityId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("SubjectId", "AppId", "InternalAuthorityId");
|
||||||
|
|
||||||
|
b.HasIndex("InternalAuthorityId");
|
||||||
|
|
||||||
|
b.ToTable("AppSubjectRelationInternalAuthorityRelation", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("AppId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("InternalAuthorityId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("At")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Action")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("SuspectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("SubjectId", "AppId", "InternalAuthorityId", "At");
|
||||||
|
|
||||||
|
b.HasIndex("SuspectId");
|
||||||
|
|
||||||
|
b.ToTable("AppSubjectRelationInternalAuthorityRelationVersion", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.AuthCodeEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Algorithm")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Challenge")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Code")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("Expiration")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<bool>("IsRevoked")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("AuthCode", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.AuthorityEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Type")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("Name")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("Authority", "gr");
|
||||||
|
|
||||||
|
b.HasData(
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = 1L,
|
||||||
|
Description = "Allows users to read tenants",
|
||||||
|
Name = "Tenant_Read",
|
||||||
|
Type = "Tenant"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = 2L,
|
||||||
|
Description = "Allows users to read apps",
|
||||||
|
Name = "App_Read",
|
||||||
|
Type = "App"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("TenantId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("InternalAuthorityId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("SubjectId", "TenantId", "InternalAuthorityId");
|
||||||
|
|
||||||
|
b.HasIndex("InternalAuthorityId");
|
||||||
|
|
||||||
|
b.ToTable("TenantSubjectRelationInternalAuthorityRelation", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("TenantId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("InternalAuthorityId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("At")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Action")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("SuspectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("SubjectId", "TenantId", "InternalAuthorityId", "At");
|
||||||
|
|
||||||
|
b.HasIndex("SuspectId");
|
||||||
|
|
||||||
|
b.ToTable("TenantSubjectRelationInternalAuthorityRelationVersion", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.TokenMetadataEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("Expiration")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<bool>("IsRevoked")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("TokenType")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("UsedBy")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("TokenMetadata", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SignIn.SignInEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("IsLegacy")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("Method")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("PasswordHash")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<string>("Visibility")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("Email")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.HasIndex("SubjectId");
|
||||||
|
|
||||||
|
b.ToTable("SignIn", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Visibility")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("Name")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
|
b.ToTable("Subject", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("OwnerId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<string>("Visibility")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("OwnerId");
|
||||||
|
|
||||||
|
b.ToTable("Tenant", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantSubjectRelationEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("TenantId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("SubjectId", "TenantId");
|
||||||
|
|
||||||
|
b.HasIndex("TenantId");
|
||||||
|
|
||||||
|
b.ToTable("TenantSubjectRelation", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantSubjectRelationVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("TenantId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("At")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Action")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("SuspectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("SubjectId", "TenantId", "At");
|
||||||
|
|
||||||
|
b.HasIndex("SuspectId");
|
||||||
|
|
||||||
|
b.ToTable("TenantSubjectRelationVersion", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("At")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Action")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("OwnerId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("SuspectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<string>("Visibility")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id", "At");
|
||||||
|
|
||||||
|
b.HasIndex("SuspectId");
|
||||||
|
|
||||||
|
b.ToTable("TenantVersion", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantEntity", "Tenant")
|
||||||
|
.WithMany("Apps")
|
||||||
|
.HasForeignKey("TenantId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Tenant");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppSubjectRelationEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.App.AppEntity", "App")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("AppId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Subject")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SubjectId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("App");
|
||||||
|
|
||||||
|
b.Navigation("Subject");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppSubjectRelationVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Suspect")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SuspectId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.App.AppSubjectRelationEntity", "Reference")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SubjectId", "AppId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Reference");
|
||||||
|
|
||||||
|
b.Navigation("Suspect");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.App.AppEntity", "Reference")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("Id")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Suspect")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SuspectId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Reference");
|
||||||
|
|
||||||
|
b.Navigation("Suspect");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Security.AuthorityEntity", "InternalAuthority")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("InternalAuthorityId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.App.AppSubjectRelationEntity", "AppSubjectRelation")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SubjectId", "AppId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("AppSubjectRelation");
|
||||||
|
|
||||||
|
b.Navigation("InternalAuthority");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Suspect")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SuspectId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationEntity", "Reference")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SubjectId", "AppId", "InternalAuthorityId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Reference");
|
||||||
|
|
||||||
|
b.Navigation("Suspect");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Security.AuthorityEntity", "InternalAuthority")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("InternalAuthorityId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantSubjectRelationEntity", "TenantSubjectRelation")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SubjectId", "TenantId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("InternalAuthority");
|
||||||
|
|
||||||
|
b.Navigation("TenantSubjectRelation");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Suspect")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SuspectId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationEntity", "Reference")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SubjectId", "TenantId", "InternalAuthorityId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Reference");
|
||||||
|
|
||||||
|
b.Navigation("Suspect");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SignIn.SignInEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Subject")
|
||||||
|
.WithMany("SignInMethods")
|
||||||
|
.HasForeignKey("SubjectId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Subject");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Owner")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("OwnerId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Owner");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantSubjectRelationEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Subject")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SubjectId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantEntity", "Tenant")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("TenantId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Subject");
|
||||||
|
|
||||||
|
b.Navigation("Tenant");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantSubjectRelationVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Suspect")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SuspectId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantSubjectRelationEntity", "Reference")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SubjectId", "TenantId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Reference");
|
||||||
|
|
||||||
|
b.Navigation("Suspect");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantEntity", "Reference")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("Id")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Suspect")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SuspectId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Reference");
|
||||||
|
|
||||||
|
b.Navigation("Suspect");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("SignInMethods");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantEntity", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Apps");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,230 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace W542.GandalfReborn.Data.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class cringe2 : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_AppRelation_Tenant_TenantId",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppRelation");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_AppRelationVersion_AppRelation_Id",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppRelationVersion");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_AppRelationVersion_Subject_SuspectId",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppRelationVersion");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_AppSubjectRelation_AppRelation_AppId",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppSubjectRelation");
|
||||||
|
|
||||||
|
migrationBuilder.DropPrimaryKey(
|
||||||
|
name: "PK_AppRelationVersion",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppRelationVersion");
|
||||||
|
|
||||||
|
migrationBuilder.DropPrimaryKey(
|
||||||
|
name: "PK_AppRelation",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppRelation");
|
||||||
|
|
||||||
|
migrationBuilder.RenameTable(
|
||||||
|
name: "AppRelationVersion",
|
||||||
|
schema: "gr",
|
||||||
|
newName: "AppVersion",
|
||||||
|
newSchema: "gr");
|
||||||
|
|
||||||
|
migrationBuilder.RenameTable(
|
||||||
|
name: "AppRelation",
|
||||||
|
schema: "gr",
|
||||||
|
newName: "App",
|
||||||
|
newSchema: "gr");
|
||||||
|
|
||||||
|
migrationBuilder.RenameIndex(
|
||||||
|
name: "IX_AppRelationVersion_SuspectId",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppVersion",
|
||||||
|
newName: "IX_AppVersion_SuspectId");
|
||||||
|
|
||||||
|
migrationBuilder.RenameIndex(
|
||||||
|
name: "IX_AppRelation_TenantId",
|
||||||
|
schema: "gr",
|
||||||
|
table: "App",
|
||||||
|
newName: "IX_App_TenantId");
|
||||||
|
|
||||||
|
migrationBuilder.AddPrimaryKey(
|
||||||
|
name: "PK_AppVersion",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppVersion",
|
||||||
|
columns: new[] { "Id", "At" });
|
||||||
|
|
||||||
|
migrationBuilder.AddPrimaryKey(
|
||||||
|
name: "PK_App",
|
||||||
|
schema: "gr",
|
||||||
|
table: "App",
|
||||||
|
column: "Id");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_App_Tenant_TenantId",
|
||||||
|
schema: "gr",
|
||||||
|
table: "App",
|
||||||
|
column: "TenantId",
|
||||||
|
principalSchema: "gr",
|
||||||
|
principalTable: "Tenant",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_AppSubjectRelation_App_AppId",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppSubjectRelation",
|
||||||
|
column: "AppId",
|
||||||
|
principalSchema: "gr",
|
||||||
|
principalTable: "App",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_AppVersion_App_Id",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppVersion",
|
||||||
|
column: "Id",
|
||||||
|
principalSchema: "gr",
|
||||||
|
principalTable: "App",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_AppVersion_Subject_SuspectId",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppVersion",
|
||||||
|
column: "SuspectId",
|
||||||
|
principalSchema: "gr",
|
||||||
|
principalTable: "Subject",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_App_Tenant_TenantId",
|
||||||
|
schema: "gr",
|
||||||
|
table: "App");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_AppSubjectRelation_App_AppId",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppSubjectRelation");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_AppVersion_App_Id",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppVersion");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_AppVersion_Subject_SuspectId",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppVersion");
|
||||||
|
|
||||||
|
migrationBuilder.DropPrimaryKey(
|
||||||
|
name: "PK_AppVersion",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppVersion");
|
||||||
|
|
||||||
|
migrationBuilder.DropPrimaryKey(
|
||||||
|
name: "PK_App",
|
||||||
|
schema: "gr",
|
||||||
|
table: "App");
|
||||||
|
|
||||||
|
migrationBuilder.RenameTable(
|
||||||
|
name: "AppVersion",
|
||||||
|
schema: "gr",
|
||||||
|
newName: "AppRelationVersion",
|
||||||
|
newSchema: "gr");
|
||||||
|
|
||||||
|
migrationBuilder.RenameTable(
|
||||||
|
name: "App",
|
||||||
|
schema: "gr",
|
||||||
|
newName: "AppRelation",
|
||||||
|
newSchema: "gr");
|
||||||
|
|
||||||
|
migrationBuilder.RenameIndex(
|
||||||
|
name: "IX_AppVersion_SuspectId",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppRelationVersion",
|
||||||
|
newName: "IX_AppRelationVersion_SuspectId");
|
||||||
|
|
||||||
|
migrationBuilder.RenameIndex(
|
||||||
|
name: "IX_App_TenantId",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppRelation",
|
||||||
|
newName: "IX_AppRelation_TenantId");
|
||||||
|
|
||||||
|
migrationBuilder.AddPrimaryKey(
|
||||||
|
name: "PK_AppRelationVersion",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppRelationVersion",
|
||||||
|
columns: new[] { "Id", "At" });
|
||||||
|
|
||||||
|
migrationBuilder.AddPrimaryKey(
|
||||||
|
name: "PK_AppRelation",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppRelation",
|
||||||
|
column: "Id");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_AppRelation_Tenant_TenantId",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppRelation",
|
||||||
|
column: "TenantId",
|
||||||
|
principalSchema: "gr",
|
||||||
|
principalTable: "Tenant",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_AppRelationVersion_AppRelation_Id",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppRelationVersion",
|
||||||
|
column: "Id",
|
||||||
|
principalSchema: "gr",
|
||||||
|
principalTable: "AppRelation",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_AppRelationVersion_Subject_SuspectId",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppRelationVersion",
|
||||||
|
column: "SuspectId",
|
||||||
|
principalSchema: "gr",
|
||||||
|
principalTable: "Subject",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_AppSubjectRelation_AppRelation_AppId",
|
||||||
|
schema: "gr",
|
||||||
|
table: "AppSubjectRelation",
|
||||||
|
column: "AppId",
|
||||||
|
principalSchema: "gr",
|
||||||
|
principalTable: "AppRelation",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -17,18 +17,18 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
{
|
{
|
||||||
#pragma warning disable 612, 618
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasAnnotation("ProductVersion", "8.0.8")
|
.HasAnnotation("ProductVersion", "9.0.2")
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.App.AppRelationEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppEntity", b =>
|
||||||
{
|
{
|
||||||
b.Property<long?>("Id")
|
b.Property<long>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long?>("Id"));
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
@ -45,12 +45,52 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
|
|
||||||
b.HasIndex("TenantId");
|
b.HasIndex("TenantId");
|
||||||
|
|
||||||
b.ToTable("AppRelation", "gr");
|
b.ToTable("App", "gr");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.App.AppRelationVersionEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppSubjectRelationEntity", b =>
|
||||||
{
|
{
|
||||||
b.Property<long?>("Id")
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("AppId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("SubjectId", "AppId");
|
||||||
|
|
||||||
|
b.HasIndex("AppId");
|
||||||
|
|
||||||
|
b.ToTable("AppSubjectRelation", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppSubjectRelationVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("SubjectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("AppId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("At")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("Action")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("SuspectId")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("SubjectId", "AppId", "At");
|
||||||
|
|
||||||
|
b.HasIndex("SuspectId");
|
||||||
|
|
||||||
|
b.ToTable("AppSubjectRelationVersion", "gr");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppVersionEntity", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("At")
|
b.Property<DateTimeOffset>("At")
|
||||||
@ -78,50 +118,10 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
|
|
||||||
b.HasIndex("SuspectId");
|
b.HasIndex("SuspectId");
|
||||||
|
|
||||||
b.ToTable("AppRelationVersion", "gr");
|
b.ToTable("AppVersion", "gr");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.App.AppSubjectRelationEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationEntity", b =>
|
||||||
{
|
|
||||||
b.Property<long>("SubjectId")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<long>("AppId")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.HasKey("SubjectId", "AppId");
|
|
||||||
|
|
||||||
b.HasIndex("AppId");
|
|
||||||
|
|
||||||
b.ToTable("AppSubjectRelation", "gr");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.App.AppSubjectRelationVersionEntity", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("SubjectId")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<long>("AppId")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("At")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Action")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<long>("SuspectId")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.HasKey("SubjectId", "AppId", "At");
|
|
||||||
|
|
||||||
b.HasIndex("SuspectId");
|
|
||||||
|
|
||||||
b.ToTable("AppSubjectRelationVersion", "gr");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationEntity", b =>
|
|
||||||
{
|
{
|
||||||
b.Property<long>("SubjectId")
|
b.Property<long>("SubjectId")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
@ -139,7 +139,7 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.ToTable("AppSubjectRelationInternalAuthorityRelation", "gr");
|
b.ToTable("AppSubjectRelationInternalAuthorityRelation", "gr");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationVersionEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationVersionEntity", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("SubjectId")
|
b.Property<long>("SubjectId")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
@ -167,13 +167,13 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.ToTable("AppSubjectRelationInternalAuthorityRelationVersion", "gr");
|
b.ToTable("AppSubjectRelationInternalAuthorityRelationVersion", "gr");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Security.AuthCodeEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.AuthCodeEntity", b =>
|
||||||
{
|
{
|
||||||
b.Property<long?>("Id")
|
b.Property<long>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long?>("Id"));
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
b.Property<string>("Algorithm")
|
b.Property<string>("Algorithm")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
@ -201,13 +201,13 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.ToTable("AuthCode", "gr");
|
b.ToTable("AuthCode", "gr");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Security.AuthorityEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.AuthorityEntity", b =>
|
||||||
{
|
{
|
||||||
b.Property<long?>("Id")
|
b.Property<long>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long?>("Id"));
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
b.Property<string>("Description")
|
b.Property<string>("Description")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
@ -244,7 +244,7 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationEntity", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("SubjectId")
|
b.Property<long>("SubjectId")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
@ -262,7 +262,7 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.ToTable("TenantSubjectRelationInternalAuthorityRelation", "gr");
|
b.ToTable("TenantSubjectRelationInternalAuthorityRelation", "gr");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationVersionEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationVersionEntity", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("SubjectId")
|
b.Property<long>("SubjectId")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
@ -290,13 +290,13 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.ToTable("TenantSubjectRelationInternalAuthorityRelationVersion", "gr");
|
b.ToTable("TenantSubjectRelationInternalAuthorityRelationVersion", "gr");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Security.TokenMetadataEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.TokenMetadataEntity", b =>
|
||||||
{
|
{
|
||||||
b.Property<long?>("Id")
|
b.Property<long>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long?>("Id"));
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("Expiration")
|
b.Property<DateTimeOffset>("Expiration")
|
||||||
.HasColumnType("timestamp with time zone");
|
.HasColumnType("timestamp with time zone");
|
||||||
@ -316,13 +316,13 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.ToTable("TokenMetadata", "gr");
|
b.ToTable("TokenMetadata", "gr");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Subject.SignIn.SignInEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SignIn.SignInEntity", b =>
|
||||||
{
|
{
|
||||||
b.Property<long?>("Id")
|
b.Property<long>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long?>("Id"));
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
b.Property<string>("Email")
|
b.Property<string>("Email")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
@ -354,13 +354,13 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.ToTable("SignIn", "gr");
|
b.ToTable("SignIn", "gr");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Subject.SubjectEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", b =>
|
||||||
{
|
{
|
||||||
b.Property<long?>("Id")
|
b.Property<long>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long?>("Id"));
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
@ -376,23 +376,15 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("Subject", "gr");
|
b.ToTable("Subject", "gr");
|
||||||
|
|
||||||
b.HasData(
|
|
||||||
new
|
|
||||||
{
|
|
||||||
Id = 1L,
|
|
||||||
Name = "chris",
|
|
||||||
Visibility = "Active"
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Tenant.TenantEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantEntity", b =>
|
||||||
{
|
{
|
||||||
b.Property<long?>("Id")
|
b.Property<long>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long?>("Id"));
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
@ -412,7 +404,7 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.ToTable("Tenant", "gr");
|
b.ToTable("Tenant", "gr");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Tenant.TenantSubjectRelationEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantSubjectRelationEntity", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("SubjectId")
|
b.Property<long>("SubjectId")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
@ -427,7 +419,7 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.ToTable("TenantSubjectRelation", "gr");
|
b.ToTable("TenantSubjectRelation", "gr");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Tenant.TenantSubjectRelationVersionEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantSubjectRelationVersionEntity", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("SubjectId")
|
b.Property<long>("SubjectId")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
@ -452,9 +444,9 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.ToTable("TenantSubjectRelationVersion", "gr");
|
b.ToTable("TenantSubjectRelationVersion", "gr");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Tenant.TenantVersionEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantVersionEntity", b =>
|
||||||
{
|
{
|
||||||
b.Property<long?>("Id")
|
b.Property<long>("Id")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("At")
|
b.Property<DateTimeOffset>("At")
|
||||||
@ -485,9 +477,9 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.ToTable("TenantVersion", "gr");
|
b.ToTable("TenantVersion", "gr");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.App.AppRelationEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppEntity", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.Tenant.TenantEntity", "Tenant")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantEntity", "Tenant")
|
||||||
.WithMany("Apps")
|
.WithMany("Apps")
|
||||||
.HasForeignKey("TenantId")
|
.HasForeignKey("TenantId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
@ -496,34 +488,15 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.Navigation("Tenant");
|
b.Navigation("Tenant");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.App.AppRelationVersionEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppSubjectRelationEntity", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.App.AppRelationEntity", "Reference")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.App.AppEntity", "App")
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("Id")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.Subject.SubjectEntity", "Suspect")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("SuspectId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Reference");
|
|
||||||
|
|
||||||
b.Navigation("Suspect");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.App.AppSubjectRelationEntity", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.App.AppRelationEntity", "App")
|
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("AppId")
|
.HasForeignKey("AppId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.Subject.SubjectEntity", "Subject")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Subject")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("SubjectId")
|
.HasForeignKey("SubjectId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
@ -534,15 +507,15 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.Navigation("Subject");
|
b.Navigation("Subject");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.App.AppSubjectRelationVersionEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppSubjectRelationVersionEntity", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.Subject.SubjectEntity", "Suspect")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Suspect")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("SuspectId")
|
.HasForeignKey("SuspectId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.App.AppSubjectRelationEntity", "Reference")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.App.AppSubjectRelationEntity", "Reference")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("SubjectId", "AppId")
|
.HasForeignKey("SubjectId", "AppId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
@ -553,15 +526,34 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.Navigation("Suspect");
|
b.Navigation("Suspect");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.App.AppVersionEntity", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.Security.AuthorityEntity", "InternalAuthority")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.App.AppEntity", "Reference")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("Id")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Suspect")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SuspectId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Reference");
|
||||||
|
|
||||||
|
b.Navigation("Suspect");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationEntity", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Security.AuthorityEntity", "InternalAuthority")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("InternalAuthorityId")
|
.HasForeignKey("InternalAuthorityId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.App.AppSubjectRelationEntity", "AppSubjectRelation")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.App.AppSubjectRelationEntity", "AppSubjectRelation")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("SubjectId", "AppId")
|
.HasForeignKey("SubjectId", "AppId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
@ -572,15 +564,15 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.Navigation("InternalAuthority");
|
b.Navigation("InternalAuthority");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationVersionEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationVersionEntity", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.Subject.SubjectEntity", "Suspect")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Suspect")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("SuspectId")
|
.HasForeignKey("SuspectId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationEntity", "Reference")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Security.AppSubjectRelationInternalAuthorityRelationEntity", "Reference")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("SubjectId", "AppId", "InternalAuthorityId")
|
.HasForeignKey("SubjectId", "AppId", "InternalAuthorityId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
@ -591,15 +583,15 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.Navigation("Suspect");
|
b.Navigation("Suspect");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationEntity", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.Security.AuthorityEntity", "InternalAuthority")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Security.AuthorityEntity", "InternalAuthority")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("InternalAuthorityId")
|
.HasForeignKey("InternalAuthorityId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.Tenant.TenantSubjectRelationEntity", "TenantSubjectRelation")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantSubjectRelationEntity", "TenantSubjectRelation")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("SubjectId", "TenantId")
|
.HasForeignKey("SubjectId", "TenantId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
@ -610,15 +602,15 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.Navigation("TenantSubjectRelation");
|
b.Navigation("TenantSubjectRelation");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationVersionEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationVersionEntity", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.Subject.SubjectEntity", "Suspect")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Suspect")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("SuspectId")
|
.HasForeignKey("SuspectId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationEntity", "Reference")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Security.TenantSubjectRelationInternalAuthorityRelationEntity", "Reference")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("SubjectId", "TenantId", "InternalAuthorityId")
|
.HasForeignKey("SubjectId", "TenantId", "InternalAuthorityId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
@ -629,9 +621,9 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.Navigation("Suspect");
|
b.Navigation("Suspect");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Subject.SignIn.SignInEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SignIn.SignInEntity", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.Subject.SubjectEntity", "Subject")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Subject")
|
||||||
.WithMany("SignInMethods")
|
.WithMany("SignInMethods")
|
||||||
.HasForeignKey("SubjectId")
|
.HasForeignKey("SubjectId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
@ -640,9 +632,9 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.Navigation("Subject");
|
b.Navigation("Subject");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Tenant.TenantEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantEntity", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.Subject.SubjectEntity", "Owner")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Owner")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("OwnerId")
|
.HasForeignKey("OwnerId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
@ -651,15 +643,15 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.Navigation("Owner");
|
b.Navigation("Owner");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Tenant.TenantSubjectRelationEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantSubjectRelationEntity", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.Subject.SubjectEntity", "Subject")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Subject")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("SubjectId")
|
.HasForeignKey("SubjectId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.Tenant.TenantEntity", "Tenant")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantEntity", "Tenant")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("TenantId")
|
.HasForeignKey("TenantId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
@ -670,15 +662,15 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.Navigation("Tenant");
|
b.Navigation("Tenant");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Tenant.TenantSubjectRelationVersionEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantSubjectRelationVersionEntity", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.Subject.SubjectEntity", "Suspect")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Suspect")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("SuspectId")
|
.HasForeignKey("SuspectId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.Tenant.TenantSubjectRelationEntity", "Reference")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantSubjectRelationEntity", "Reference")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("SubjectId", "TenantId")
|
.HasForeignKey("SubjectId", "TenantId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
@ -689,15 +681,15 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.Navigation("Suspect");
|
b.Navigation("Suspect");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Tenant.TenantVersionEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantVersionEntity", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.Tenant.TenantEntity", "Reference")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantEntity", "Reference")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("Id")
|
.HasForeignKey("Id")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("W542.GandalfReborn.Data.Entities.Subject.SubjectEntity", "Suspect")
|
b.HasOne("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", "Suspect")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("SuspectId")
|
.HasForeignKey("SuspectId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
@ -708,12 +700,12 @@ namespace W542.GandalfReborn.Data.Migrations
|
|||||||
b.Navigation("Suspect");
|
b.Navigation("Suspect");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Subject.SubjectEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SubjectEntity", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("SignInMethods");
|
b.Navigation("SignInMethods");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("W542.GandalfReborn.Data.Entities.Tenant.TenantEntity", b =>
|
modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Tenant.TenantEntity", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Apps");
|
b.Navigation("Apps");
|
||||||
});
|
});
|
||||||
|
|||||||
28
src/obj/Data.EntityFrameworkCore.targets
Normal file
28
src/obj/Data.EntityFrameworkCore.targets
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Target Name="GetEFProjectMetadata">
|
||||||
|
<MSBuild Condition=" '$(TargetFramework)' == '' "
|
||||||
|
Projects="$(MSBuildProjectFile)"
|
||||||
|
Targets="GetEFProjectMetadata"
|
||||||
|
Properties="TargetFramework=$(TargetFrameworks.Split(';')[0]);EFProjectMetadataFile=$(EFProjectMetadataFile)" />
|
||||||
|
<ItemGroup Condition=" '$(TargetFramework)' != '' ">
|
||||||
|
<EFProjectMetadata Include="AssemblyName: $(AssemblyName)" />
|
||||||
|
<EFProjectMetadata Include="Language: $(Language)" />
|
||||||
|
<EFProjectMetadata Include="OutputPath: $(OutputPath)" />
|
||||||
|
<EFProjectMetadata Include="Platform: $(Platform)" />
|
||||||
|
<EFProjectMetadata Include="PlatformTarget: $(PlatformTarget)" />
|
||||||
|
<EFProjectMetadata Include="ProjectAssetsFile: $(ProjectAssetsFile)" />
|
||||||
|
<EFProjectMetadata Include="ProjectDir: $(ProjectDir)" />
|
||||||
|
<EFProjectMetadata Include="RootNamespace: $(RootNamespace)" />
|
||||||
|
<EFProjectMetadata Include="RuntimeFrameworkVersion: $(RuntimeFrameworkVersion)" />
|
||||||
|
<EFProjectMetadata Include="TargetFileName: $(TargetFileName)" />
|
||||||
|
<EFProjectMetadata Include="TargetFrameworkMoniker: $(TargetFrameworkMoniker)" />
|
||||||
|
<EFProjectMetadata Include="Nullable: $(Nullable)" />
|
||||||
|
<EFProjectMetadata Include="TargetFramework: $(TargetFramework)" />
|
||||||
|
<EFProjectMetadata Include="TargetPlatformIdentifier: $(TargetPlatformIdentifier)" />
|
||||||
|
</ItemGroup>
|
||||||
|
<WriteLinesToFile Condition=" '$(TargetFramework)' != '' "
|
||||||
|
File="$(EFProjectMetadataFile)"
|
||||||
|
Lines="@(EFProjectMetadata)" />
|
||||||
|
</Target>
|
||||||
|
</Project>
|
||||||
Loading…
x
Reference in New Issue
Block a user