New to using a database, need guidance/help #22026
Unanswered
JamesSingleton
asked this question in
Questions
Replies: 1 comment
-
You don't need auth info in a public user table. Supabase will handle logins/passwords etc. EDIT this assume you planned to use Supabase auth and don't already have an auth system. If you want some key info from that auth data you can use an insert trigger to copy out username, email and their user id to your public user table. I personally link my other tables (like your votes table) to my public users table (actually called profiles). Info on user management: https://supabase.com/docs/guides/auth/managing-user-data#using-triggers Not commenting or looking at your general table structure. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am going to start out by apologizing if this is the wrong place to ask for help, but I thought I would give it a shot here. I have a website for college football news and use Sanity for all of my content and Next.js as the framework. However, I am getting to a point where I need a DB for content that I want to add to the website.
I need to add a route that is protected that will allow people to log in and vote for their Top 25 teams each week of the season which would eventually show on the website like this:
I also want to be able to break it down for which voter votes for which team, something like this:
I have started the process of creating a new project in Supabase and will be using Drizzle ORM and I am currently at the part of needing to create tables. This is where I am struggling as I don't want to mess up. I will be using Clerk for my auth, so I don't think I need to worry about that. However, I don't know what that table should look like or if that is automatically created somehow. Anyways... this is what I have kind of come up with:
I will be pulling in the teams from my Sanity CMS and storing the ID for each team for that specific team ID, I think that should work, but no 100%. Am I on the right track here? Am I missing something? One thing that I am kind of unsure about is adding the individual teams to the
votes
table. I want the team's name along with their logo (url from sanity) stored when they vote. However, I wasn't sure if creating ateams
table would be appropriate as I have them stored in Sanity and feel like that would be duplicating the effort?Beta Was this translation helpful? Give feedback.
All reactions