mirror of
https://github.com/sergeyyarkov/educt-server.git
synced 2026-10-11 10:19:20 +03:00
16 lines
442 B
TypeScript
16 lines
442 B
TypeScript
import BaseSeeder from '@ioc:Adonis/Lucid/Seeder';
|
|
import { CourseFactory } from 'Database/factories';
|
|
|
|
export default class CourseSeeder extends BaseSeeder {
|
|
private CourseFactory: typeof CourseFactory;
|
|
|
|
public async run() {
|
|
this.CourseFactory = CourseFactory;
|
|
|
|
await this.CourseFactory.with('lessons', 2, lessonFactory => lessonFactory.with('content'))
|
|
.with('category')
|
|
.with('teacher')
|
|
.createMany(3);
|
|
}
|
|
}
|