-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add schema public.attendees #178
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f45ac28
add schema public.attendees
KannoStanfoot 4c14154
:feat remove NOT NULL constraint from display_name column on attendees
KannoStanfoot 85177a4
:fix fix schema typo
KannoStanfoot d0d8774
feat(schema): update Supabase type definitions
KannoStanfoot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ASK
display_name に NOT NULL 制約が入っていますが、
ソーシャルログインして取得され得る名前が初期値として入る想定で OK でしょうか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jiyuujin
初回ログイン時は確かに display_name に初期値を入れないと空の状態ですね。失念していました。
となるとavatar_url は初期画像が入るので良いとして、receipt_idも今のままだと問題ですかね。
調べてみたところPostgreSQLのUNIQUEはnullを無視するようなので、receipt_idからもNOT NULL 制約を削除した方が良さそうでしょうか。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vue Fes 2023 の例ですが、ソーシャルログインしたら
user?.user_metadata.preferred_username || user?.user_metadata.name || ''
を設定いただければ、初期値は設定されます(ただし、空白値を許容しているので、NOT NULL 削除は無難かも?
https://github.com/vuejs-jp/vuefes-2023/blob/main/app/composables/useAuth.ts#L66
結論からいうと今のまま NOT NULL 制約を付けていただいて問題ありません
その理由は public.attendees の更新のタイミングにあります。ソーシャルログインしただけですと auth.users という別テーブル(Supbase プロジェクトを作成して、最初から存在する内部テーブル)が更新されるだけにとどまります
では、public.attendees の更新のタイミングはいつ生まれるのか。それは、ネームカード追加(あるいは、編集)画面で更新する際に、public.attendees の更新のタイミングがあるので、その際は receipt_id に NOT NULL 制約を付けておけば必ず何かしら入力しないと通らなくなります
こんな感じの説明で理解 OK ですかね?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jiyuujin
ありがとうございます。理解しました。
display_nameのNOT NULL制約を削除したコミットをpushしました。