diff --git a/src/api/Migrations/BdmsContextModelSnapshot.cs b/src/api/Migrations/BdmsContextModelSnapshot.cs index 89088e599..6fabae528 100644 --- a/src/api/Migrations/BdmsContextModelSnapshot.cs +++ b/src/api/Migrations/BdmsContextModelSnapshot.cs @@ -1843,6 +1843,27 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("terms", "bdms"); }); + modelBuilder.Entity("BDMS.Models.TermsAccepted", b => + { + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("id_usr_fk"); + + b.Property("TermId") + .HasColumnType("integer") + .HasColumnName("id_tes_fk"); + + b.Property("AcceptedAt") + .HasColumnType("timestamp with time zone") + .HasColumnName("accepted_tea"); + + b.HasKey("UserId", "TermId"); + + b.HasIndex("TermId"); + + b.ToTable("terms_accepted", "bdms"); + }); + modelBuilder.Entity("BDMS.Models.User", b => { b.Property("Id") @@ -1852,6 +1873,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone") + .HasColumnName("created_usr"); + b.Property("DisabledAt") .HasColumnType("timestamp with time zone") .HasColumnName("disabled_usr"); @@ -1875,6 +1900,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("text") .HasColumnName("username"); + b.Property("Settings") + .HasColumnType("text") + .HasColumnName("settings_usr"); + b.Property("SubjectId") .IsRequired() .HasColumnType("text") @@ -1901,6 +1930,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("UserId", "WorkgroupId", "Role"); + b.HasIndex("WorkgroupId"); + b.ToTable("users_roles", "bdms"); }); @@ -1955,11 +1986,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Created") + b.Property("CreatedAt") .HasColumnType("timestamp with time zone") .HasColumnName("created_wgp"); - b.Property("Disabled") + b.Property("DisabledAt") .HasColumnType("timestamp with time zone") .HasColumnName("disabled_wgp"); @@ -3004,13 +3035,42 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("UpdatedBy"); }); + modelBuilder.Entity("BDMS.Models.TermsAccepted", b => + { + b.HasOne("BDMS.Models.Term", "Term") + .WithMany() + .HasForeignKey("TermId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("BDMS.Models.User", "User") + .WithMany("TermsAccepted") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Term"); + + b.Navigation("User"); + }); + modelBuilder.Entity("BDMS.Models.UserWorkgroupRole", b => { - b.HasOne("BDMS.Models.User", null) + b.HasOne("BDMS.Models.User", "User") .WithMany("WorkgroupRoles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); + + b.HasOne("BDMS.Models.Workgroup", "Workgroup") + .WithMany() + .HasForeignKey("WorkgroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + + b.Navigation("Workgroup"); }); modelBuilder.Entity("BDMS.Models.Workflow", b => @@ -3192,6 +3252,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("BDMS.Models.User", b => { + b.Navigation("TermsAccepted"); + b.Navigation("WorkgroupRoles"); });