Skip to content

Commit

Permalink
Add migration
Browse files Browse the repository at this point in the history
  • Loading branch information
josegonzalez committed Apr 24, 2016
1 parent 9858038 commit ff7d211
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions config/Migrations/20151216071227_CreateJobs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php
use Migrations\AbstractMigration;

class CreateJobs extends AbstractMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-change-method
* @return void
*/
public function change()
{
$table = $this->table('jobs');
$table->addColumn('queue', 'string', [
'default' => null,
'limit' => 32,
'null' => false,
]);
$table->addColumn('data', 'text', [
'default' => null,
'null' => false,
]);
$table->addColumn('priority', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
]);
$table->addColumn('expires_at', 'datetime', [
'default' => null,
'null' => true,
]);
$table->addColumn('delay_until', 'datetime', [
'default' => null,
'null' => true,
]);
$table->addColumn('locked', 'integer', [
'default' => null,
'limit' => 1,
'null' => false,
]);
$table->addIndex([
'queue',
'locked',
], [
'name' => 'is_locked',
'unique' => false,
]);
$table->create();
}
}

0 comments on commit ff7d211

Please sign in to comment.