-
-
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
Bug on default values function? #4390
Comments
I'm having the same problem, Postgres 11.5 and typeorm 0.2.22. |
Same problem here. Postgres 9.6.10 with typeorm 0.2.22 |
I'm also seeing this; seems to be related to the default UUID value as my other defaults and auto-incrementing columns don't exhibit this issue. Postgres 11.4 As a workaround for primary columns, you can do this, at least: @PrimaryGeneratedColumn('uuid') |
Also ran into this issue. The suggestion provided by @jeffstephens worked for me. |
Hello, for those who also have the issue but doesn't want the "uuid" generated column to be a Primary Column you can also use this workaround:
|
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
(or put your version here)Steps to reproduce or a small repository showing the problem:
I believe there is an issue either with the default value functions (or I am missing something obvious).
I have a
User
entity with generated UUID following this comment (using thepgcrypto
extension):I am trying to clear all users like this
Expected Outcome
Runs through successfully every time.
Actual Outcome
All goes well the first time I run this but every subsequent time I get the following error
Digging through the code I found the error is triggered in
typeorm/src/driver/postgres/PostgresQueryRunner.ts
Line 840 in a858de1
isGenerated
is true foroldColumn
and false fornewColumn
although I changed nothing on the Entity between the 2 runs of the script)I am using Postgres 11.3 on Mac.
The text was updated successfully, but these errors were encountered: