Commit a977d820 by gevik

Replaced dropConstraint with dropPrimarykey method.

parent 3796db7d
...@@ -288,15 +288,16 @@ class QueryBuilder extends \yii\base\Object ...@@ -288,15 +288,16 @@ class QueryBuilder extends \yii\base\Object
} }
/** /**
* Builds a SQL statement for removing a constraint to an existing table. * Builds a SQL statement for removing a primary key constraint to an existing table.
* @param string $name the name of the constraint to be removed. * @param string $name the name of the primary key constraint to be removed.
* @param string $table the table that constraint will be removed from. * @param string $table the table that the primary key constraint will be removed from.
* @return string the SQL statement for removing constraint from an existing table. * @return string the SQL statement for removing a primary key constraint from an existing table. *
*/ */
public function dropConstraint($name,$table) public function dropPrimarykey($name,$table)
{ {
return 'ALTER TABLE ' . $this->quoteTableName($table) . ' DROP CONSTRAINT ' return 'ALTER TABLE ' . $this->db->quoteTableName($table)
. $this->quoteColumnName($name); . ' DROP CONSTRAINT ' . $this->db->quoteColumnName($name);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment