|
...
|
...
|
@@ -103,8 +103,8 @@ class Demo extends Command |
|
|
|
public function copyProduct(){
|
|
|
|
$tableName = 'gl_product';
|
|
|
|
$copyTableName = 'gl_product_c';
|
|
|
|
if (Schema::hasTable($copyTableName)) {
|
|
|
|
DB::statement("DROP TABLE {$copyTableName}");
|
|
|
|
if (Schema::connection('custom_mysql')->hasTable($copyTableName)) {
|
|
|
|
DB::connection('custom_mysql')->statement("DROP TABLE {$copyTableName}");
|
|
|
|
}
|
|
|
|
// 创建新表并复制数据
|
|
|
|
DB::connection('custom_mysql')->statement("CREATE TABLE {$copyTableName} LIKE {$tableName}");
|
...
|
...
|
|