-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
单表怎么生成? #23
Comments
$migrateGenerator = (new MigrateGenerator('laravel'));
$tables = $migrateGenerator->getDatabase()->getAllTables();
foreach ($tables as $key => $table) {
file_put_contents(database_path( 'migrations/') . date('Y_m_d_His') . '_' . $table->getName(). '.php' ,
$migrateGenerator->getMigrationContent($table));
$this->info(sprintf('%s table migration file generated', $table->getName()));
} 目前没有单独生成的 command,但是你可以根绝上面的代码,单独写一个单表生成的,只需要给出表名就行 |
好的,明白了,谢谢🙏wlzxdm在 2023年5月1日,20:05,JaguarJack ***@***.***> 写道:
$migrateGenerator = (new MigrateGenerator('laravel'));
$tables = $migrateGenerator->getDatabase()->getAllTables();
foreach ($tables as $key => $table) {
file_put_contents(database_path( 'migrations/') . date('Y_m_d_His') . '_' . $table->getName(). '.php' ,
$migrateGenerator->getMigrationContent($table));
$this->info(sprintf('%s table migration file generated', $table->getName()));
}
目前没有单独生成的 command,但是你可以根绝上面的代码,单独写一个单表生成的,只需要给出表名就行
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
您好,问下单表怎么生成?全部生成已经有的不会覆盖,每次都新加。
The text was updated successfully, but these errors were encountered: