Skip to content

Commit

Permalink
Fix dbal types
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
  • Loading branch information
ChristophWurst authored and juliusknorr committed Jan 8, 2021
1 parent a2ce0fc commit 5d8d0c7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
38 changes: 19 additions & 19 deletions lib/Migration/Version010000Date20190617184535.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace OCA\Text\Migration;

use Closure;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\SimpleMigrationStep;
use OCP\Migration\IOutput;
Expand Down Expand Up @@ -35,32 +35,32 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt

if (!$schema->hasTable('text_documents')) {
$table = $schema->createTable('text_documents');
$table->addColumn('id', Type::BIGINT, [
$table->addColumn('id', Types::BIGINT, [
'autoincrement' => true,
'notnull' => true,
'unsigned' => true,
]);
$table->addColumn('current_version', Type::BIGINT, [
$table->addColumn('current_version', Types::BIGINT, [
'notnull' => true,
'default' => 0,
'unsigned' => true,
]);
$table->addColumn('last_saved_version', Type::BIGINT, [
$table->addColumn('last_saved_version', Types::BIGINT, [
'notnull' => true,
'default' => 0,
'unsigned' => true,
]);
$table->addColumn('last_saved_version_time', Type::BIGINT, [
$table->addColumn('last_saved_version_time', Types::BIGINT, [
'notnull' => true,
'length' => 20,
'unsigned' => true,
]);
$table->addColumn('last_saved_version_etag', Type::STRING, [
$table->addColumn('last_saved_version_etag', Types::STRING, [
'notnull' => false,
'length' => 64,
'default' => ''
]);
$table->addColumn('base_version_etag', TYPE::STRING, [
$table->addColumn('base_version_etag', Types::STRING, [
'notnull' => false,
'length' => 64,
'default' => ''
Expand All @@ -70,31 +70,31 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt

if (!$schema->hasTable('text_sessions')) {
$table = $schema->createTable('text_sessions');
$table->addColumn('id', Type::BIGINT, [
$table->addColumn('id', Types::BIGINT, [
'autoincrement' => true,
'notnull' => true,
'unsigned' => true,
]);
$table->addColumn('user_id', Type::STRING, [
$table->addColumn('user_id', Types::STRING, [
'notnull' => false,
'length' => 64,
]);
$table->addColumn('guest_name', Type::STRING, [
$table->addColumn('guest_name', Types::STRING, [
'notnull' => false,
'length' => 64,
]);
$table->addColumn('color', Type::STRING, [
$table->addColumn('color', Types::STRING, [
'notnull' => false,
'length' => 7,
]);
$table->addColumn('token', Type::STRING, [
$table->addColumn('token', Types::STRING, [
'notnull' => true,
'length' => 64,
]);
$table->addColumn('document_id', Type::BIGINT, [
$table->addColumn('document_id', Types::BIGINT, [
'notnull' => true,
]);
$table->addColumn('last_contact', Type::BIGINT, [
$table->addColumn('last_contact', Types::BIGINT, [
'notnull' => true,
'length' => 20,
'unsigned' => true,
Expand All @@ -105,23 +105,23 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt

if (!$schema->hasTable('text_steps')) {
$table = $schema->createTable('text_steps');
$table->addColumn('id', Type::BIGINT, [
$table->addColumn('id', Types::BIGINT, [
'autoincrement' => true,
'notnull' => true,
'unsigned' => true,
]);
$table->addColumn('document_id', Type::BIGINT, [
$table->addColumn('document_id', Types::BIGINT, [
'notnull' => true,
'unsigned' => true,
]);
$table->addColumn('session_id', Type::BIGINT, [
$table->addColumn('session_id', Types::BIGINT, [
'notnull' => true,
'unsigned' => true,
]);
$table->addColumn('data', Type::TEXT, [
$table->addColumn('data', Types::TEXT, [
'notnull' => true,
]);
$table->addColumn('version', Type::BIGINT, [
$table->addColumn('version', Types::BIGINT, [
'notnull' => true,
'default' => 0,
'unsigned' => true,
Expand Down
14 changes: 7 additions & 7 deletions lib/Migration/Version030201Date20201116123153.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace OCA\Text\Migration;

use Closure;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use OCP\DB\ISchemaWrapper;
use OCP\IConfig;
use OCP\Migration\IOutput;
Expand All @@ -31,32 +31,32 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
if (!$schema->hasTable('text_documents')) {
// Recreate table from the first migration since we cannot alter the autoincrement on the id column with oracle
$table = $schema->createTable('text_documents');
$table->addColumn('id', Type::BIGINT, [
$table->addColumn('id', Types::BIGINT, [
'notnull' => true,
'unsigned' => true,
]);
$table->addColumn('current_version', Type::BIGINT, [
$table->addColumn('current_version', Types::BIGINT, [
// 'notnull' => true,
'notnull' => false,
'default' => 0,
'unsigned' => true,
]);
$table->addColumn('last_saved_version', Type::BIGINT, [
$table->addColumn('last_saved_version', Types::BIGINT, [
// 'notnull' => true,
'notnull' => false,
'default' => 0,
'unsigned' => true,
]);
$table->addColumn('last_saved_version_time', Type::BIGINT, [
$table->addColumn('last_saved_version_time', Types::BIGINT, [
'length' => 20,
'unsigned' => true,
]);
$table->addColumn('last_saved_version_etag', Type::STRING, [
$table->addColumn('last_saved_version_etag', Types::STRING, [
'notnull' => false,
'length' => 64,
'default' => ''
]);
$table->addColumn('base_version_etag', Type::STRING, [
$table->addColumn('base_version_etag', Types::STRING, [
'notnull' => false,
'length' => 64,
'default' => ''
Expand Down

0 comments on commit 5d8d0c7

Please sign in to comment.