Tengo la siguiente entidad:
@Entity('team_player') export class TeamPlayer { @PrimaryColumn({ type: 'uuid', primary: false }) @ApiProperty({ type: 'string', format: 'uuid' }) player_id: string; @ApiProperty({ type: 'string', format: 'uuid' }) @Column({ type: 'text' }) team_id: string; }Y estoy ejecutando la siguiente prueba:
beforeEach(async () => { // Set up 3 players for one team await TeamPlayer.save({ player_id: player1Id, team_id: teamId, }); await TeamPlayer.save({ player_id: player2Id, team_id: teamId, }); await TeamPlayer.save({ player_id: player3Id, // only row that gets saved in final result team_id: teamId, }); });Cuando miro mi base de datos, solo se guarda el último jugador, asumiendo que está reemplazando a los anteriores que se guardaron. No quiero ese comportamiento, sino tener las 3 filas.
team_id player_id --------------------------- 5555555 player3Id¿Es eso algo que se puede arreglar simplemente cambiando la entidad?