title: yii2 sqlite fails to resolve table names
body: <p>I found some bug in sqlite-conf, I don't know, but it doesnt seems to work as it intended.
  The thing I have the following <code>db.php</code> file</p>
  
  <pre><code>return [
  'class' =&gt; 'yii\db\Connection',
  'dsn' =&gt; 'sqlite:somedb',
  'charset' =&gt; 'utf8',
  </code></pre>
  
  <p>];</p>
  
  <p>I can create and run migrations </p>
  
  <pre><code>    use yii\db\Migration;
      use yii\db\sqlite\Schema;
  
  class m160222_083002_create_some_table extends Migration
  {
      public function up()
      {
          $this-&gt;createTable('some_table', [
              'id' =&gt; Schema::TYPE_PK,
              'name' =&gt; Schema::TYPE_STRING
          ]);
      }
  
      public function down()
      {
          $this-&gt;dropTable('some_table');
      }
  }
  </code></pre>
  
  <p>these are works fine, creates table etc. </p>
  
  <pre><code>    $ ./yii migrate
  Yii Migration Tool (based on Yii v2.0.7)
  
  Total 1 new migration to be applied:
          m160222_083002_create_some_table
  
  Apply the above migration? (yes|no) [no]:y
  *** applying m160222_083002_create_some_table
      &gt; create table some_table ... done (time: 0.109s)
  *** applied m160222_083002_create_some_table (time: 0.170s)
  
  
  1 migration was applied.
  
  Migrated up successfully.
  </code></pre>
  
  <p>But then comes some magic.
  I <strong>can't</strong> use gii generators from my local server, e.g.</p>
  
  <pre><code>somelocal.loc/gii/model
  </code></pre>
  
  <p>when I enter table name like</p>
  
  <blockquote>
    <p>some_table</p>
  </blockquote>
  
  <p>Answer is</p>
  
  <blockquote>
    <p>Table 'some_table' does not exist.</p>
  </blockquote>
  
  <p>However running gii model generator from CLI runs perfect </p>
  
  <pre><code>    $ ./yii gii/model --tableName=some_table --modelClass=someTable
  Running 'Model Generator'...
  
  The following files will be generated:
          [new] models/someTable.php
  
  Ready to generate the selected files? (yes|no) [yes]:y
  
  Files were generated successfully!
  Generating code using template "/var/www/sweethouse.loc/vendor/yiisoft/yii2-gii/generators/model/default"...
   generated models/someTable.php
  done!
  </code></pre>
  
  <p>it generates the following code </p>
  
  <pre><code>    namespace app\models;
  
  use Yii;
  
  /**
   * This is the model class for table "some_table".
   *
   * @property integer $id
   * @property string $name
   */
  class someTable extends \yii\db\ActiveRecord
  {
      /**
       * @inheritdoc
       */
      public static function tableName()
      {
          return 'some_table';
      }
  
      /**
       * @inheritdoc
       */
      public function rules()
      {
          return [
              [['name'], 'string', 'max' =&gt; 255]
          ];
      }
  
      /**
       * @inheritdoc
       */
      public function attributeLabels()
      {
          return [
              'id' =&gt; 'ID',
              'name' =&gt; 'Name',
          ];
      }
  }
  </code></pre>
  
  <p>But if only </p>
  
  <pre><code>somelocal.loc/gii/model
  </code></pre>
  
  <p>didn't work, that wouldn't be pity, CLI generator is more friendly.</p>
  
  <p>But the most important problem for me that mysite cant resolve tablenames,
  ActiveRecord doesn't see it, and crashes site with following error</p>
  
  <pre><code>    Database Exception – yii\db\Exception
  
  SQLSTATE[HY000]: General error: 1 no such table: some_table
  Failed to prepare SQL: SELECT * FROM `some_table`
  Error Info: Array
  (
      [0] =&gt; HY000
      [1] =&gt; 1
      [2] =&gt; no such table: some_table
  )
  ↵
  Caused by: PDOException
  
  SQLSTATE[HY000]: General error: 1 no such table: some_table
  
  in /var/www/mysite/vendor/yiisoft/yii2/db/Command.php at line 225
  </code></pre>
  
  <p>And controller action, where I want to access my table values</p>
  
  <pre><code>public function actionSome()
  {
      $some = someTable::find()-&gt;all();
  
      return $this-&gt;render('some',[
          'some' =&gt; $some
      ]);
  }
  </code></pre>
  
  <p>The following error comes only with sqlite3 database</p>