Skip to content
Snippets Groups Projects
Unverified Commit d5c2b982 authored by Joas Schilling's avatar Joas Schilling
Browse files

Fix missing "unsigned" on integer columns

parent 11d2006b
No related branches found
No related tags found
No related merge requests found
...@@ -139,6 +139,13 @@ EOT ...@@ -139,6 +139,13 @@ EOT
EOT EOT
); );
} }
if ($column->getUnsigned()) {
$content .= <<<'EOT'
'unsigned' => true,
EOT;
}
$content .= <<<'EOT' $content .= <<<'EOT'
]); ]);
......
...@@ -29,15 +29,6 @@ use OCP\Migration\IOutput; ...@@ -29,15 +29,6 @@ use OCP\Migration\IOutput;
class Version13000Date20170718121200 extends SimpleMigrationStep { class Version13000Date20170718121200 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 IOutput $output
* @param \Closure $schemaClosure The `\Closure` returns a `Schema` * @param \Closure $schemaClosure The `\Closure` returns a `Schema`
...@@ -416,6 +407,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep { ...@@ -416,6 +407,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
'autoincrement' => true, 'autoincrement' => true,
'notnull' => true, 'notnull' => true,
'length' => 4, 'length' => 4,
'unsigned' => true,
]); ]);
$table->addColumn('class', 'string', [ $table->addColumn('class', 'string', [
'notnull' => true, 'notnull' => true,
...@@ -472,6 +464,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep { ...@@ -472,6 +464,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
'autoincrement' => true, 'autoincrement' => true,
'notnull' => true, 'notnull' => true,
'length' => 4, 'length' => 4,
'unsigned' => true,
]); ]);
$table->addColumn('uid', 'string', [ $table->addColumn('uid', 'string', [
'notnull' => true, 'notnull' => true,
...@@ -499,21 +492,25 @@ class Version13000Date20170718121200 extends SimpleMigrationStep { ...@@ -499,21 +492,25 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
'notnull' => true, 'notnull' => true,
'length' => 2, 'length' => 2,
'default' => 0, 'default' => 0,
'unsigned' => true,
]); ]);
$table->addColumn('remember', 'smallint', [ $table->addColumn('remember', 'smallint', [
'notnull' => true, 'notnull' => true,
'length' => 1, 'length' => 1,
'default' => 0, 'default' => 0,
'unsigned' => true,
]); ]);
$table->addColumn('last_activity', 'integer', [ $table->addColumn('last_activity', 'integer', [
'notnull' => true, 'notnull' => true,
'length' => 4, 'length' => 4,
'default' => 0, 'default' => 0,
'unsigned' => true,
]); ]);
$table->addColumn('last_check', 'integer', [ $table->addColumn('last_check', 'integer', [
'notnull' => true, 'notnull' => true,
'length' => 4, 'length' => 4,
'default' => 0, 'default' => 0,
'unsigned' => true,
]); ]);
$table->addColumn('scope', 'text', [ $table->addColumn('scope', 'text', [
'notnull' => false, 'notnull' => false,
...@@ -529,6 +526,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep { ...@@ -529,6 +526,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
'autoincrement' => true, 'autoincrement' => true,
'notnull' => true, 'notnull' => true,
'length' => 4, 'length' => 4,
'unsigned' => true,
]); ]);
$table->addColumn('action', 'string', [ $table->addColumn('action', 'string', [
'notnull' => true, 'notnull' => true,
...@@ -539,6 +537,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep { ...@@ -539,6 +537,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
'notnull' => true, 'notnull' => true,
'length' => 4, 'length' => 4,
'default' => 0, 'default' => 0,
'unsigned' => true,
]); ]);
$table->addColumn('ip', 'string', [ $table->addColumn('ip', 'string', [
'notnull' => true, 'notnull' => true,
...@@ -566,6 +565,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep { ...@@ -566,6 +565,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
'autoincrement' => true, 'autoincrement' => true,
'notnull' => true, 'notnull' => true,
'length' => 4, 'length' => 4,
'unsigned' => true,
]); ]);
$table->addColumn('uid', 'string', [ $table->addColumn('uid', 'string', [
'notnull' => true, 'notnull' => true,
...@@ -594,11 +594,13 @@ class Version13000Date20170718121200 extends SimpleMigrationStep { ...@@ -594,11 +594,13 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
'notnull' => true, 'notnull' => true,
'length' => 4, 'length' => 4,
'default' => 0, 'default' => 0,
'unsigned' => true,
]); ]);
$table->addColumn('categoryid', 'integer', [ $table->addColumn('categoryid', 'integer', [
'notnull' => true, 'notnull' => true,
'length' => 4, 'length' => 4,
'default' => 0, 'default' => 0,
'unsigned' => true,
]); ]);
$table->addColumn('type', 'string', [ $table->addColumn('type', 'string', [
'notnull' => true, 'notnull' => true,
...@@ -615,6 +617,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep { ...@@ -615,6 +617,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
'autoincrement' => true, 'autoincrement' => true,
'notnull' => true, 'notnull' => true,
'length' => 4, 'length' => 4,
'unsigned' => true,
]); ]);
$table->addColumn('name', 'string', [ $table->addColumn('name', 'string', [
'notnull' => true, 'notnull' => true,
...@@ -651,6 +654,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep { ...@@ -651,6 +654,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
'notnull' => true, 'notnull' => true,
'length' => 4, 'length' => 4,
'default' => 0, 'default' => 0,
'unsigned' => true,
]); ]);
$table->addUniqueIndex(['objecttype', 'objectid', 'systemtagid'], 'mapping'); $table->addUniqueIndex(['objecttype', 'objectid', 'systemtagid'], 'mapping');
} }
...@@ -661,6 +665,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep { ...@@ -661,6 +665,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
'notnull' => true, 'notnull' => true,
'length' => 4, 'length' => 4,
'default' => 0, 'default' => 0,
'unsigned' => true,
]); ]);
$table->addColumn('gid', 'string', [ $table->addColumn('gid', 'string', [
'notnull' => true, 'notnull' => true,
...@@ -674,6 +679,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep { ...@@ -674,6 +679,7 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
'autoincrement' => true, 'autoincrement' => true,
'notnull' => true, 'notnull' => true,
'length' => 4, 'length' => 4,
'unsigned' => true,
]); ]);
$table->addColumn('lock', 'integer', [ $table->addColumn('lock', 'integer', [
'notnull' => true, 'notnull' => true,
...@@ -700,21 +706,25 @@ class Version13000Date20170718121200 extends SimpleMigrationStep { ...@@ -700,21 +706,25 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
'autoincrement' => true, 'autoincrement' => true,
'notnull' => true, 'notnull' => true,
'length' => 4, 'length' => 4,
'unsigned' => true,
]); ]);
$table->addColumn('parent_id', 'integer', [ $table->addColumn('parent_id', 'integer', [
'notnull' => true, 'notnull' => true,
'length' => 4, 'length' => 4,
'default' => 0, 'default' => 0,
'unsigned' => true,
]); ]);
$table->addColumn('topmost_parent_id', 'integer', [ $table->addColumn('topmost_parent_id', 'integer', [
'notnull' => true, 'notnull' => true,
'length' => 4, 'length' => 4,
'default' => 0, 'default' => 0,
'unsigned' => true,
]); ]);
$table->addColumn('children_count', 'integer', [ $table->addColumn('children_count', 'integer', [
'notnull' => true, 'notnull' => true,
'length' => 4, 'length' => 4,
'default' => 0, 'default' => 0,
'unsigned' => true,
]); ]);
$table->addColumn('actor_type', 'string', [ $table->addColumn('actor_type', 'string', [
'notnull' => true, 'notnull' => true,
...@@ -905,12 +915,4 @@ class Version13000Date20170718121200 extends SimpleMigrationStep { ...@@ -905,12 +915,4 @@ class Version13000Date20170718121200 extends SimpleMigrationStep {
return $schema; 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) {
}
} }
<?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 Version13000Date20170919121250 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();
$table = $schema->getTable('jobs');
$column = $table->getColumn('id');
$column->setUnsigned(true);
$table = $schema->getTable('authtoken');
$column = $table->getColumn('id');
$column->setUnsigned(true);
$column = $table->getColumn('type');
$column->setUnsigned(true);
$column = $table->getColumn('remember');
$column->setUnsigned(true);
$column = $table->getColumn('last_activity');
$column->setUnsigned(true);
$column = $table->getColumn('last_check');
$column->setUnsigned(true);
$table = $schema->getTable('bruteforce_attempts');
$column = $table->getColumn('id');
$column->setUnsigned(true);
$column = $table->getColumn('occurred');
$column->setUnsigned(true);
$table = $schema->getTable('comments');
$column = $table->getColumn('id');
$column->setUnsigned(true);
$column = $table->getColumn('parent_id');
$column->setUnsigned(true);
$column = $table->getColumn('topmost_parent_id');
$column->setUnsigned(true);
$column = $table->getColumn('children_count');
$column->setUnsigned(true);
$table = $schema->getTable('file_locks');
$column = $table->getColumn('id');
$column->setUnsigned(true);
$table = $schema->getTable('systemtag');
$column = $table->getColumn('id');
$column->setUnsigned(true);
$table = $schema->getTable('systemtag_object_mapping');
$column = $table->getColumn('systemtagid');
$column->setUnsigned(true);
$table = $schema->getTable('systemtag_group');
$column = $table->getColumn('systemtagid');
$column->setUnsigned(true);
$table = $schema->getTable('vcategory');
$column = $table->getColumn('id');
$column->setUnsigned(true);
$table = $schema->getTable('vcategory_to_object');
$column = $table->getColumn('objid');
$column->setUnsigned(true);
$column = $table->getColumn('categoryid');
$column->setUnsigned(true);
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) {
}
}
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
// between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel // between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel
// when updating major/minor version number. // when updating major/minor version number.
$OC_Version = array(13, 0, 0, 3); $OC_Version = array(13, 0, 0, 4);
// The human readable string // The human readable string
$OC_VersionString = '13.0.0 alpha'; $OC_VersionString = '13.0.0 alpha';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment