diff --git a/framework/yii/db/sqlite/Schema.php b/framework/yii/db/sqlite/Schema.php
index d4fb245..bca26c1 100644
--- a/framework/yii/db/sqlite/Schema.php
+++ b/framework/yii/db/sqlite/Schema.php
@@ -126,7 +126,13 @@ class Schema extends \yii\db\Schema
 		$sql = "PRAGMA foreign_key_list(" . $this->quoteSimpleTableName($table->name) . ')';
 		$keys = $this->db->createCommand($sql)->queryAll();
 		foreach ($keys as $key) {
-			$table->foreignKeys[] = array($key['table'], $key['from'] => $key['to']);
+			$id = (int)$key['id'];
+			if (!isset($table->foreignKeys[$id])) {
+				$table->foreignKeys[$id] = array($key['table'], $key['from'] => $key['to']);
+			} else {
+				// composite FK
+				$table->foreignKeys[$id][$key['from']] = $key['to'];
+			}
 		}
 	}
 
diff --git a/tests/unit/framework/db/sqlite/SqliteSchemaTest.php b/tests/unit/framework/db/sqlite/SqliteSchemaTest.php
index 9b17a1d..f3f6b60 100644
--- a/tests/unit/framework/db/sqlite/SqliteSchemaTest.php
+++ b/tests/unit/framework/db/sqlite/SqliteSchemaTest.php
@@ -6,9 +6,4 @@ use yiiunit\framework\db\SchemaTest;
 class SqliteSchemaTest extends SchemaTest
 {
 	protected $driverName = 'sqlite';
-
-	public function testCompositeFk()
-	{
-		$this->markTestSkipped('sqlite does not allow getting enough information about composite FK.');
-	}
 }