-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseed.ts
56 lines (52 loc) · 1.21 KB
/
seed.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { Effect } from './models/effect.model'
import { Pedalboard } from './models/pedalboard.model'
import { User } from './models/user.model'
export const seedDb = async () => {
await Effect.deleteMany({})
await User.deleteMany({})
await Pedalboard.deleteMany({})
await User.create({
username: 'tester',
password: '$2b$10$lpSxVQNXbGIoqQJDtDS5UuahLmnTmYxnHvM6UYWFJ7zmnij9ya/K6', // test
effects: [],
pedalboards: [],
recordings: []
})
await User.create({
username: 'tester2',
password: '$2b$10$lpSxVQNXbGIoqQJDtDS5UuahLmnTmYxnHvM6UYWFJ7zmnij9ya/K6', // test
effects: [],
pedalboards: [],
recordings: []
})
await Effect.create([
{
author: 'tester',
title: 'Test effect',
description: 'Test description',
public: false,
effect: {
name: 'analogDelay',
values: {
delay: 0.5,
regen: 0.7,
mix: 0.5
}
}
},
{
author: 'tester2',
title: 'Test effect 2',
description: 'Test description 2',
public: true,
effect: {
name: 'analogDelay',
values: {
delay: 0.5,
regen: 0.7,
mix: 0.5
}
}
},
])
}