Skip to content

Commit

Permalink
Fix versioning of migrations
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Sep 14, 2017
1 parent d7adb45 commit bf36d30
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
use OCP\Migration\SimpleMigrationStep;
use OCP\Migration\IOutput;

class Version2000001Date20170707093535 extends SimpleMigrationStep {
class Version2000Date20170707093535 extends SimpleMigrationStep {

/**
* @param IOutput $output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
use OCP\Migration\SimpleMigrationStep;
use OCP\Migration\IOutput;

class Version2001002Date20170707115443 extends SimpleMigrationStep {
class Version2001Date20170707115443 extends SimpleMigrationStep {

/** @var IDBConnection */
protected $db;
Expand Down Expand Up @@ -64,11 +64,13 @@ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $op
$schema = $schemaClosure();
$table = $schema->getTable('spreedme_room_participants');

$table->addColumn('participantType', Type::SMALLINT, [
'notnull' => true,
'length' => 6,
'default' => 0,
]);
if (!$table->hasColumn('participantType')) {
$table->addColumn('participantType', Type::SMALLINT, [
'notnull' => true,
'length' => 6,
'default' => 0,
]);
}

return $schema;
}
Expand Down

0 comments on commit bf36d30

Please sign in to comment.