forked from mle-moni/galadrim-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
001_UserSeeder.ts
51 lines (49 loc) · 1.71 KB
/
001_UserSeeder.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
import { generateRights, RIGHTS } from '@galadrim-tools/shared'
import BaseSeeder from '@ioc:Adonis/Lucid/Seeder'
import User from '../../app/Models/User'
export default class UserSeeder extends BaseSeeder {
public static environment = ['development']
public async run() {
User.updateOrCreateMany('id', [
{
id: 1,
username: 'test',
email: 'test@test.fr',
imageUrl: 'https://forest.galadrim.fr/img/users/default.png',
password: 'test',
rights: RIGHTS.DEFAULT,
},
{
id: 2,
username: 'miam',
email: 'miam@miam.fr',
imageUrl:
'https://static8.depositphotos.com/1010340/945/v/450/depositphotos_9459006-stock-illustration-chef-cartoon.jpg',
password: 'miam',
rights: generateRights(['MIAM_ADMIN']),
},
{
id: 3,
username: 'admin',
email: 'admin@admin.fr',
imageUrl: 'https://forest.galadrim.fr/img/users/105.jpg',
password: 'admin',
rights: generateRights([
'EVENT_ADMIN',
'MIAM_ADMIN',
'RIGHTS_ADMIN',
'USER_ADMIN',
'DASHBOARD_ADMIN',
]),
},
{
id: 4,
username: 'peon',
email: 'peon@peon.fr',
imageUrl: 'https://forest.galadrim.fr/img/users/default.png',
password: 'peon',
rights: RIGHTS.DEFAULT,
},
])
}
}