I'm pretty sure you are going to have to create that one specific table using DB
instead of Schema
. You should add a ticket to http://github.com/laravel/framework about supporting Azure SQL and the need for the primary key to have a clustered index according to http://blogs.msdn.com/b/sqlazure/archive/2010/04/29/10004618.aspx
The Grammar file for Sql (MSSQL), does not specify the primary key to be clustered, and there is no way to set it as such, thus Schema won't work.
Thanks. You mean using DB::statement? Argh the problem occurs with every migration I want to do (above is just one example from many). I had planned to use migrations extensively in the future with another developer joining the project. Any other idea?
Frankly I've heard of clustered index for the first time ;)
OK, problem solved.
I admit I'm a newbie. But for anyone else stumbling across this question here's the simple solution
add ->index() to the id
Schema::create('appkeys', function(Blueprint $table) {
$table->increments('id')->index();
Edit the migrations table and set a column as an index. Argh, didn't thought about that one before ;-)
Update:
In Laravel you don't necessarily need to specify the id column, it usually will be added automatically. But Laravel will not specify the id column as "index", hence when working with Azure SQL you must add the id column in your migration schema.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community