Skip to content

Commit 837c14c

Browse files
softarksamdark
authored andcommitted
Updated Japanese docs (#292) [skip ci]
1 parent 22602c1 commit 837c14c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/guide-ja/topics-migrations.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,26 @@ yii mongodb-migrate
3030
# 最後に適用されたマイグレーションを取り消す
3131
yii 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+
```

0 commit comments

Comments
 (0)