-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Alter oc_jobs before enabing market app
- Loading branch information
Showing
3 changed files
with
63 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace OC\Migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\DBAL\Types\Type; | ||
use OCP\Migration\ISchemaMigration; | ||
|
||
/** | ||
* DB update for oc_jobs table | ||
* it is intentionally duplicates 20170213215145 and a part of 20170101215145 | ||
* to allow seamless market app installation | ||
*/ | ||
class Version20170101010030 implements ISchemaMigration { | ||
public function changeSchema(Schema $schema, array $options) { | ||
$prefix = $options['tablePrefix']; | ||
if ($schema->hasTable("${prefix}jobs")) { | ||
$jobsTable = $schema->getTable("${prefix}jobs"); | ||
|
||
if (!$jobsTable->hasColumn('last_checked')) { | ||
$jobsTable->addColumn( | ||
'last_checked', | ||
Type::INTEGER, | ||
[ | ||
'default' => 0, | ||
'notnull' => false | ||
] | ||
); | ||
} | ||
|
||
if (!$jobsTable->hasColumn('reserved_at')) { | ||
$jobsTable->addColumn( | ||
'reserved_at', | ||
Type::INTEGER, | ||
[ | ||
'default' => 0, | ||
'notnull' => false | ||
] | ||
); | ||
} | ||
|
||
if (!$jobsTable->hasColumn('execution_duration')) { | ||
$jobsTable->addColumn('execution_duration', Type::INTEGER, [ | ||
'notnull' => true, | ||
'length' => 5, | ||
'default' => -1, | ||
]); | ||
} | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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