Skip to content

Commit

Permalink
typescript definition fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dolezel committed Jan 25, 2018
1 parent 5209734 commit 8523091
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
32 changes: 16 additions & 16 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ interface DropIndexOptionsEn {
export type DropIndexOptions = DropIndexOptionsEn & DropOptions

export interface FunctionParamType {
mode: 'IN' | 'OUT' | 'INOUT' | 'VARIADIC'
name: string
mode?: 'IN' | 'OUT' | 'INOUT' | 'VARIADIC'
name?: string
type: string
default: Value
default?: Value
}

export type FunctionParam = string | FunctionParamType
Expand All @@ -191,14 +191,14 @@ export interface FunctionOptions {
}

interface TriggerOptionsEn {
when: 'BEFORE' | 'AFTER' | 'INSTEAD OF'
when?: 'BEFORE' | 'AFTER' | 'INSTEAD OF'
operation: string | string[]
constraint: boolean
function: Name
level: 'STATEMENT' | 'ROW'
condition: string
deferrable: boolean
deferred: boolean
constraint?: boolean
function?: Name
level?: 'STATEMENT' | 'ROW'
condition?: string
deferrable?: boolean
deferred?: boolean
}

export type TriggerOptions = TriggerOptionsEn & FunctionOptions
Expand All @@ -223,7 +223,7 @@ export type DomainOptionsCreate = DomainOptionsCreateEn & DomainOptions
export type DomainOptionsAlter = DomainOptionsAlterEn & DomainOptions

interface SequenceOptions {
type?: string
type?: Type
increment?: number
minvalue?: number | null | false
maxvalue?: number | null | false
Expand Down Expand Up @@ -271,9 +271,9 @@ export interface CreateOperatorClassOptions {
}

export interface OperatorListDefinition {
type?: string
number?: number
name?: Name
type: 'function' | 'operator'
number: number
name: Name
params?: FunctionParam[]
}

Expand Down Expand Up @@ -342,7 +342,7 @@ export interface MigrationBuilder {
renameSchema(old_schema_name: string, new_schema_name: string): void

// Domains
createDomain(domain_name: Name, domain_options: DomainOptionsCreate): void
createDomain(domain_name: Name, type: Type, domain_options: DomainOptionsCreate): void
dropDomain(domain_name: Name, drop_options: DropOptions): void
alterDomain(domain_name: Name, domain_options: DomainOptionsAlter): void
renameDomain(old_domain_name: Name, new_domain_name: Name): void
Expand All @@ -356,7 +356,7 @@ export interface MigrationBuilder {
// Operators
createOperator(operator_name: Name, options: CreateOperatorOptions): void
dropOperator(operator_name: Name, drop_options: DropOperatorOptions): void
createOperatorClass(operator_class_name: Name, type: Name, index_method: Name, operator_list: OperatorListDefinition, options: CreateOperatorClassOptions): void
createOperatorClass(operator_class_name: Name, type: Type, index_method: Name, operator_list: OperatorListDefinition, options: CreateOperatorClassOptions): void
dropOperatorClass(operator_class_name: Name, index_method: Name, drop_options: DropOptions): void
renameOperatorClass(old_operator_class_name: Name, index_method: Name, new_operator_class_name: Name): void
createOperatorFamily(operator_family_name: Name, index_method: Name): void
Expand Down
2 changes: 1 addition & 1 deletion lib/operations/domains.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const create = (type_shorthands) => {

return template`CREATE DOMAIN "${domain_name}" AS ${applyType(type, type_shorthands).type}${constraintsString};`;
};
_create.reverse = drop;
_create.reverse = (domain_name, type, options) => drop(domain_name, options);
return _create;
};

Expand Down

0 comments on commit 8523091

Please sign in to comment.