yii2 Миграция из SQL файла -- как загрузкить дамп. Пример миграции
Primary tabs
Используйте:
$this->execute()
Например:
<?php use yii\db\Migration; /** * Class m180621_120026_install_mgd_old_users_dump */ class m185521_188026_install_old_users_dump extends Migration { public $maxSqlOutputLength = 100; /** * {@inheritdoc} */ public function safeUp() { $this->execute( file_get_contents( __DIR__ . '/dumps/user_dump.sql') ); }
- Log in to post comments
- 2555 reads