-
Notifications
You must be signed in to change notification settings - Fork 23
fix: better error handling in auth_provider, added create_patient_table.sql #93
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
base: main
Are you sure you want to change the base?
Conversation
Fixing minor issue caused due to supabase_auth_repository.dart
Only one id column is needed that is patient_id
| @@ -0,0 +1,37 @@ | |||
| -- Create patient table if it does not exist | |||
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.
can we have a similar thing for first time setup? I don't think running this file will setup all the tables, it will only create a patient table. Maybe have all the tables with the exact schema so that we can run a command to setup all the tables?
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.
You're absolutely right—this file currently sets up only the patient table. We can extend it to include all tables with their exact schemas to ensure a complete first-time setup. I'll update the script to create all necessary tables so that a single command initializes the entire database. Let me know if you have any specific requirements or constraints for the schema.
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.
That would be great! No specific requirements or constraints as long as it's the same as the schema file
|
@mdmohsin7 Sorry about the mention, please review the changes. |
| ); | ||
|
|
||
| -- Create assessment_questions table if it does not exist | ||
| CREATE TABLE IF NOT EXISTS public.assessment_questions ( |
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.
I don't think we have assessment_questions and assessment_options tables. Pls check the schema file once
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.
You're absolutely right—I overlooked that. Apologies for the confusion, and thank you for pointing it out. I’ll fix it shortly.
|
Hi @mdmohsin7 , It seems the best solution is to switch the illustrations to PNG format. With your permission, can I go ahead and make this change within the same PR? Thanks for your time and sorry for the mistake! |
|
No worries @TriptiMirani, if they don't work in svg, you can use png, and personally I suggest doing them in a new PR |
Basic fixes for patient app Added Dummy data
Closes #87
📝 Description
This PR fixes an issue where users encountered an error after signing in with Google because the
patienttable was missing in Supabase. Previously, after a successful Google Sign-In, users saw:✅ "Signed in as FirstName LastName" (Success message)
❌ "An error occurred, please try again." (Failure message due to missing database table)
The root cause of this issue was the
patienttable not being created automatically in new deployments, leading to a PostgrestException (relation does not exist - SQLSTATE 42P01) when checking if a patient exists.This PR ensures that the database schema is set up automatically using Supabase migrations, so developers no longer need to manually create the
patienttable.🔧 Changes Made
patienttable automatically.checkIfPatientExists()function to handle missing table errors gracefully.📷 Screenshots or Visual Changes (if applicable)
✅ Before (Error in Logs & Red Pop-Up Message):
❌ "An error occurred, please try again."
✅ After (Database Auto-Creation & Fix Applied):
🎉 No error pop-ups! The app correctly proceeds to the next screen.
✅ Standard Database Schema created in Supabase.
🤝 Collaboration
None
✅ Checklist
✨ Final Notes
This PR improves the developer experience by making database setup seamless and ensures a smooth onboarding process for new contributors.