diff --git a/.changeset/thick-kings-eat.md b/.changeset/thick-kings-eat.md new file mode 100644 index 000000000..51942104b --- /dev/null +++ b/.changeset/thick-kings-eat.md @@ -0,0 +1,5 @@ +--- +"@xata.io/pgroll": patch +--- + +Update pgroll spec diff --git a/packages/pgroll/src/schema.ts b/packages/pgroll/src/schema.ts index 6185553a6..75b0ad392 100644 --- a/packages/pgroll/src/schema.ts +++ b/packages/pgroll/src/schema.ts @@ -259,6 +259,10 @@ export const schema = { table: { description: 'Name of table on which to define the index', type: 'string' + }, + predicate: { + description: 'Conditional expression for defining a partial index', + type: 'string' } }, required: ['columns', 'name', 'table'], diff --git a/packages/pgroll/src/types.ts b/packages/pgroll/src/types.ts index bd1dead84..797f0cd0c 100644 --- a/packages/pgroll/src/types.ts +++ b/packages/pgroll/src/types.ts @@ -64,7 +64,8 @@ export type OpCreateIndex = z.infer; export const OpCreateIndexDefinition = z.object({ columns: z.array(z.string()), name: z.string(), - table: z.string() + table: z.string(), + predicate: z.string().optional() }); export type OpCreateTable = z.infer;