code: protected function getCreateTableSql($table)
      {
          $row = $this->db->createCommand('SHOW CREATE TABLE ' . $this->quoteTableName($table->fullName))->queryOne();
          if (isset($row['Create Table'])) {
              $sql = $row['Create Table'];
          } else {
              $row = array_values($row);
              $sql = $row[1];
          }
  
          return $sql;
      }
docs: Gets the CREATE TABLE sql string.
  @param TableSchema $table the table metadata
  @return string $sql the result of 'SHOW CREATE TABLE'