These are chat archives for rails-sqlserver/activerecord-sqlserver-adapter

16th
Jul 2015
Joe Francis
@lostapathy
Jul 16 2015 21:51
Is there a straightforward way to get the schema dumper to kick out non-native ruby code, so other DB adapters can load a schema this gem dumps? We had pretty good luck with that on 4.1, but not on 4.2. Not sure if that's something to tackle in this gem or in activerecord.
Ken Collins
@metaskills
Jul 16 2015 23:10
Reading...
Hmmm… can you give me an example of the non-native?
Like smallmoney?
Hmmm… so this is a catch 22.
Ken Collins
@metaskills
Jul 16 2015 23:16
The upshot is that we can really support some crazy edge cases and make the adapter work for these non “rails simplified" types.
The flip side is that these types are now, rightly so, hooked up to the schema dumper.
cc @lostapathy
Many times in the past, people wanted to allow developers to “develop” on something like MySQL vs SQL Server by leveraging the basic schema.rb. This was usually the case because we had horrible support for the ActiveRecord rake tasks to setup and clone the database.
That is not the case anymore with 4.2. So if that was your reason too, then perhaps just use SQL Server accross the board.
Ken Collins
@metaskills
Jul 16 2015 23:22
Alternatives could be a monkey patch gem that overrides the type propery of a few of ours to use a simplifed type. For example changing this (https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/master/lib/active_record/connection_adapters/sqlserver/type/small_money.rb) to something like :decimal.
Note, this adapter is not alone in the new schema.rb types. The PostgreSQL adapter has great support for non simplified types and I believe these show up properly in the ruby schema.rb (PG only) too.
HTH