Support the ongoing development of Laravel.io →
posted 10 years ago
Database
Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

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 ;)

Last updated 2 years ago.
0

OK, problem solved.

I admit I'm a newbie. But for anyone else stumbling across this question here's the simple solution

1.

add ->index() to the id

        Schema::create('appkeys', function(Blueprint $table) {
            $table->increments('id')->index();

2.

Edit the migrations table and set a column as an index. Argh, didn't thought about that one before ;-)

Update:

General

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.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

pknecht pknecht Joined 8 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.