File tree Expand file tree Collapse file tree 5 files changed +12
-11
lines changed
npm-packages/convex/src/cli/lib Expand file tree Collapse file tree 5 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -511,7 +511,7 @@ function printDiff(
511
511
msg = msg . slice ( 0 , - 1 ) ; // strip last new line
512
512
logFinishedStep ( msg ) ;
513
513
}
514
- if ( rootDiff . enabled_indexes . length > 0 ) {
514
+ if ( rootDiff . enabled_indexes && rootDiff . enabled_indexes . length > 0 ) {
515
515
let msg = opts . dryRun
516
516
? `These indexes would be enabled:\n`
517
517
: `These indexes are now enabled:\n` ;
@@ -521,7 +521,7 @@ function printDiff(
521
521
msg = msg . slice ( 0 , - 1 ) ; // strip last new line
522
522
logFinishedStep ( msg ) ;
523
523
}
524
- if ( rootDiff . disabled_indexes . length > 0 ) {
524
+ if ( rootDiff . disabled_indexes && rootDiff . disabled_indexes . length > 0 ) {
525
525
let msg = opts . dryRun
526
526
? `These indexes would be staged:\n`
527
527
: `These indexes are now staged:\n` ;
Original file line number Diff line number Diff line change @@ -157,9 +157,9 @@ export async function waitForSchema(
157
157
msg = `Backfilling indexes (${ indexesComplete } /${ indexesTotal } ready)...` ;
158
158
// Set a more specific message if the backfill is taking a long time
159
159
if ( Date . now ( ) - start > 10_000 ) {
160
- const rootDiff = startPush . schemaChange . indexDiffs [ "" ] ;
160
+ const rootDiff = startPush . schemaChange . indexDiffs ?. [ "" ] ;
161
161
const indexName = (
162
- rootDiff . added_indexes [ 0 ] || rootDiff . enabled_indexes [ 0 ]
162
+ rootDiff ? .added_indexes [ 0 ] || rootDiff ? .enabled_indexes ?. [ 0 ]
163
163
) ?. name ;
164
164
if ( indexName ) {
165
165
const table = indexName . split ( "." ) [ 0 ] ;
Original file line number Diff line number Diff line change @@ -73,8 +73,8 @@ export type DeveloperIndexConfig = z.infer<typeof developerIndexConfig>;
73
73
export const indexDiff = looseObject ( {
74
74
added_indexes : z . array ( developerIndexConfig ) ,
75
75
removed_indexes : z . array ( developerIndexConfig ) ,
76
- enabled_indexes : z . array ( developerIndexConfig ) ,
77
- disabled_indexes : z . array ( developerIndexConfig ) ,
76
+ enabled_indexes : z . array ( developerIndexConfig ) . optional ( ) ,
77
+ disabled_indexes : z . array ( developerIndexConfig ) . optional ( ) ,
78
78
} ) ;
79
79
export type IndexDiff = z . infer < typeof indexDiff > ;
80
80
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export type StartPushRequest = z.infer<typeof startPushRequest>;
29
29
export const schemaChange = looseObject ( {
30
30
allocatedComponentIds : z . any ( ) ,
31
31
schemaIds : z . any ( ) ,
32
- indexDiffs : z . record ( componentDefinitionPath , indexDiff ) ,
32
+ indexDiffs : z . record ( componentDefinitionPath , indexDiff ) . optional ( ) ,
33
33
} ) ;
34
34
export type SchemaChange = z . infer < typeof schemaChange > ;
35
35
Original file line number Diff line number Diff line change @@ -45,9 +45,10 @@ type SchemaStateResponse = {
45
45
type PrepareSchemaResponse = {
46
46
added : IndexMetadata [ ] ;
47
47
dropped : IndexMetadata [ ] ;
48
- enabled : IndexMetadata [ ] ;
49
- disabled : IndexMetadata [ ] ;
50
48
schemaId : string ;
49
+ // added August 22 2025
50
+ enabled ?: IndexMetadata [ ] ;
51
+ disabled ?: IndexMetadata [ ] ;
51
52
} ;
52
53
53
54
export async function pushSchema (
@@ -266,7 +267,7 @@ function logIndexChanges(
266
267
`${ dryRun ? "Would add" : "Added" } staged table indexes:\n${ indexDiff } ` ,
267
268
) ;
268
269
}
269
- if ( indexes . enabled . length > 0 ) {
270
+ if ( indexes . enabled && indexes . enabled . length > 0 ) {
270
271
let indexDiff = "" ;
271
272
for ( const index of indexes . enabled ) {
272
273
indexDiff += ` [*] ${ stringifyIndex ( index ) } \n` ;
@@ -278,7 +279,7 @@ function logIndexChanges(
278
279
: `These indexes are now enabled` ;
279
280
logFinishedStep ( `${ text } :\n${ indexDiff } ` ) ;
280
281
}
281
- if ( indexes . disabled . length > 0 ) {
282
+ if ( indexes . disabled && indexes . disabled . length > 0 ) {
282
283
let indexDiff = "" ;
283
284
for ( const index of indexes . disabled ) {
284
285
indexDiff += ` [*] ${ stringifyIndex ( index ) } \n` ;
You can’t perform that action at this time.
0 commit comments