Skip to content

Commit 279a0c3

Browse files
authored
fix!: change indexMethod type from Name to string in operator functions (#1476)
1 parent 5d60746 commit 279a0c3

File tree

11 files changed

+23
-21
lines changed

11 files changed

+23
-21
lines changed

docs/src/migrations/operators.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#### `pgm.dropOperator( operator_name, drop_options )`
3434

3535
> [!IMPORTANT]
36-
> Drop a operator - [postgres docs](http://www.postgresql.org/docs/current/static/sql-dropoperator.html)
36+
> Drop an operator - [postgres docs](http://www.postgresql.org/docs/current/static/sql-dropoperator.html)
3737
3838
### Arguments
3939

@@ -64,7 +64,7 @@
6464
| --------------------- | ------------------------- | ------------------------------------------------- |
6565
| `operator_class_name` | [Name](/migrations/#type) | name of the new operator class |
6666
| `type` | `string` | data type of the new operator class |
67-
| `index_method` | [Name](/migrations/#type) | name of the index method of operator class |
67+
| `index_method` | `string` | name of the index method of operator class |
6868
| `operator_list` | `array` | of [operator objects](#operator-list-definitions) |
6969
| `options` | `object` | Check below for available options |
7070

@@ -87,7 +87,7 @@
8787
| Name | Type | Description |
8888
| --------------------- | ------------------------- | ------------------------------------------ |
8989
| `operator_class_name` | [Name](/migrations/#type) | name of the operator class to drop |
90-
| `index_method` | [Name](/migrations/#type) | name of the index method of operator class |
90+
| `index_method` | `string` | name of the index method of operator class |
9191
| `drop_options` | `object` | Check below for available options |
9292

9393
### Options
@@ -109,7 +109,7 @@
109109
| Name | Type | Description |
110110
| ------------------------- | ------------------------- | ------------------------------------------ |
111111
| `old_operator_class_name` | [Name](/migrations/#type) | old name of the operator class |
112-
| `index_method` | [Name](/migrations/#type) | name of the index method of operator class |
112+
| `index_method` | `string` | name of the index method of operator class |
113113
| `new_operator_class_name` | [Name](/migrations/#type) | new name of the operator class |
114114

115115
## Operation: `alterOperatorClass`
@@ -124,21 +124,21 @@
124124
| Name | Type | Description |
125125
| ---------------------- | ------------------------- | ------------------------------------------- |
126126
| `operator_family_name` | [Name](/migrations/#type) | name of the new operator family |
127-
| `index_method` | [Name](/migrations/#type) | name of the index method of operator family |
127+
| `index_method` | `string` | name of the index method of operator family |
128128

129129
## Reverse Operation: `dropOperatorFamily`
130130

131131
#### `pgm.dropOperatorFamily( operator_family_name, index_methoddrop_options )`
132132

133133
> [!IMPORTANT]
134-
> Drop a operator family - [postgres docs](http://www.postgresql.org/docs/current/static/sql-dropopfamily.html)
134+
> Drop an operator family - [postgres docs](http://www.postgresql.org/docs/current/static/sql-dropopfamily.html)
135135
136136
### Arguments
137137

138138
| Name | Type | Description |
139139
| ---------------------- | ------------------------- | ------------------------------------------- |
140140
| `operator_family_name` | [Name](/migrations/#type) | name of the operator family to drop |
141-
| `index_method` | [Name](/migrations/#type) | name of the index method of operator family |
141+
| `index_method` | `string` | name of the index method of operator family |
142142
| `drop_options` | `object` | Check below for available options |
143143

144144
### Options
@@ -160,7 +160,7 @@
160160
| Name | Type | Description |
161161
| -------------------------- | ------------------------- | ------------------------------------------- |
162162
| `old_operator_family_name` | [Name](/migrations/#type) | old name of the operator family |
163-
| `index_method` | [Name](/migrations/#type) | name of the index method of operator family |
163+
| `index_method` | `string` | name of the index method of operator family |
164164
| `new_operator_family_name` | [Name](/migrations/#type) | new name of the operator family |
165165

166166
## Operation: `alterOperatorFamily`
@@ -175,7 +175,7 @@
175175
| Name | Type | Description |
176176
| ---------------------- | ------------------------- | ------------------------------------------------- |
177177
| `operator_family_name` | [Name](/migrations/#type) | name of the operator family |
178-
| `index_method` | [Name](/migrations/#type) | name of the index method of operator family |
178+
| `index_method` | `string` | name of the index method of operator family |
179179
| `operator_list` | `array` | of [operator objects](#operator-list-definitions) |
180180

181181
## Reverse Operation: `dropFromOperatorFamily`
@@ -190,12 +190,12 @@
190190
| Name | Type | Description |
191191
| ---------------------- | ------------------------- | ------------------------------------------------- |
192192
| `operator_family_name` | [Name](/migrations/#type) | name of the operator family |
193-
| `index_method` | [Name](/migrations/#type) | name of the index method of operator family |
193+
| `index_method` | `string` | name of the index method of operator family |
194194
| `operator_list` | `array` | of [operator objects](#operator-list-definitions) |
195195

196196
## Operator List Definitions
197197

198-
Some functions for defining operators take as parameter `operator_list` which is array of objects with the following
198+
Some functions for defining operators take as parameter `operator_list` which is an array of objects with the following
199199
structure:
200200

201201
| Name | Type | Description |

src/operations/functions/createFunction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function createFunction(mOptions: MigrationOptions): CreateFunction {
4545
options.push(`LANGUAGE ${language}`);
4646
} else {
4747
throw new Error(
48-
`Language for function ${functionName} have to be specified`
48+
`Language for function ${mOptions.literal(functionName)} have to be specified`
4949
);
5050
}
5151

src/operations/operators/addToOperatorFamily.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { operatorMap } from './shared';
66

77
export type AddToOperatorFamilyFn = (
88
operatorFamilyName: Name,
9-
indexMethod: Name,
9+
indexMethod: string,
1010
operatorList: OperatorListDefinition[]
1111
) => string;
1212

src/operations/operators/createOperatorClass.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface CreateOperatorClassOptions {
1515
export type CreateOperatorClassFn = (
1616
operatorClassName: Name,
1717
type: Type,
18-
indexMethod: Name,
18+
indexMethod: string,
1919
operatorList: OperatorListDefinition[],
2020
operatorClassOptions: CreateOperatorClassOptions & DropOperatorClassOptions
2121
) => string;

src/operations/operators/createOperatorFamily.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface CreateOperatorFamilyOptions {}
88

99
export type CreateOperatorFamilyFn = (
1010
operatorFamilyName: Name,
11-
indexMethod: Name,
11+
indexMethod: string,
1212
operatorFamilyOptions?: CreateOperatorFamilyOptions &
1313
DropOperatorFamilyOptions
1414
) => string;

src/operations/operators/dropOperatorClass.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export type DropOperatorClassOptions = DropOptions;
55

66
export type DropOperatorClass = (
77
operatorClassName: Name,
8-
indexMethod: Name,
8+
indexMethod: string,
99
dropOptions?: DropOperatorClassOptions
1010
) => string;
1111

src/operations/operators/dropOperatorFamily.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export type DropOperatorFamilyOptions = DropOptions;
55

66
export type DropOperatorFamily = (
77
operatorFamilyName: Name,
8-
newSchemaName: Name,
8+
indexMethod: string,
99
dropOptions?: DropOperatorFamilyOptions
1010
) => string;
1111

src/operations/operators/removeFromOperatorFamily.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { operatorMap } from './shared';
55

66
export type RemoveFromOperatorFamily = (
77
operatorFamilyName: Name,
8-
indexMethod: Name,
8+
indexMethod: string,
99
operatorList: OperatorListDefinition[]
1010
) => string;
1111

src/operations/operators/renameOperatorClass.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Name, Reversible } from '../generalTypes';
33

44
export type RenameOperatorClassFn = (
55
oldOperatorClassName: Name,
6-
indexMethod: Name,
6+
indexMethod: string,
77
newOperatorClassName: Name
88
) => string;
99

src/operations/operators/renameOperatorFamily.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Name, Reversible } from '../generalTypes';
33

44
export type RenameOperatorFamilyFn = (
55
oldOperatorFamilyName: Name,
6-
indexMethod: Name,
6+
indexMethod: string,
77
newOperatorFamilyName: Name
88
) => string;
99

0 commit comments

Comments
 (0)