Db_schema_dump for SQL Server

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 :slight_smile:

  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

  1. Are there any defaults for built in RDBMS functions such as
    getdate/sysdate. If not how is that handled?
  1. 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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs