title: Alter primary key column datatype by EF code first migration
body: <p>I want to change the datatype of a column which is the primary key and I am using Azure DB.
  There are two tables where I need to change the datatype from short(smallint) to int(int).
  One of the two is Clustered and the other is non-clustered. I have tried altering the columns like the following. </p>
  
  <p><strong>UP()</strong></p>
  
  <pre><code>DropPrimaryKey("dbo.Client", "PK__Client__D830D4762CDA5F5E");
  DropPrimaryKey("dbo.ClientCustomFields", "PK_ClientCustomFields");
  
  AlterColumn("dbo.Client", "cId", c =&gt; c.Int(nullable: false, identity: true));
  AlterColumn("dbo.ClientCustomFields", "cId", c =&gt; c.Int(nullable: false));
  
  AddPrimaryKey("dbo.Client", "cId", "PK__Client__D830D4762CDA5F5E");
  AddPrimaryKey("dbo.ClientCustomFields", new[] {"cId", "ccfGUID"}, "PK_ClientCustomFields");
  </code></pre>
  
  <p><strong>Client Pimary Key</strong></p>
  
  <pre><code>ALTER TABLE [dbo].[Client] ADD PRIMARY KEY NONCLUSTERED 
  (
  [cId] ASC
  )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON)
  </code></pre>
  
  <p><strong>ClientCustomFields Pimary Key</strong></p>
  
  <pre><code>ALTER TABLE [dbo].[ClientCustomFields] ADD  CONSTRAINT [PK_ClientCustomFields] PRIMARY KEY CLUSTERED 
  (
  [cId] ASC,
  [ccfGUID] ASC
  )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON)
  </code></pre>
  
  <p>The problem is, The Clustered index was not being removed due to be the Azure DB storage rules, that we can't remove the index. 
  Please help.
  One more thing, the cId in Clients table is an autoincrement field. I think identity:true will handle that. Please suggest if that doesn't.</p>
  
  <p>Thanks.</p>