<?php

namespace App\Commands;

use CodeIgniter\CLI\BaseCommand;
use CodeIgniter\CLI\CLI;

class MigratePoints extends BaseCommand
{
    protected $group = 'Database';
    protected $name = 'migrate:points';
    protected $description = 'Creates the points-related database tables';

    public function run(array $params)
    {
        $migrate = \Config\Services::migrations();
        
        try {
            $migrate->setNamespace('App\Database\Migrations');
            $migrate->latest();
            
            CLI::write('Points tables migration completed successfully.', 'green');
        } catch (\Exception $e) {
            CLI::error($e->getMessage());
        }
    }
} 