-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestDb.js
44 lines (39 loc) · 1.44 KB
/
TestDb.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
33
34
35
36
37
38
39
40
41
42
43
44
const sequelize = require("./config/db");
sequelize.sync({ alter: true }).then(() => {
console.log('Database & tables created!');
process.exit();
}).catch(err => {
console.error('Unable to create tables, shutting down...', err);
process.exit(1);
});
const BinancePending = require("./models/binancepending");
const PaymentHistory = require("./models/paymentHistory");
// async function testConnection() {
// try {
// await sequelize.authenticate();
// console.log('Connection has been established successfully.');
// // const data = await IpDetails.findOne(
// // {
// // where: {
// // ip_from: {[Op.lte]: ip.toLong("103.91.51.0")}
// // },
// // limit: 1,
// // raw: true,
// // order: [['ip_from', 'DESC']]
// //
// // }
// // )
// // const pData ={
// // ip_from: ip.fromLong(data.ip_from),
// // ip_to: ip.fromLong(data.ip_to),
// // country_code: data.country_code,
// // country: data.country,
// // region_name: data.region_name,
// // city_name: data.city_name,
// // timezone: data.time_zone,
// // }
// // console.log(pData)
// } catch (error) {
// console.error('Unable to connect to the database:', error);
// }
// }