Skip to content

Instantly share code, notes, and snippets.

@gubler
Created June 3, 2018 10:34
Show Gist options
  • Select an option

  • Save gubler/e14cb3e9b39b3dcaf1133bb07e6d9cfd to your computer and use it in GitHub Desktop.

Select an option

Save gubler/e14cb3e9b39b3dcaf1133bb07e6d9cfd to your computer and use it in GitHub Desktop.
Doctrine Migration for J-Mose/CommandSchedulerBundle
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Command Scheduler table.
*/
class Version2_command_scheduler extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema): void
{
$table = $schema->createTable('scheduled_command');
$table->addColumn('id', 'integer', ['autoincrement' => true]);
$table->addColumn('name', 'string', ['length' => 100]);
$table->addColumn('command', 'string', ['length' => 100]);
$table->addColumn('arguments', 'string', ['length' => 250, 'notnull' => false]);
$table->addColumn('cron_expression', 'string', ['length' => 100, 'notnull' => false]);
$table->addColumn('last_execution', 'datetime');
$table->addColumn('last_return_code', 'integer', ['notnull' => false]);
$table->addColumn('log_file', 'string', ['length' => 100, 'notnull' => false]);
$table->addColumn('priority', 'integer');
$table->addColumn('execute_immediately', 'boolean');
$table->addColumn('disabled', 'boolean');
$table->addColumn('locked', 'boolean');
$table->setPrimaryKey(['id']);
}
/**
* @param Schema $schema
*/
public function down(Schema $schema): void
{
$schema->dropTable('scheduled_command');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment