【发布时间】:2017-11-07 11:51:59
【问题描述】:
我正在创建如下迁移。我找不到播种数据库的方法。 在 laravel 中寻找类似 db:seed 的东西?
public function up(Schema $schema)
{
$table = $schema->createTable('user_map');
$table->addColumn('id', 'integer', ['autoincrement'=>true]);
$table->addColumn('user_id', 'integer', ['notnull'=>true]);
$table->addColumn('relation_id', 'integer', ['notnull'=>true]);
$table->setPrimaryKey(['id']);
$table->addOption('engine' , 'InnoDB');
}
【问题讨论】:
-
您是在使用
config/cli-config.php文件以独立运行您的迁移,还是使用其他东西来集成您的学说迁移?你也看过github.com/doctrine/data-fixtures 吗?
标签: php doctrine zend-framework3