32 lines
658 B
TypeScript
32 lines
658 B
TypeScript
import BaseSeeder from '@ioc:Adonis/Lucid/Seeder'
|
|
import Logger from '@ioc:Adonis/Core/Logger'
|
|
import Employee from 'App/Models/Employee'
|
|
|
|
export default class EmployeeSeeder extends BaseSeeder {
|
|
public async run () {
|
|
|
|
try {
|
|
await Employee.createMany([
|
|
{
|
|
firstName: 'Pascal',
|
|
lastName: 'König',
|
|
shorthand: 'PK'
|
|
},
|
|
{
|
|
firstName: 'Sandra',
|
|
lastName: 'Sühl',
|
|
shorthand: 'SS'
|
|
},
|
|
{
|
|
firstName: 'Karin',
|
|
lastName: 'Behr',
|
|
shorthand: 'KB'
|
|
}
|
|
])
|
|
} catch (error) {
|
|
Logger.error(error)
|
|
}
|
|
|
|
}
|
|
}
|