This pull request includes significant changes to the database schema and the Supabase utility types. The most important changes involve updating the notification types to use an enum, adding a new notification type, and removing various foreign key relationships from the Supabase type definitions.
Database Schema Changes:
db/tables.sql: Added subscription_renewal to the notification_types enum.
Supabase Utility Types Changes:
utils/supabase/supabase.ts: Removed multiple foreign key relationships from various table definitions, such as chats, courses, enrollments, exam_scores, exam_submissions, exam_views, exercise_completions, exercises, grades, lesson_passed, lesson_views, lessons_ai_task_messages, notifications, profiles, reviews, submissions, subscriptions, ticket_messages, tickets, transactions, and user_roles. [1][2][3][4][5][6][7][8][9][10][11][12][13][14][15][16][17][18][19][20][21][22][23][24][25]
utils/supabase/supabase.ts: Updated the create_notification function to use the new notification_types enum.
db/sql-functions.sql: Updated the create_notification function to use the notification_types enum and explicitly cast the subscription_renewal notification type. [1][2]
This pull request includes significant changes to the database schema and the Supabase utility types. The most important changes involve updating the notification types to use an enum, adding a new notification type, and removing various foreign key relationships from the Supabase type definitions.
Database Schema Changes:
db/tables.sql
: Addedsubscription_renewal
to thenotification_types
enum.Supabase Utility Types Changes:
utils/supabase/supabase.ts
: Removed multiple foreign key relationships from various table definitions, such aschats
,courses
,enrollments
,exam_scores
,exam_submissions
,exam_views
,exercise_completions
,exercises
,grades
,lesson_passed
,lesson_views
,lessons_ai_task_messages
,notifications
,profiles
,reviews
,submissions
,subscriptions
,ticket_messages
,tickets
,transactions
, anduser_roles
. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25]utils/supabase/supabase.ts
: Updated thecreate_notification
function to use the newnotification_types
enum.utils/supabase/supabase.ts
: Addedsubscription_renewal
to thenotification_types
enum.utils/supabase/supabase.ts
: Added a newCompositeTypes
type definition.SQL Function Changes:
db/sql-functions.sql
: Updated thecreate_notification
function to use thenotification_types
enum and explicitly cast thesubscription_renewal
notification type. [1] [2]