Skip to content

Commit

Permalink
fix: enable for mariadb
Browse files Browse the repository at this point in the history
  • Loading branch information
WatheqAlshowaiter committed Aug 20, 2024
1 parent e4ee7a3 commit 2802d55
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function up(): void
$table->string('last_name'); // required
$table->string('email'); // required

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

public function down(): void
{
Schema::dropIfExists('parent_test_models');
Schema::dropIfExists('fathers');
}
}
1 change: 0 additions & 1 deletion src/BackupTablesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ protected function backupTablesForSqlite($newTableName, $table)
protected function backupTablesForForMysqlAndMariaDb($newTableName, $table): array
{
DB::statement(/**@lang MySQL**/ "CREATE TABLE $newTableName AS SELECT * FROM $table");
//DB::statement(/**@lang MySQL**/ "INSERT INTO $newTableName SELECT * FROM $table");

$newCreatedTables[] = $newTableName;
$response[] = " Table '$table' cloned successfully.";
Expand Down

0 comments on commit 2802d55

Please sign in to comment.