fix: assignment id bij seeden gefixt (DEELS)
This commit is contained in:
parent
a238e57a0c
commit
c6ce2e7e2c
2 changed files with 8 additions and 4 deletions
|
@ -6,7 +6,6 @@ import { Language } from '@dwengo-1/common/util/language';
|
|||
export function makeTestAssignemnts(em: EntityManager, classes: Class[]): Assignment[] {
|
||||
const assignment01 = em.create(Assignment, {
|
||||
within: classes[0],
|
||||
id: 1,
|
||||
title: 'dire straits',
|
||||
description: 'reading',
|
||||
learningPathHruid: 'id02',
|
||||
|
@ -16,7 +15,6 @@ export function makeTestAssignemnts(em: EntityManager, classes: Class[]): Assign
|
|||
|
||||
const assignment02 = em.create(Assignment, {
|
||||
within: classes[1],
|
||||
id: 2,
|
||||
title: 'tool',
|
||||
description: 'reading',
|
||||
learningPathHruid: 'id01',
|
||||
|
@ -26,7 +24,6 @@ export function makeTestAssignemnts(em: EntityManager, classes: Class[]): Assign
|
|||
|
||||
const assignment03 = em.create(Assignment, {
|
||||
within: classes[0],
|
||||
id: 3,
|
||||
title: 'delete',
|
||||
description: 'will be deleted',
|
||||
learningPathHruid: 'id02',
|
||||
|
@ -36,7 +33,6 @@ export function makeTestAssignemnts(em: EntityManager, classes: Class[]): Assign
|
|||
|
||||
const assignment04 = em.create(Assignment, {
|
||||
within: classes[0],
|
||||
id: 4,
|
||||
title: 'another assignment',
|
||||
description: 'with a description',
|
||||
learningPathHruid: 'id01',
|
||||
|
|
|
@ -34,6 +34,10 @@ export async function seedDatabase(): Promise<void> {
|
|||
const learningPaths = makeTestLearningPaths(em);
|
||||
const classes = makeTestClasses(em, students, teachers);
|
||||
const assignments = makeTestAssignemnts(em, classes);
|
||||
|
||||
/* Wegens een probleem met het aanmaken van groups werd deze code even in commentaar gezet */
|
||||
|
||||
/*
|
||||
const groups = makeTestGroups(em, students, assignments);
|
||||
|
||||
assignments[0].groups = new Collection<Group>(groups.slice(0, 3));
|
||||
|
@ -48,6 +52,7 @@ export async function seedDatabase(): Promise<void> {
|
|||
const questions = makeTestQuestions(em, students, groups);
|
||||
const answers = makeTestAnswers(em, teachers, questions);
|
||||
const submissions = makeTestSubmissions(em, students, groups);
|
||||
*/
|
||||
|
||||
// Persist all entities
|
||||
await em.persistAndFlush([
|
||||
|
@ -57,6 +62,7 @@ export async function seedDatabase(): Promise<void> {
|
|||
...learningPaths,
|
||||
...classes,
|
||||
...assignments,
|
||||
/*
|
||||
...groups,
|
||||
...teacherInvitations,
|
||||
...classJoinRequests,
|
||||
|
@ -64,6 +70,7 @@ export async function seedDatabase(): Promise<void> {
|
|||
...questions,
|
||||
...answers,
|
||||
...submissions,
|
||||
*/
|
||||
]);
|
||||
|
||||
logger.info('Development database seeded successfully!');
|
||||
|
@ -72,3 +79,4 @@ export async function seedDatabase(): Promise<void> {
|
|||
}
|
||||
|
||||
seedDatabase().catch(logger.error);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue