Skip to content

Commit

Permalink
Update pgroll spec (#1612)
Browse files Browse the repository at this point in the history
Co-authored-by: SferaDev <[email protected]>
Co-authored-by: Alexis Rico <[email protected]>
  • Loading branch information
3 people authored Oct 16, 2024
1 parent 699821c commit 798b45a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/thick-kings-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@xata.io/pgroll": patch
---

Update pgroll spec
4 changes: 4 additions & 0 deletions packages/pgroll/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
3 changes: 2 additions & 1 deletion packages/pgroll/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export type OpCreateIndex = z.infer<typeof OpCreateIndexDefinition>;
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<typeof OpCreateTableDefinition>;
Expand Down

0 comments on commit 798b45a

Please sign in to comment.