Describe the bug
When creating a single table inheritance set up where the parent table is included in the discriminatorMap property, generated migrations ignore all the tables. If the parent table is removed from the map - the migrations run correctly.
To Reproduce
Steps to reproduce the behavior:
migration:create command (info about setup and running commands in README.md) with parent included in discriminatorMapWith this child table:
// employee.entity.ts
@Entity()
export class Employee extends Person {
@Property()
number: number;
}
This works:
// person.entity.ts
@Entity({
discriminatorColumn: 'type',
discriminatorMap: {
// person: 'Person',
employee: 'Employee',
},
})
export class Person {
@PrimaryKey()
id: string;
}
However this causes empty migrations:
// person.entity.ts
@Entity({
discriminatorColumn: 'type',
discriminatorMap: {
person: 'Person',
employee: 'Employee',
},
})
export class Person {
@PrimaryKey()
id: string;
}
Versions
| Dependency | Version |
| - | - |
| node | 12.18.3 |
| typescript | 4.0.x |
| mikro-orm | 4.0.7 |
| your-driver | mysql2 |
@B4nan Do you have an ETA for release of the commits fixing this issue?
Later this week, will be aiming for the first half (tue/wed), but can't promise.
@B4nan I made the same fix as you applied here, and it appears to me that in MySQL any sort of many-many pivot table is no longer generated using the migration:create --initial command.
Most helpful comment
Later this week, will be aiming for the first half (tue/wed), but can't promise.