-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
64 lines (57 loc) · 1.61 KB
/
test.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const db = require('./server/db/')
const {User, Pool} = require('./server/db/models/');
async function seed() {
await db.sync({force: true})
console.log('db synced!')
await User.create({email: 111})
// .then(data => data.createPool({ name: "hz" })).then(d => { console.log(d) });
await User.findOne({where: {email: "111"}})
.then(i => i.createPool({poolName: "hz",ownerId:1}));
// .then(i => {console.log(i.__proto__)});
await User.findOne({where: {email: "111"}, include: [Pool]}).then(i => {
console.log(i)
});
}
async function runSeed() {
console.log('seeding...')
try {
await seed()
} catch (err) {
console.error(err)
process.exitCode = 1
}
}
runSeed()
module.exports = seed;
// const arr = []
// for (let key in some) {
// if (!!some[key].data) {
// if (!!x.data.trim())
// arr.push(some[key])
// } else if (!!x.checkValidity) {
// arr.push(some[key])
// }
// }
// const func = (x) => {
// for (const key in s) {
// const data = s[key].data;
// if (data) {
// return s[key].previousSibling.checked
// }
// }
// }
// const funcSwitch = (x) => {
// for (const key in nodeElements) {
// const data = nodeElements[key].data;
// if (data) {
// if (data.trim() === x) {
// const node= nodeElements[key].previousSibling
// node.checked=!node.checked;
// }
// }
// }
// }
// let arr=[];
// for (const key in some){
// if(some[key].hasOwnProperty("draggable")) arr.push(some[key])
// }