Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #3298 (closed defect: wontfix)

Opened 3 years ago

Last modified 2 years ago

Rake fails when running on unix using a sqlserver database on a remote windows host via iODBC

Reported by: david@davelee.com.au Assigned to: David
Priority: normal Milestone: 1.0
Component: ActiveRecord Version: 1.0.0
Severity: major Keywords: rake sqlserver iodbc windows databases.rake
Cc: david.lee@jobfutures.com.au, brad.garland@jobfutures.com.au, tom@popdog.net

Description

Detected running on Rails 1.0 (debian, using sqlserver via iODBC).

error in line # 53 in file /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/tasks/databases.rake

Rake assumes that if using the sqlserver adapter, we're running on Windows and have access to scptxfr

when "sqlserver"
  `scptxfr /s #{abcs[RAILS_ENV]["host"]} /d #{abcs[RAILS_ENV]["database"]} /I /f db\\#{RAILS_ENV}_structure.sql /q /A /r`
  `scptxfr /s #{abcs[RAILS_ENV]["host"]} /d #{abcs[RAILS_ENV]["database"]} /I /F db\ /q /A /r`

This may also affect Rake running on other environments where the sqlserver box is not the one running Rake.

Should check for either availability of the scptxfr tool or that we're running Windows.

Change History

12/20/05 07:17:48 changed by davelee

I've also installed the svn trunk of rails, and got three failures running the activeRecord sqlserver_odbc task, which (from memory) were to do with the comparison of text to non-text data fields.

If anyone wants to volunteer their email address for discussion i'm happy to have a crack at fixing these - but may need to discuss them with someone knowledgeable with the inner workings of ActiveRecord.

02/13/06 17:40:15 changed by jchilders@hotels.com

Actually I'm not sure if this will be as easy as testing for the presence/absence of those utilities. These tasks are used in generating the script that recreates the tables for the test database and are dependent upon database-specific utilities to do what they need to do, in this case utilities provided by MS that are obviously not going to be available for various *nix flavors.

This may be difficult to fix because to my knowledge there is no native way within T-SQL on SQL Server to generate a table creation script. MySQL does, of course, in its SHOW CREATE TABLE command. If there is an analogue within SQL Server I am unaware of it.

02/14/06 00:01:39 changed by Brad Garland

While there is no built-in way of generating the scripts, I saw this article that shows how a stored procedure can call the SQL-DMO to generate the scripts. The script would need some additional work to iterate through the tables etc. This might be a step in the right direction.

See http://www.databasejournal.com/features/mssql/article.php/2205291.

08/24/06 19:17:59 changed by tomafro

  • cc changed from david.lee@jobfutures.com.au, brad.garland@jobfutures.com.au to david.lee@jobfutures.com.au, brad.garland@jobfutures.com.au, tom@popdog.net.
  • status changed from new to closed.
  • resolution set to wontfix.

ActiveRecord can now dump most schema information to its own format without using scptxfr, which should be sufficient for most cases. There will be no support for dumping schemas to plain sql on platforms other than windows.