Skip to content

Commit

Permalink
Dev Small MSSQL fix when dropping a primary key
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Aug 3, 2015
1 parent d876e58 commit 2066521
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions application/helpers/update/updatedb_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2200,12 +2200,14 @@ function modifyPrimaryKey($sTablename, $aColumns)

function dropPrimaryKey($sTablename)
{
debugbreak();
switch (Yii::app()->db->driverName){
case 'mysql':
$sQuery="ALTER TABLE {{".$sTablename."}} DROP PRIMARY KEY";
Yii::app()->db->createCommand($sQuery)->execute();
break;
case 'pgsql':
case 'sqlsrv':
case 'mssql':
$pkquery = "SELECT CONSTRAINT_NAME "
."FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS "
Expand Down

0 comments on commit 2066521

Please sign in to comment.