TypeORM is making a weird query of clientId. I have a store and a client table. A client can have many stores. A store can have a client.
I have tried using the ManyToOne and OneToMany relationship.
Store:
@ManyToOne(type => ClientRelationalEntity, client => client.stores)
client: ClientRelationalEntity;
Client:
@OneToMany(type => StoreRelationalEntity, store => store.client)
stores: StoreRelationalEntity[];
I get a query error:
ER_BAD_FIELD_ERROR: Unknown column 'StoreRelationalEntity.clientId' in 'field list'
'id' is being added to client. If I change the id variable in client.js to 'fgfgfg' the error is:
ER_BAD_FIELD_ERROR: Unknown column 'StoreRelationalEntity.clientfgfgfg' in 'field list'
What am I doing wrong here?
@JoinColumn({ name: 'client_id' })
decorator to theclient
field. – Dylan Aspden