Closed timsjoberg closed 12 years ago
Update: it seems to always give back 19, including on other tables. So almost certainly not a sequence thing
I think you have a config problem and I really wish I would remember what it is, but 19 as the identity is the dead give away. Please do a little bit of research into past tickets and the google group to see if you can find the answer.
https://github.com/rails-sqlserver/tiny_tds/issues/19 https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/Using-TinyTds
Thanks very much. You are right
The problem was the tds version specified in the freetds.conf file. Because Ubuntu has compiled the default version to be 4.2, I was getting errors with tables with certain data types. I (incorrectly) set the tds version to 7.0. It should be 8.0 for freetds version 0.82 and 7.1 for freetds version 0.91. In this case 0.82 was installed.
I don't know if this is a peculiarity of the database I'm connecting to, or if it's a bug in the sqlserver adapter, but some insight would be great.
I'm attempting to migrate data from a sqlserver database to a postgres database. The schemas are not the same. In my testing, I'm trying to check that associations are working as expected on the sqlserver models. I'm using activerecord 3.0.11 as associations are broken in activerecord 3.1 when connecting to multiple databases ( https://t.co/FIXFfAnG ). I'm using sqlserver adapter version 3.0.19. This is the behaviour I'm experiencing:
The model looks something like this (where HostDatabase is an abstract class inheriting from AR::Base and establishing the connection correctly):
It seems to always give 19 back in this scenario. Is it attempting to use a sequence and not doing it properly? (if this was the case, surely it should be going up?). Or is this a legitimate bug?