Forum: Ruby on Rails db_schema_dump for SQL Server

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Steve E. (Guest)
on 2006-01-20 00:20
(Received via mailing list)
We're using migrations to manage a SQL Server project and have been
into a number of issues with db_schema_dump/migrations.  Can anyone
that these are actual issues with the SQL Server adapter and not issues
me :)

1) Fields are not properly setup with proper null settings (:null =>
true /
false).  I'm wondering if we need to update the  def columns method in
include "IS_NULLABLE as NULL" in the sql we use to retrieve the columns
that the following line in schema_dumper.rb will work: "tbl.print ",
=> false" if !column.null".  That's a total guess and I'm new to Rails
so am
not exactly sure how to figure out if that would fix the issue.

2) Primary key fields are not defined as :primarykey.  This brings up
another issue in general, within migrations if we're not using the
"id" for primary key's are we screwed?

3) Some default's are not working in a way that would make sense.  For
instance a datetime column with a default of getdate() results in a
that looks like: :default => Sat Jan 01 00:00:00 Eastern Standard Time
2000.  Are there any defaults for built in RDBMS functions such as
getdate/sysdate.  If not how is that handled?

4) db_schema_dump seems to blow up when ActiveRecord::
Base.connection.instance_variable_get("@connection")["AutoCommit"] =
is not set in environment.rb, however, all other commands don't work
AutoCommit is set to true.

rake aborted!
DBI::DatabaseError: Count
    OLE error code:8000FFFF in Microsoft OLE DB Provider for SQL Server
      ITransaction::Commit or ITransaction::Abort was called, and object
in a
 zombie state.
    HRESULT error code:0x80020009
      Exception occurred.: EXEC sp_helpindex TABLENAME

Thanks for any assistance!

- Steve
This topic is locked and can not be replied to.