You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am migrating an existing Postgres DB to Typeorm. I generated the entities using this package. My entities were generated correctly and schema sync was also able to recreate all my tables on a fresh instance. But the problem is that if I try to run schema:sync again, it starts executing the same queries again even though all the tables & constraints are already there.
I tried to look into existing issues and found one similar issue #3907 . On removing the { schema: 'public' } from my entities, the create table queries were fixed & not getting recreated but the indexes and constraints are still getting dropped & recreated. Also I don't think removing schema is a permanent solution since I wish to use multiple schemas. Could someone point me in the right direction here. Thanks.
Expected Behavior
The create table/indexes/constraints queries to be executed on first schema sync and thereafter no queries should be executed if no entity changes are present
Actual Behavior
Check issue description
Steps to Reproduce
Not sure. I guess creating any entity with schema decorator could result in this issue.
My Environment
Dependency
Version
Operating System
Mac
Node.js version
v12.16.3
Typescript version
v4.1.3
TypeORM version
v0.2.29
Project
Nest.js
Additional Context
Relevant Database Driver(s)
aurora-data-api
aurora-data-api-pg
better-sqlite3
cockroachdb
cordova
expo
mongodb
mysql
nativescript
oracle
postgres
react-native
sap
sqlite
sqlite-abstract
sqljs
sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
Yes, I have the time, and I know how to start.
Yes, I have the time, but I don't know how to start. I would need guidance.
No, I don't have the time, although I believe I could do it if I had the time...
No, I don't have the time and I wouldn't even know how to start.
The text was updated successfully, but these errors were encountered:
…ry queries during schema sync (#7575)
* working on #7276
* minor fix
* fix#7276
* lint fix
* added `getCurrentDatabase()` and `getCurrentSchema()` methods in QueryRunner
* fixed falling test;
* fixed default schema in other drivers
Issue Description
I am migrating an existing Postgres DB to Typeorm. I generated the entities using this package. My entities were generated correctly and schema sync was also able to recreate all my tables on a fresh instance. But the problem is that if I try to run schema:sync again, it starts executing the same queries again even though all the tables & constraints are already there.
Attaching one of my entity files
I tried to look into existing issues and found one similar issue #3907 . On removing the
{ schema: 'public' }
from my entities, the create table queries were fixed & not getting recreated but the indexes and constraints are still getting dropped & recreated. Also I don't think removing schema is a permanent solution since I wish to use multiple schemas. Could someone point me in the right direction here. Thanks.Expected Behavior
The create table/indexes/constraints queries to be executed on first schema sync and thereafter no queries should be executed if no entity changes are present
Actual Behavior
Check issue description
Steps to Reproduce
Not sure. I guess creating any entity with schema decorator could result in this issue.
My Environment
Additional Context
Relevant Database Driver(s)
aurora-data-api
aurora-data-api-pg
better-sqlite3
cockroachdb
cordova
expo
mongodb
mysql
nativescript
oracle
postgres
react-native
sap
sqlite
sqlite-abstract
sqljs
sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
The text was updated successfully, but these errors were encountered: