|
|
|
@ -206,6 +206,17 @@ class QueryBuilder extends \yii\db\QueryBuilder
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Builds a SQL statement for truncating a DB table. |
|
|
|
|
* Explicitly restarts identity for PGSQL to be consistent with other databases which all do this by default. |
|
|
|
|
* @param string $table the table to be truncated. The name will be properly quoted by the method. |
|
|
|
|
* @return string the SQL statement for truncating a DB table. |
|
|
|
|
*/ |
|
|
|
|
public function truncateTable($table) |
|
|
|
|
{ |
|
|
|
|
return 'TRUNCATE TABLE ' . $this->db->quoteTableName($table) . ' RESTART IDENTITY'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Builds a SQL statement for changing the definition of a column. |
|
|
|
|
* @param string $table the table whose column is to be changed. The table name will be properly quoted by the method. |
|
|
|
|
* @param string $column the name of the column to be changed. The name will be properly quoted by the method. |
|
|
|
|