aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/ormconfig.ts
blob: 39b496ace135747e13b2196a0bb636afa6252d44 (plain) (blame)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
import { ConnectionOptions } from 'typeorm';

import {
    Block,
    ExchangeCancelEvent,
    ExchangeCancelUpToEvent,
    ExchangeFillEvent,
    Relayer,
    SraOrder,
    Transaction,
} from './entities';

const entities = [
    Block,
    ExchangeCancelEvent,
    ExchangeCancelUpToEvent,
    ExchangeFillEvent,
    Relayer,
    SraOrder,
    Transaction,
];

export const testConfig: ConnectionOptions = {
    type: 'sqlite',
    database: 'database.sqlite',
    synchronize: true,
    logging: false,
    entities,
    migrations: ['./lib/src/migrations/**/*.js'],
    cli: {
        entitiesDir: 'lib/src/entities',
        migrationsDir: 'lib/src/migrations',
    },
};

export const deployConfig: ConnectionOptions = {
    type: 'postgres',
    url: process.env.ZEROEX_DATA_PIPELINE_DB_URL,
    synchronize: true,
    logging: false,
    entities,
    migrations: ['./lib/src/migrations/**/*.js'],
    cli: {
        entitiesDir: 'lib/src/entities',
        migrationsDir: 'lib/src/migrations',
    },
};