Skip to content

Commit 2e22aae

Browse files
chore(payments): regenerate database.types.ts fully against cloud
Fixes pre-existing type drift unrelated to any migration in this branch — the checked-in types file was stale relative to migrations already deployed to both local and cloud: adds lessons.transcript, subscriptions.superseded_by (+ FK), the user_ui_state table, and the change_subscription_plan RPC return shape; removes the handle_manual_subscription_expiry function type (dropped by migration 20260719120000/20260719130000, confirmed no live callers — the app-layer cron at app/api/cron/expire-platform-subscriptions/route.ts replaced it). Also picks up the current typegen format (adds __InternalSupabase version marker, drops the empty graphql_public schema block) — nothing in the codebase references graphql_public. npm run typecheck, lint, and build all pass clean. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CcZgbBpQtpKipPwQq38EjT
1 parent e3dd614 commit 2e22aae

1 file changed

Lines changed: 70 additions & 29 deletions

File tree

lib/database.types.ts

Lines changed: 70 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,10 @@ export type Json =
77
| Json[]
88

99
export type Database = {
10-
graphql_public: {
11-
Tables: {
12-
[_ in never]: never
13-
}
14-
Views: {
15-
[_ in never]: never
16-
}
17-
Functions: {
18-
graphql: {
19-
Args: {
20-
extensions?: Json
21-
operationName?: string
22-
query?: string
23-
variables?: Json
24-
}
25-
Returns: Json
26-
}
27-
}
28-
Enums: {
29-
[_ in never]: never
30-
}
31-
CompositeTypes: {
32-
[_ in never]: never
33-
}
10+
// Allows to automatically instantiate createClient with right options
11+
// instead of createClient<Database, { PostgrestVersion: 'XX' }>(URL, KEY)
12+
__InternalSupabase: {
13+
PostgrestVersion: "12.0.2 (a4e00ff)"
3414
}
3515
public: {
3616
Tables: {
@@ -3796,6 +3776,7 @@ export type Database = {
37963776
summary: string | null
37973777
tenant_id: string
37983778
title: string | null
3779+
transcript: Json | null
37993780
updated_at: string | null
38003781
video_url: string | null
38013782
}
@@ -3816,6 +3797,7 @@ export type Database = {
38163797
summary?: string | null
38173798
tenant_id?: string
38183799
title?: string | null
3800+
transcript?: Json | null
38193801
updated_at?: string | null
38203802
video_url?: string | null
38213803
}
@@ -3836,6 +3818,7 @@ export type Database = {
38363818
summary?: string | null
38373819
tenant_id?: string
38383820
title?: string | null
3821+
transcript?: Json | null
38393822
updated_at?: string | null
38403823
video_url?: string | null
38413824
}
@@ -5463,6 +5446,7 @@ export type Database = {
54635446
start_date: string
54645447
subscription_id: number
54655448
subscription_status: Database["public"]["Enums"]["subscription_status"]
5449+
superseded_by: number | null
54665450
tenant_id: string
54675451
transaction_id: number
54685452
trial_end: string | null
@@ -5485,6 +5469,7 @@ export type Database = {
54855469
start_date?: string
54865470
subscription_id?: number
54875471
subscription_status?: Database["public"]["Enums"]["subscription_status"]
5472+
superseded_by?: number | null
54885473
tenant_id?: string
54895474
transaction_id: number
54905475
trial_end?: string | null
@@ -5507,6 +5492,7 @@ export type Database = {
55075492
start_date?: string
55085493
subscription_id?: number
55095494
subscription_status?: Database["public"]["Enums"]["subscription_status"]
5495+
superseded_by?: number | null
55105496
tenant_id?: string
55115497
transaction_id?: number
55125498
trial_end?: string | null
@@ -5521,6 +5507,13 @@ export type Database = {
55215507
referencedRelation: "plans"
55225508
referencedColumns: ["plan_id"]
55235509
},
5510+
{
5511+
foreignKeyName: "subscriptions_superseded_by_fkey"
5512+
columns: ["superseded_by"]
5513+
isOneToOne: false
5514+
referencedRelation: "subscriptions"
5515+
referencedColumns: ["subscription_id"]
5516+
},
55245517
{
55255518
foreignKeyName: "subscriptions_tenant_id_fkey"
55265519
columns: ["tenant_id"]
@@ -6077,6 +6070,27 @@ export type Database = {
60776070
}
60786071
Relationships: []
60796072
}
6073+
user_ui_state: {
6074+
Row: {
6075+
key: string
6076+
updated_at: string
6077+
user_id: string
6078+
value: Json
6079+
}
6080+
Insert: {
6081+
key: string
6082+
updated_at?: string
6083+
user_id: string
6084+
value: Json
6085+
}
6086+
Update: {
6087+
key?: string
6088+
updated_at?: string
6089+
user_id?: string
6090+
value?: Json
6091+
}
6092+
Relationships: []
6093+
}
60806094
webhook_events: {
60816095
Row: {
60826096
error: string | null
@@ -6271,6 +6285,38 @@ export type Database = {
62716285
Args: { _plan_id: number; _user_id: string }
62726286
Returns: undefined
62736287
}
6288+
change_subscription_plan: {
6289+
Args: { _new_plan_id: number }
6290+
Returns: {
6291+
cancel_at: string
6292+
cancel_at_period_end: boolean | null
6293+
canceled_at: string | null
6294+
created: string
6295+
current_period_end: string
6296+
current_period_start: string
6297+
end_date: string
6298+
ended_at: string | null
6299+
payment_provider: string
6300+
plan_id: number
6301+
provider_metadata: Json | null
6302+
provider_subscription_id: string | null
6303+
start_date: string
6304+
subscription_id: number
6305+
subscription_status: Database["public"]["Enums"]["subscription_status"]
6306+
superseded_by: number | null
6307+
tenant_id: string
6308+
transaction_id: number
6309+
trial_end: string | null
6310+
trial_start: string | null
6311+
user_id: string
6312+
}
6313+
SetofOptions: {
6314+
from: "*"
6315+
to: "subscriptions"
6316+
isOneToOne: true
6317+
isSetofReturn: false
6318+
}
6319+
}
62746320
check_and_issue_certificate: {
62756321
Args: { p_course_id: number; p_user_id: string }
62766322
Returns: Json
@@ -6385,7 +6431,6 @@ export type Database = {
63856431
Args: { _plan_id: number; _user_id: string }
63866432
Returns: undefined
63876433
}
6388-
handle_manual_subscription_expiry: { Args: never; Returns: undefined }
63896434
handle_new_subscription: {
63906435
Args: {
63916436
_plan_id: number
@@ -6688,9 +6733,6 @@ export type CompositeTypes<
66886733
: never
66896734

66906735
export const Constants = {
6691-
graphql_public: {
6692-
Enums: {},
6693-
},
66946736
public: {
66956737
Enums: {
66966738
ai_sender_type: [
@@ -6752,4 +6794,3 @@ export const Constants = {
67526794
},
67536795
},
67546796
} as const
6755-

0 commit comments

Comments
 (0)