Closed hjalet closed 6 years ago
Just an addition to the above.
I also happens using a simple struct with no "foreign key" relations, only values.
I will try to recreate scenario.
How did you map relationship between Permissions in Role model. Did you used through: :role_permissions?
Also, did you you use binary_id or auto increment integer for primary key?
Never mind, I found that this is issue when primary key is set to @primary_key [:id, :id, auto_generate: true].
What happens is that this is tds lib issue. It fails to count number of rows in result. I will fix this in tds project, and let you know.
Thanks for reporting this issue.
Thanks for the quick reply. Let me know if you anything further from me. I will be happy to try and test it when you have a fix.
It is fixed now in https://hexdocs.pm/tds/1.0.3 try to update deps in your project mix deps.update tds
Thanks, I have tried it and it works.
Hi,
I am trying to get my existing project to work on SQL Server using tdc_ecto. The project already runs and works on MySQL including the below failing code.
I am using tds_ecto version 2.0.3.
My seeds.exs script is trying to insert some data and it fails on the first insert. I have replicated the error in iex, and the iex output is shown below:
Below I perform a select on the table to make sure it is in fact empty.
The DB structure is a classic roles->roles_permissions->permission structure where the Role struct has a many-to-many relation with the Permission struct.
Any ideas as to what goes wrong?