CodeIgniter Forums
dbforge mssql problem. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: dbforge mssql problem. (/showthread.php?tid=54172)



dbforge mssql problem. - El Forum - 08-27-2012

[eluser]ghst[/eluser]
Hi. I'm using dbforge for mssql driver.

Trying to add to my "ID" int AUTO_INCREMENT = TRUE, but nothing happens.

MS SQL syntax does not have such thing like auto_increment, in syntax there is IDENTITY.
So if i open mssql_forge.php file and change AUTO_ICREMENT to IDENTITY then my code works and dbforge sets identity to column = TRUE

This is my code from mssql_forge.php file:

Code:
//if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE)
//{
// $sql .= ' AUTO_INCREMENT';
//}
  
if (array_key_exists('IDENTITY', $attributes) && $attributes['IDENTITY'] === TRUE)
{
$sql .= ' IDENTITY';
}

Is this a bug ? Or i'm doing something wrong.


dbforge mssql problem. - El Forum - 02-22-2013

[eluser]Unknown[/eluser]
Looks like a bug to me too. Your fix worked. Thanks.