From bda1e81c87a34bc0e6d2ce805f706a726087e957 Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Sun, 30 Jan 2022 01:30:58 +0100 Subject: feat: WIP: Map github logins When github is used for login, we want to create a mapping to a regular user in our database. This is mainly so that we don't have to change the PK in our database or add a column to it. --- src/server/Migrations/AppDbContextModelSnapshot.cs | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'src/server/Migrations/AppDbContextModelSnapshot.cs') diff --git a/src/server/Migrations/AppDbContextModelSnapshot.cs b/src/server/Migrations/AppDbContextModelSnapshot.cs index c48f478..8e55e15 100644 --- a/src/server/Migrations/AppDbContextModelSnapshot.cs +++ b/src/server/Migrations/AppDbContextModelSnapshot.cs @@ -99,6 +99,34 @@ namespace IOL.BookmarkThing.Server.Migrations b.ToTable("entries", (string)null); }); + modelBuilder.Entity("IOL.BookmarkThing.Server.Models.Database.GithubUserMapping", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("Created") + .HasColumnType("timestamp with time zone") + .HasColumnName("created"); + + b.Property("GithubId") + .HasColumnType("text") + .HasColumnName("github_id"); + + b.Property("UserId") + .HasColumnType("uuid") + .HasColumnName("user_id"); + + b.HasKey("Id") + .HasName("pk_github_user_mappings"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_github_user_mappings_user_id"); + + b.ToTable("github_user_mappings", (string)null); + }); + modelBuilder.Entity("IOL.BookmarkThing.Server.Models.Database.User", b => { b.Property("Id") @@ -133,6 +161,16 @@ namespace IOL.BookmarkThing.Server.Migrations b.Navigation("User"); }); + + modelBuilder.Entity("IOL.BookmarkThing.Server.Models.Database.GithubUserMapping", b => + { + b.HasOne("IOL.BookmarkThing.Server.Models.Database.User", "User") + .WithMany() + .HasForeignKey("UserId") + .HasConstraintName("fk_github_user_mappings_users_user_id"); + + b.Navigation("User"); + }); #pragma warning restore 612, 618 } } -- cgit v1.3