DataDogAuditBundle icon indicating copy to clipboard operation
DataDogAuditBundle copied to clipboard

1.0-dev: inserting associations causes error on Postgres

Open acornforth opened this issue 2 years ago • 3 comments

Looks like it could be an unintended consequence of the mapping changes in previous commits, and may only affect postgres, I'm not using this bundle with any other DB platforms at the moment so unable to confirm if it happens on Mysql, SQLite etc ...

(https://user-images.githubusercontent.com/4586381/157653353-4d1724d1-9249-46e6-aa12-ce9234b9ba86.png) exception

Originally posted by @acornforth in https://github.com/DATA-DOG/DataDogAuditBundle/pull/93#issuecomment-1063958924

acornforth avatar Mar 10 '22 12:03 acornforth

This is likely caused by setting the ID strategy to AUTO, which was intended to make this more portable as Doctrine would then choose the appropriate method for setting the ID. I'll take a closer look and see what we can do here.

natewiebe13 avatar Mar 10 '22 14:03 natewiebe13

@natewiebe13 I tested this on postgres with IDENTITY strategy, and everything seems to behave as expected, it also when generating migrations, didn't drop the DEFAULT expression on the id column. I think this could be the way to go.

acornforth avatar Mar 17 '22 14:03 acornforth

Fixed (theoretically) in #93

acornforth avatar Apr 08 '22 15:04 acornforth