// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; 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))] partial class ApplicationContextModelSnapshot : ModelSnapshot { protected override void BuildModel(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("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("TenantId") .HasColumnType("bigint"); b.Property("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("SubjectId") .HasColumnType("bigint"); b.Property("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("SubjectId") .HasColumnType("bigint"); b.Property("AppId") .HasColumnType("bigint"); b.Property("At") .HasColumnType("timestamp with time zone"); b.Property("Action") .IsRequired() .HasColumnType("text"); b.Property("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("Id") .HasColumnType("bigint"); b.Property("At") .HasColumnType("timestamp with time zone"); b.Property("Action") .IsRequired() .HasColumnType("text"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("SuspectId") .HasColumnType("bigint"); b.Property("TenantId") .HasColumnType("bigint"); b.Property("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("SubjectId") .HasColumnType("bigint"); b.Property("AppId") .HasColumnType("bigint"); b.Property("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("SubjectId") .HasColumnType("bigint"); b.Property("AppId") .HasColumnType("bigint"); b.Property("InternalAuthorityId") .HasColumnType("bigint"); b.Property("At") .HasColumnType("timestamp with time zone"); b.Property("Action") .IsRequired() .HasColumnType("text"); b.Property("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("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Algorithm") .IsRequired() .HasColumnType("text"); b.Property("Challenge") .IsRequired() .HasColumnType("text"); b.Property("Code") .IsRequired() .HasColumnType("text"); b.Property("Expiration") .HasColumnType("timestamp with time zone"); b.Property("IsRevoked") .HasColumnType("boolean"); b.Property("SubjectId") .HasColumnType("bigint"); b.HasKey("Id"); b.ToTable("AuthCode", "gr"); }); modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Security.AuthorityEntity", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Description") .HasColumnType("text"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("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("SubjectId") .HasColumnType("bigint"); b.Property("TenantId") .HasColumnType("bigint"); b.Property("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("SubjectId") .HasColumnType("bigint"); b.Property("TenantId") .HasColumnType("bigint"); b.Property("InternalAuthorityId") .HasColumnType("bigint"); b.Property("At") .HasColumnType("timestamp with time zone"); b.Property("Action") .IsRequired() .HasColumnType("text"); b.Property("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("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Expiration") .HasColumnType("timestamp with time zone"); b.Property("IsRevoked") .HasColumnType("boolean"); b.Property("TokenType") .IsRequired() .HasColumnType("text"); b.Property("UsedBy") .HasColumnType("bigint"); b.HasKey("Id"); b.ToTable("TokenMetadata", "gr"); }); modelBuilder.Entity("Suspectus.Gandalf.Palantir.Data.Entities.Subject.SignIn.SignInEntity", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Email") .HasColumnType("text"); b.Property("IsLegacy") .HasColumnType("boolean"); b.Property("Method") .IsRequired() .HasColumnType("text"); b.Property("PasswordHash") .HasColumnType("text"); b.Property("SubjectId") .HasColumnType("bigint"); b.Property("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("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("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("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("OwnerId") .HasColumnType("bigint"); b.Property("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("SubjectId") .HasColumnType("bigint"); b.Property("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("SubjectId") .HasColumnType("bigint"); b.Property("TenantId") .HasColumnType("bigint"); b.Property("At") .HasColumnType("timestamp with time zone"); b.Property("Action") .IsRequired() .HasColumnType("text"); b.Property("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("Id") .HasColumnType("bigint"); b.Property("At") .HasColumnType("timestamp with time zone"); b.Property("Action") .IsRequired() .HasColumnType("text"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("OwnerId") .HasColumnType("bigint"); b.Property("SuspectId") .HasColumnType("bigint"); b.Property("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 } } }