Make sure the accounts table exists

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2017-08-14 09:52:07 +02:00
parent 073216e827
commit 601f795122
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
2 changed files with 60 additions and 1 deletions

View File

@ -0,0 +1,59 @@
<?php
namespace OC\Core\Migrations;
use Doctrine\DBAL\Schema\Schema;
use OCP\Migration\SimpleMigrationStep;
use OCP\Migration\IOutput;
/**
* Auto-generated migration step: Please modify to your needs!
*/
class Version13000Date20170814074715 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param \Closure $schemaClosure The `\Closure` returns a `Schema`
* @param array $options
* @since 13.0.0
*/
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
}
/**
* @param IOutput $output
* @param \Closure $schemaClosure The `\Closure` returns a `Schema`
* @param array $options
* @return null|Schema
* @since 13.0.0
*/
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
/** @var Schema $schema */
$schema = $schemaClosure();
if (!$schema->hasTable('accounts')) {
$table = $schema->createTable('accounts');
$table->addColumn('uid', 'string', [
'notnull' => true,
'length' => 64,
'default' => '',
]);
$table->addColumn('data', 'text', [
'notnull' => true,
'default' => '',
]);
$table->setPrimaryKey(['uid']);
}
return $schema;
}
/**
* @param IOutput $output
* @param \Closure $schemaClosure The `\Closure` returns a `Schema`
* @param array $options
* @since 13.0.0
*/
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
}
}

View File

@ -26,7 +26,7 @@
// between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel
// when updating major/minor version number.
$OC_Version = array(13, 0, 0, 2);
$OC_Version = array(13, 0, 0, 3);
// The human readable string
$OC_VersionString = '13.0.0 alpha';