forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
anydb-sql-migrations.d.ts
34 lines (32 loc) · 1.08 KB
/
anydb-sql-migrations.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Type definitions for anydb-sql-migrations
// Project: https://github.com/spion/anydb-sql-migrations
// Definitions by: Gorgi Kosev <https://github.com/spion>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../bluebird/bluebird.d.ts" />
/// <reference path="../anydb-sql/anydb-sql.d.ts" />
declare module "anydb-sql-migrations" {
import Promise = require('bluebird');
import { Column, Table, Transaction, AnydbSql } from 'anydb-sql';
export interface Migration {
version: string;
}
export interface MigrationsTable extends Table<Migration> {
version: Column<string>;
}
export interface MigFn {
(tx: Transaction): Promise<any>;
}
export interface MigrationTask {
up: MigFn;
down: MigFn;
name: string;
}
export function create(db: AnydbSql, tasks: any): {
run: () => Promise<any>;
migrateTo: (target?: string) => Promise<any>;
check: (f: (m: {
type: string;
items: MigrationTask[];
}) => any) => Promise<any>;
};
}