Skip to content

Commit 2802d55

Browse files
fix: enable for mariadb
1 parent e4ee7a3 commit 2802d55

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

database/migrations/2024_07_13_090447_create_fathers_table.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function up(): void
1818
$table->string('last_name'); // required
1919
$table->string('email'); // required
2020

21-
if (DB::getDriverName() == 'mysql') {
21+
if (DB::getDriverName() == 'mysql'|| DB::getDriverName() == 'mariadb') {
2222
$table->string('full_name')->virtualAs("CONCAT(first_name, ' ', last_name)");
2323
$table->string('status')->storedAs('IF(active = 1, TRUE, FALSE)');
2424
}
@@ -43,6 +43,6 @@ public function up(): void
4343

4444
public function down(): void
4545
{
46-
Schema::dropIfExists('parent_test_models');
46+
Schema::dropIfExists('fathers');
4747
}
4848
}

src/BackupTablesService.php

-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ protected function backupTablesForSqlite($newTableName, $table)
123123
protected function backupTablesForForMysqlAndMariaDb($newTableName, $table): array
124124
{
125125
DB::statement(/**@lang MySQL**/ "CREATE TABLE $newTableName AS SELECT * FROM $table");
126-
//DB::statement(/**@lang MySQL**/ "INSERT INTO $newTableName SELECT * FROM $table");
127126

128127
$newCreatedTables[] = $newTableName;
129128
$response[] = " Table '$table' cloned successfully.";

0 commit comments

Comments
 (0)