Files
rspade_system/app/RSpade/Commands/Restricted/Restricted_Database_Command.php
root f6fac6c4bc Fix bin/publish: copy docs.dist from project root
Fix bin/publish: use correct .env path for rspade_system
Fix bin/publish script: prevent grep exit code 1 from terminating script

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 02:08:33 +00:00

61 lines
2.1 KiB
PHP
Executable File

<?php
namespace App\RSpade\Commands\Restricted;
use Illuminate\Console\Command;
/**
* Base class for restricted database commands in the RSpade framework
*
* This class provides a standardized response for database operations that are
* intentionally restricted to maintain data integrity and provide guardrails
* for automated systems and AI agents.
*/
abstract class Restricted_Database_Command extends Command
{
/**
* Indicates whether the command should be shown in the Artisan command list.
*
* @var bool
*/
protected $hidden = true;
/**
* The console command description.
*
* @var string
*/
protected $description = '[RESTRICTED] This command has been restricted in RSX';
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$this->error('This command has been restricted in RSX.');
$this->newLine();
$this->warn('Database Migration Policy:');
$this->info('RSX enforces a forward-only migration strategy to ensure data integrity and system stability.');
$this->newLine();
$this->line('• Only forward migrations are permitted (php artisan migrate)');
$this->line('• Rollback operations are disabled to prevent data loss');
$this->line('• Database resets and refresh operations are not allowed');
$this->line('• Schema modifications must be handled through new migrations');
$this->newLine();
$this->info('This policy provides essential guardrails for:');
$this->line('• Production environment safety');
$this->line('• Automated deployment systems');
$this->line('• AI-assisted development workflows');
$this->line('• Multi-tenant data integrity');
$this->newLine();
$this->warn('Alternative approaches:');
$this->line('• To modify schema: Create a new migration file');
$this->line('• To fix issues: Create corrective migrations');
$this->line('• For development: Use database snapshots or dumps');
$this->newLine();
return 1; // Return error code
}
}