forked from rails-sqlserver/activerecord-sqlserver-adapter
-
Notifications
You must be signed in to change notification settings - Fork 0
Using Azure
metaskills edited this page Apr 1, 2011
·
9 revisions
- Version 3.0.12 and up of the adapter is compatible with SQL Azure.
- You must use the DBLIB connection mode which uses the TinyTDS gem. Please read both the Using TinyTDS wiki page and the Using TinyTDS with Azure section of the TinyTDS README file. TL;DR, you must be using the latest FreeTDS 0.91 compiled with OpenSSL. Also, you must use “azure: true” in the database.yml.
- All tables need a clustered index. This means that if you use :id => false in your schema statements for things like join tables you will get an “Tables without a clustered index are not supported…” message when inserting data. The solution is easy, just add a :primary_key field of some type. Even if you do not directly use it. Primary keys are automatically clustered. IMPORTANT, the [schema_migrations] table will need an you to add this too.
-
SQL Azure has no system sp_MSforeachtable stored procedure. The adapter makes use of this when disabling referential integrity for fixture insertion. If you use Azure for a test database and run into this issue, I recommend you copy both sp_MSforeachtable and sp_MSforeach_worker from a standard SQL Server. I used
this code https://gist.github.com/893599