Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'type' of undefined at PostgresQueryRunner.loadTables #5747

Closed
osher-sade opened this issue Mar 23, 2020 · 2 comments

Comments

@osher-sade
Copy link

osher-sade commented Mar 23, 2020

Issue type:

[ ] question
[x] bug report
[ ] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[x] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo

TypeORM version:

[x] latest
[ ] @next
[ ] 0.x.x

Steps to reproduce or a small repository showing the problem:

Hello, this issue won't occur if you start typeorm when there are no tables to synchrozine with.
The error is thrown when there is at least one column of type geometry in any of the tables you tried synchroning with.
The error is being thrown here.
The problem is caused by the fact that the query that you execute right before this line, returns empty result.
The result is empty because the last condition in that query is "table_name" = '${table.name}', we can see that the table.name is being set here.
The bottom line is that the data inside the column "table_name" in the table "geometry_columns" does not include schema name in it.
In order to solve this problem i think we should pass just the table name without the schema name included in it to the mentioned query.

@osher-sade
Copy link
Author

osher-sade commented Mar 24, 2020

I planned on opening a pull request, but I've noticed that the code responsible for that bug was pushed recently, in this commit.

This made me wonder if I'm using outdated versions.
I'm running with PostgreSQL 10.11 and PostGIS 2.4.3

What versions of Postgres and PostGIS you ran with? @ohjeyong @ojy6042

UPDATE: I see that there is a PR about this issue already, sorry to bother you. #5614

@RobbieGM
Copy link

RobbieGM commented May 4, 2020

@osher-sade How are you working around this for the time being? One person suggested rolling back to 0.2.22 but that didn't work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants