diff --git a/framework/yii/db/pgsql/Schema.php b/framework/yii/db/pgsql/Schema.php index 20c6fb6..2dbe111 100644 --- a/framework/yii/db/pgsql/Schema.php +++ b/framework/yii/db/pgsql/Schema.php @@ -303,7 +303,7 @@ SQL; $column->dbType = $info['data_type']; $column->defaultValue = $info['column_default']; $column->enumValues = explode(',', str_replace(["''"], ["'"], $info['enum_values'])); - $column->unsigned = false; // has no meanining in PG + $column->unsigned = false; // has no meaning in PG $column->isPrimaryKey = $info['is_pkey']; $column->name = $info['column_name']; $column->precision = $info['numeric_precision']; diff --git a/framework/yii/db/sqlite/Schema.php b/framework/yii/db/sqlite/Schema.php index 294c97e..38fbf3a 100644 --- a/framework/yii/db/sqlite/Schema.php +++ b/framework/yii/db/sqlite/Schema.php @@ -153,7 +153,7 @@ class Schema extends \yii\db\Schema $column->type = self::TYPE_STRING; if (preg_match('/^(\w+)(?:\(([^\)]+)\))?/', $column->dbType, $matches)) { - $type = $matches[1]; + $type = strtolower($matches[1]); if (isset($this->typeMap[$type])) { $column->type = $this->typeMap[$type]; } diff --git a/tests/unit/framework/db/sqlite/SqliteActiveRecordTest.php b/tests/unit/framework/db/sqlite/SqliteActiveRecordTest.php index 659908e..6f499bb 100644 --- a/tests/unit/framework/db/sqlite/SqliteActiveRecordTest.php +++ b/tests/unit/framework/db/sqlite/SqliteActiveRecordTest.php @@ -36,10 +36,10 @@ class SqliteActiveRecordTest extends ActiveRecordTest $this->assertTrue(0 == $customer->status); // select with boolean values does not seem to work in sqlite -// $customers = Customer::find()->where(['status' => true])->all(); -// $this->assertEquals(2, count($customers)); -// -// $customers = Customer::find()->where(['status' => false])->all(); -// $this->assertEquals(1, count($customers)); + $customers = Customer::find()->where(['status' => true])->all(); + $this->assertEquals(2, count($customers)); + + $customers = Customer::find()->where(['status' => false])->all(); + $this->assertEquals(1, count($customers)); } }