-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
postgres: Inappropiate migration generated for 'default: null' #6950
Comments
@brahn I have the same issue. Looking at #150 (comment) , it appears as a temporary workaround we can do @Column({ type: "text", nullable: true, default: () => "NULL" }) Let me know if this works for you |
@vegerot that doesn't seem to have changed anything for me -- thanks for the suggestion, though! |
Sorry to hear that. Me neither. Hopefully we can get a response from a maintainer soon |
Having the same weird behavior, same TypeORM setup and version. |
To be more specific, when you generate multiple new migrations, each time the case of For example, at first it will say query: ALTER TABLE "air_refuels" ALTER COLUMN "missionId" SET DEFAULT null then after I run that migration, and gen a new one, the next migration will say query: ALTER TABLE "air_refuels" ALTER COLUMN "missionId" SET DEFAULT NULL After you run the next migration, generating yet another migration produces query: ALTER TABLE "air_refuels" ALTER COLUMN "missionId" SET DEFAULT null I don't think @brahn noticed this when writing the issue. This certainly seems like a TypeORM bug. Please let me know what I can do to help resolve it |
This commit adds tests to demonstrate the bug found in typeorm#6950
This commit adds tests to demonstrate the bug found in typeorm#6950
Issue type:
[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:
[ ]
latest
[ ]
@next
[x]
0.2.28
Steps to reproduce or a small repository showing the problem:
This issue appears very similar to #5509 but for postgres.
Minimal entity declaration:
Even after syncing the schema, generating a migration still results in the lines
Expected behavior: the migration should not include these lines.
The text was updated successfully, but these errors were encountered: