- Install dependencies via
yarn
ornpm install
- Run
docker-compose up -d
to start postgres - Migrate using the generator:
npx mikro-orm schema:create --run
- Run via
yarn start
oryarn start:dev
(watch mode)
Given the following setup:
foo.Author
foo.Publisher
bar.Book
bar.BookTag
Bug reproduction: Browse to http://localhost:3000/author/2/books
// author.controller.ts
const books = await DI.bookRepository.find({ author: {id: req.params.id} });
Result
{
"message": "select \"b0\".* from \"bar\".\"book\" as \"b0\" left join \"bar\".\"author\" as \"a1\" on \"b0\".\"author__id\" = \"a1\".\"_id\" where \"a1\".\"id\" = '2' - relation \"bar.author\" does not exist"
}
bar.author" should be "foo.author"