-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.js
32 lines (26 loc) · 943 Bytes
/
models.js
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
"use strict";
const Sequelize = require("sequelize");
const dbConfig = require("./database");
const db = {};
const sequelizeIndexerBackendMainnetReadOnly = new Sequelize(
dbConfig.indexerDatabaseMainnet.database,
dbConfig.indexerDatabaseMainnet.username,
dbConfig.indexerDatabaseMainnet.password,
{
host: dbConfig.indexerDatabaseMainnet.host,
dialect: dbConfig.indexerDatabaseMainnet.dialect,
}
);
const sequelizeIndexerBackendTestnetReadOnly = new Sequelize(
dbConfig.indexerDatabaseTestnet.database,
dbConfig.indexerDatabaseTestnet.username,
dbConfig.indexerDatabaseTestnet.password,
{
host: dbConfig.indexerDatabaseTestnet.host,
dialect: dbConfig.indexerDatabaseTestnet.dialect,
}
);
db.sequelizeIndexerBackendMainnetReadOnly = sequelizeIndexerBackendMainnetReadOnly;
db.sequelizeIndexerBackendTestnetReadOnly = sequelizeIndexerBackendTestnetReadOnly;
db.Sequelize = Sequelize;
module.exports = db;