File tree Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,9 @@ Yii Framework 2 mongodb extension Change Log
442.1.10 under development
55------------------------
66
7- - Enh #294 : Add transactions support (ziaratban)
7+ - Enh #294 : transactions support (ziaratban)
8+ - Bug #308 : Fix ` yii\mongodb\file\Upload::addFile() ` error when uploading file with readonly permissions (sparchatus)
9+
810
911
10122.1.9 November 19, 2019
Original file line number Diff line number Diff line change @@ -30,3 +30,26 @@ yii mongodb-migrate
3030# 最後に適用されたマイグレーションを取り消す
3131yii mongodb-migrate/down
3232```
33+ ## 二つ以上の DB エンジンを使用するアプリケーションのための特殊な構成
34+
35+ アプリケーションが複数のデータベースを使う場合の例です。
36+
37+ - MySQL + MongoDB
38+
39+ マイグレーション・コマンドを実行すると、同時に MySQL と MongoDB の両方のマイグレーション・ファイルが対象として扱われます。これは両者が既定では同じフォルダを共有するためです。
40+
41+ ** 問題: MongoDB が MySQL のマイグレーション・ファイルを実行しようとし、MySQL が MongoDB のマイグレーション・ファイルを実行しようとする。**
42+
43+ この問題を回避するためには、` migrations ` フォルダの下に ` mongodb ` という新しいフォルダを作って、コンソール・アプリケーションを次のようにセットアップすることが出来ます。
44+
45+ ``` php
46+ return [
47+ // ...
48+ 'controllerMap' => [
49+ 'mongodb-migrate' => [
50+ 'class' => 'yii\mongodb\console\controllers\MigrateController',
51+ 'migrationPath' => '@app/migrations/mongodb',
52+ ],
53+ ],
54+ ];
55+ ```
Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ public function addFile($filename)
178178 $ this ->filename = basename ($ filename );
179179 }
180180
181- $ stream = fopen ($ filename , 'r+ ' );
181+ $ stream = fopen ($ filename , 'r ' );
182182 if ($ stream === false ) {
183183 throw new InvalidParamException ("Unable to read file ' {$ filename }' " );
184184 }
@@ -277,4 +277,4 @@ private function insertFile()
277277 $ this ->collection ->insert ($ fileDocument );
278278 return $ fileDocument ;
279279 }
280- }
280+ }
You can’t perform that action at this time.
0 commit comments