Skip to content

Commit

Permalink
Merge branch 'feature/console-command' of github.com:WatheqAlshowaite…
Browse files Browse the repository at this point in the history
…r/backup-tables into feature/console-command
  • Loading branch information
WatheqAlshowaiter committed Jan 28, 2025
2 parents ff8dfee + 1d4f323 commit f84a835
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Commands/BackupTableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
class BackupTableCommand extends Command
{
const SUCCESS = 0;

const FAILURE = 1;

protected $signature = 'backup:tables {targets* : The table names or model classes to backup (space-separated)}';

protected $description = 'Backup a specific database table/s based on provided table names or model classes';
Expand All @@ -22,12 +24,14 @@ public function handle()

if (! $result) {
$this->error('Failed to backup table.');

return self::FAILURE;
}

return self::SUCCESS;
} catch (\Exception $e) {
$this->error("Error backing up table: {$e->getMessage()}");

return self::FAILURE;
}
}
Expand Down

0 comments on commit f84a835

Please sign in to comment.