]);
$table->setPrimaryKey(['id']);
$table->addIndex(['class'], 'job_class_index');
- } else {
- $table = $schema->getTable('jobs');
- $table->changeColumn('execution_duration', [
- 'notnull' => true,
- 'default' => 0,
- ]);
}
if (!$schema->hasTable('users')) {
'default' => '',
]);
$table->addColumn('type', 'smallint', [
- 'notnull' => true,
+ 'notnull' => false,
'length' => 2,
'default' => 0,
'unsigned' => true,
]);
$table->addColumn('remember', 'smallint', [
- 'notnull' => true,
+ 'notnull' => false,
'length' => 1,
'default' => 0,
'unsigned' => true,
]);
$table->addColumn('last_activity', 'integer', [
- 'notnull' => true,
+ 'notnull' => false,
'length' => 4,
'default' => 0,
'unsigned' => true,
]);
$table->addColumn('last_check', 'integer', [
- 'notnull' => true,
+ 'notnull' => false,
'length' => 4,
'default' => 0,
'unsigned' => true,
$column->setUnsigned(true);
$column = $table->getColumn('type');
$column->setUnsigned(true);
- $column = $table->getColumn('remember');
- $column->setUnsigned(true);
+ if ($table->hasColumn('remember')) {
+ $column = $table->getColumn('remember');
+ $column->setUnsigned(true);
+ } else {
+ $table->addColumn('remember', 'smallint', [
+ 'notnull' => false,
+ 'length' => 1,
+ 'default' => 0,
+ 'unsigned' => true,
+ ]);
+ }
$column = $table->getColumn('last_activity');
$column->setUnsigned(true);
$column = $table->getColumn('last_check');
if ($loginNameColumn->getLength() !== 255) {
$loginNameColumn->setLength(255);
}
+ $table->changeColumn('type', [
+ 'notnull' => false,
+ ]);
+ $table->changeColumn('remember', [
+ 'notnull' => false,
+ ]);
+ $table->changeColumn('last_activity', [
+ 'notnull' => false,
+ ]);
+ $table->changeColumn('last_check', [
+ 'notnull' => false,
+ ]);
}
if ($schema->hasTable('dav_job_status')) {
}
}
+ if ($schema->hasTable('jobs')) {
+ $table = $schema->getTable('jobs');
+ $table->changeColumn('execution_duration', [
+ 'notnull' => false,
+ 'default' => 0,
+ ]);
+ }
+
return $schema;
}
}