There are new fields for the database. Please run migrations. (see README.md)
php bin/console make:migration
php bin/console doctrine:migrations:migrateVersion 6 introduces extensible entity architecture. If you want to extend the ScheduledCommand entity with custom fields:
Important: Custom entities MUST extend BaseScheduledCommand. Implementing only ScheduledCommandInterface is not supported, as validation constraints and ORM mappings are defined on the base class.
- Create your custom entity extending
BaseScheduledCommand:
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Dukecity\CommandSchedulerBundle\Entity\BaseScheduledCommand;
#[ORM\Entity]
#[ORM\Table(name: 'scheduled_command')]
class MyScheduledCommand extends BaseScheduledCommand
{
#[ORM\Column(type: 'string', nullable: true)]
private ?string $customField = null;
// getters/setters...
}- Configure the bundle to use your entity:
# config/packages/dukecity_command_scheduler.yaml
dukecity_command_scheduler:
scheduled_command_class: App\Entity\MyScheduledCommand- Create a migration for any custom columns:
php bin/console make:migration
php bin/console doctrine:migrations:migrateNote: When you configure a custom entity class, the bundle automatically excludes its default ScheduledCommand entity from Doctrine mappings to prevent table name conflicts.
Important: The base table structure (scheduled_command) is unchanged, so your existing data will continue to work with your custom entity class. Only custom fields you add require a migration.