Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pgroll spec #1612

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading