fix(backend): Workaround voor autoincrement-problemen bij SQLite
SQLite (die we voor de automatische tests gebruiken) ondersteunt geen autoincrement op kolommen die deel uitmaken van een composite primary key. Hiervoor heb ik een workaround geïmplementeerd.
This commit is contained in:
parent
678ced55ba
commit
4dcd4671ca
9 changed files with 94 additions and 42 deletions
|
@ -24,6 +24,7 @@ import { LearningPath } from './entities/content/learning-path.entity.js';
|
|||
|
||||
import { Answer } from './entities/questions/answer.entity.js';
|
||||
import { Question } from './entities/questions/question.entity.js';
|
||||
import {SqliteAutoincrementSubscriber} from "./sqlite-autoincrement-workaround";
|
||||
|
||||
const entities = [
|
||||
User,
|
||||
|
@ -47,6 +48,7 @@ function config(testingMode: boolean = false): Options {
|
|||
return {
|
||||
driver: SqliteDriver,
|
||||
dbName: getEnvVar(EnvVars.DbName),
|
||||
subscribers: [new SqliteAutoincrementSubscriber()],
|
||||
entities: entities,
|
||||
// EntitiesTs: entitiesTs,
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue