node-pg-migrate-custom
Version:
Postgresql database migration management tool for node.js
30 lines (29 loc) • 993 B
TypeScript
import { Name, DropOptions } from './generalTypes';
export interface IndexColumn {
name: string;
opclass?: Name;
sort?: 'ASC' | 'DESC';
}
export interface CreateIndexOptions {
name?: string;
unique?: boolean;
where?: string;
concurrently?: boolean;
ifNotExists?: boolean;
/**
* @deprecated should be parameter of IndexColumn
*/
opclass?: Name;
method?: 'btree' | 'hash' | 'gist' | 'spgist' | 'gin';
include?: string | string[];
}
export interface DropIndexOptions extends DropOptions {
name?: string;
concurrently?: boolean;
}
declare type CreateIndexFn = (tableName: Name, columns: string | (string | IndexColumn)[], options?: CreateIndexOptions & DropIndexOptions) => string | string[];
export declare type CreateIndex = CreateIndexFn & {
reverse: CreateIndexFn;
};
export declare type DropIndex = (tableName: Name, columns: string | (string | IndexColumn)[], options?: DropIndexOptions) => string | string[];
export {};