作者 lyh

gx

... ... @@ -102,6 +102,8 @@ class Demo extends Command
// }
public function handle(){
//切换数据库配置
ProjectServer::useProject(1862);
return $this->initTable(1380,1862);
}
... ... @@ -112,7 +114,6 @@ class Demo extends Command
$tables = Schema::connection('custom_tmp_mysql_copy')->getAllTables();
$tables = array_column($tables, 'Tables_in_' . $database_name);
foreach ($tables as $table) {
config(['database.connections.custom_mysql.database' => 'gl_data_' . $news_project_id]);
$has_table = Schema::connection('custom_mysql')->hasTable($table);
if (!$has_table) {
$sql = DB::connection('custom_tmp_mysql_copy')->select("SHOW CREATE TABLE {$table}");
... ...