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[] {
|
export function makeTestAssignemnts(em: EntityManager, classes: Class[]): Assignment[] {
|
||||||
const assignment01 = em.create(Assignment, {
|
const assignment01 = em.create(Assignment, {
|
||||||
within: classes[0],
|
within: classes[0],
|
||||||
id: 1,
|
|
||||||
title: 'dire straits',
|
title: 'dire straits',
|
||||||
description: 'reading',
|
description: 'reading',
|
||||||
learningPathHruid: 'id02',
|
learningPathHruid: 'id02',
|
||||||
|
@ -16,7 +15,6 @@ export function makeTestAssignemnts(em: EntityManager, classes: Class[]): Assign
|
||||||
|
|
||||||
const assignment02 = em.create(Assignment, {
|
const assignment02 = em.create(Assignment, {
|
||||||
within: classes[1],
|
within: classes[1],
|
||||||
id: 2,
|
|
||||||
title: 'tool',
|
title: 'tool',
|
||||||
description: 'reading',
|
description: 'reading',
|
||||||
learningPathHruid: 'id01',
|
learningPathHruid: 'id01',
|
||||||
|
@ -26,7 +24,6 @@ export function makeTestAssignemnts(em: EntityManager, classes: Class[]): Assign
|
||||||
|
|
||||||
const assignment03 = em.create(Assignment, {
|
const assignment03 = em.create(Assignment, {
|
||||||
within: classes[0],
|
within: classes[0],
|
||||||
id: 3,
|
|
||||||
title: 'delete',
|
title: 'delete',
|
||||||
description: 'will be deleted',
|
description: 'will be deleted',
|
||||||
learningPathHruid: 'id02',
|
learningPathHruid: 'id02',
|
||||||
|
@ -36,7 +33,6 @@ export function makeTestAssignemnts(em: EntityManager, classes: Class[]): Assign
|
||||||
|
|
||||||
const assignment04 = em.create(Assignment, {
|
const assignment04 = em.create(Assignment, {
|
||||||
within: classes[0],
|
within: classes[0],
|
||||||
id: 4,
|
|
||||||
title: 'another assignment',
|
title: 'another assignment',
|
||||||
description: 'with a description',
|
description: 'with a description',
|
||||||
learningPathHruid: 'id01',
|
learningPathHruid: 'id01',
|
||||||
|
|
|
@ -34,6 +34,10 @@ export async function seedDatabase(): Promise<void> {
|
||||||
const learningPaths = makeTestLearningPaths(em);
|
const learningPaths = makeTestLearningPaths(em);
|
||||||
const classes = makeTestClasses(em, students, teachers);
|
const classes = makeTestClasses(em, students, teachers);
|
||||||
const assignments = makeTestAssignemnts(em, classes);
|
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);
|
const groups = makeTestGroups(em, students, assignments);
|
||||||
|
|
||||||
assignments[0].groups = new Collection<Group>(groups.slice(0, 3));
|
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 questions = makeTestQuestions(em, students, groups);
|
||||||
const answers = makeTestAnswers(em, teachers, questions);
|
const answers = makeTestAnswers(em, teachers, questions);
|
||||||
const submissions = makeTestSubmissions(em, students, groups);
|
const submissions = makeTestSubmissions(em, students, groups);
|
||||||
|
*/
|
||||||
|
|
||||||
// Persist all entities
|
// Persist all entities
|
||||||
await em.persistAndFlush([
|
await em.persistAndFlush([
|
||||||
|
@ -57,6 +62,7 @@ export async function seedDatabase(): Promise<void> {
|
||||||
...learningPaths,
|
...learningPaths,
|
||||||
...classes,
|
...classes,
|
||||||
...assignments,
|
...assignments,
|
||||||
|
/*
|
||||||
...groups,
|
...groups,
|
||||||
...teacherInvitations,
|
...teacherInvitations,
|
||||||
...classJoinRequests,
|
...classJoinRequests,
|
||||||
|
@ -64,6 +70,7 @@ export async function seedDatabase(): Promise<void> {
|
||||||
...questions,
|
...questions,
|
||||||
...answers,
|
...answers,
|
||||||
...submissions,
|
...submissions,
|
||||||
|
*/
|
||||||
]);
|
]);
|
||||||
|
|
||||||
logger.info('Development database seeded successfully!');
|
logger.info('Development database seeded successfully!');
|
||||||
|
@ -72,3 +79,4 @@ export async function seedDatabase(): Promise<void> {
|
||||||
}
|
}
|
||||||
|
|
||||||
seedDatabase().catch(logger.error);
|
seedDatabase().catch(logger.error);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue