Created
June 3, 2018 10:34
-
-
Save gubler/e14cb3e9b39b3dcaf1133bb07e6d9cfd to your computer and use it in GitHub Desktop.
Doctrine Migration for J-Mose/CommandSchedulerBundle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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