Browse Source

Merge pull request #25089 from nextcloud/enhancement/ocp-db-types

Add our own db column types via the public API
pull/25093/head
blizzz 5 years ago
committed by GitHub
parent
commit
3447ea4955
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      apps/dav/lib/Migration/Version1005Date20180413093149.php
  2. 2
      apps/dav/lib/Migration/Version1005Date20180530124431.php
  3. 2
      apps/dav/lib/Migration/Version1006Date20180619154313.php
  4. 2
      apps/dav/lib/Migration/Version1006Date20180628111625.php
  5. 2
      apps/dav/lib/Migration/Version1008Date20181030113700.php
  6. 2
      apps/dav/lib/Migration/Version1008Date20181105104826.php
  7. 2
      apps/dav/lib/Migration/Version1008Date20181105110300.php
  8. 2
      apps/dav/lib/Migration/Version1011Date20190725113607.php
  9. 2
      apps/dav/lib/Migration/Version1011Date20190806104428.php
  10. 2
      apps/dav/lib/Migration/Version1012Date20190808122342.php
  11. 2
      apps/federatedfilesharing/lib/Migration/Version1010Date20200630191755.php
  12. 2
      apps/federatedfilesharing/lib/Migration/Version1011Date20201120125158.php
  13. 2
      apps/federation/lib/Migration/Version1010Date20200630191302.php
  14. 2
      apps/files_external/lib/Migration/Version1011Date20200630192246.php
  15. 2
      apps/files_sharing/lib/Migration/Version11300Date20201120141438.php
  16. 2
      apps/files_sharing/lib/Migration/Version21000Date20201223143245.php
  17. 2
      apps/files_trashbin/lib/Migration/Version1010Date20200630192639.php
  18. 2
      apps/settings/lib/Controller/CheckSetupController.php
  19. 2
      apps/user_ldap/lib/Migration/Version1010Date20200630192842.php
  20. 2
      apps/user_status/lib/Migration/Version0001Date20200602134824.php
  21. 2
      apps/workflowengine/lib/Migration/Version2000Date20190808074233.php
  22. 2
      core/Command/Db/ConvertFilecacheBigInt.php
  23. 2
      core/Command/Db/ConvertType.php
  24. 2
      core/Migrations/Version13000Date20170705121758.php
  25. 2
      core/Migrations/Version13000Date20170718121200.php
  26. 2
      core/Migrations/Version14000Date20180710092004.php
  27. 2
      core/Migrations/Version16000Date20190207141427.php
  28. 2
      core/Migrations/Version16000Date20190212081545.php
  29. 2
      core/Migrations/Version16000Date20190428150708.php
  30. 2
      core/Migrations/Version17000Date20190514105811.php
  31. 2
      core/Migrations/Version18000Date20190920085628.php
  32. 2
      core/Migrations/Version18000Date20191014105105.php
  33. 2
      core/Migrations/Version20000Date20201109081918.php
  34. 2
      core/Migrations/Version21000Date20201202095923.php
  35. 1
      lib/composer/composer/autoload_classmap.php
  36. 1
      lib/composer/composer/autoload_static.php
  37. 113
      lib/public/DB/Types.php

2
apps/dav/lib/Migration/Version1005Date20180413093149.php

@ -27,7 +27,7 @@ declare(strict_types=1);
namespace OCA\DAV\Migration;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
apps/dav/lib/Migration/Version1005Date20180530124431.php

@ -27,7 +27,7 @@
namespace OCA\DAV\Migration;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
apps/dav/lib/Migration/Version1006Date20180619154313.php

@ -26,7 +26,7 @@
*/
namespace OCA\DAV\Migration;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
apps/dav/lib/Migration/Version1006Date20180628111625.php

@ -29,7 +29,7 @@ declare(strict_types=1);
namespace OCA\DAV\Migration;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
apps/dav/lib/Migration/Version1008Date20181030113700.php

@ -28,7 +28,7 @@ namespace OCA\DAV\Migration;
use Closure;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
apps/dav/lib/Migration/Version1008Date20181105104826.php

@ -28,7 +28,7 @@ declare(strict_types=1);
namespace OCA\DAV\Migration;
use Closure;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\IDBConnection;
use OCP\Migration\IOutput;

2
apps/dav/lib/Migration/Version1008Date20181105110300.php

@ -28,7 +28,7 @@ declare(strict_types=1);
namespace OCA\DAV\Migration;
use Closure;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\IDBConnection;
use OCP\Migration\IOutput;

2
apps/dav/lib/Migration/Version1011Date20190725113607.php

@ -28,7 +28,7 @@ declare(strict_types=1);
*/
namespace OCA\DAV\Migration;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
apps/dav/lib/Migration/Version1011Date20190806104428.php

@ -29,7 +29,7 @@ declare(strict_types=1);
namespace OCA\DAV\Migration;
use Closure;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
apps/dav/lib/Migration/Version1012Date20190808122342.php

@ -29,7 +29,7 @@ declare(strict_types=1);
namespace OCA\DAV\Migration;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
apps/federatedfilesharing/lib/Migration/Version1010Date20200630191755.php

@ -27,7 +27,7 @@ declare(strict_types=1);
namespace OCA\FederatedFileSharing\Migration;
use Closure;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
apps/federatedfilesharing/lib/Migration/Version1011Date20201120125158.php

@ -27,7 +27,7 @@ namespace OCA\FederatedFileSharing\Migration;
use Closure;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\IDBConnection;
use OCP\Migration\IOutput;

2
apps/federation/lib/Migration/Version1010Date20200630191302.php

@ -27,7 +27,7 @@ declare(strict_types=1);
namespace OCA\Federation\Migration;
use Closure;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
apps/files_external/lib/Migration/Version1011Date20200630192246.php

@ -28,7 +28,7 @@ declare(strict_types=1);
namespace OCA\Files_External\Migration;
use Closure;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
apps/files_sharing/lib/Migration/Version11300Date20201120141438.php

@ -29,7 +29,7 @@ namespace OCA\Files_Sharing\Migration;
use Closure;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\IDBConnection;
use OCP\Migration\IOutput;

2
apps/files_sharing/lib/Migration/Version21000Date20201223143245.php

@ -28,7 +28,7 @@ declare(strict_types=1);
namespace OCA\Files_Sharing\Migration;
use Closure;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
apps/files_trashbin/lib/Migration/Version1010Date20200630192639.php

@ -28,7 +28,7 @@ declare(strict_types=1);
namespace OCA\Files_Trashbin\Migration;
use Closure;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
apps/settings/lib/Controller/CheckSetupController.php

@ -47,7 +47,7 @@ use DirectoryIterator;
use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\TransactionIsolationLevel;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use GuzzleHttp\Exception\ClientException;
use OC;
use OC\AppFramework\Http;

2
apps/user_ldap/lib/Migration/Version1010Date20200630192842.php

@ -27,7 +27,7 @@ declare(strict_types=1);
namespace OCA\User_LDAP\Migration;
use Closure;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
apps/user_status/lib/Migration/Version0001Date20200602134824.php

@ -25,7 +25,7 @@ declare(strict_types=1);
namespace OCA\UserStatus\Migration;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
apps/workflowengine/lib/Migration/Version2000Date20190808074233.php

@ -6,7 +6,7 @@ namespace OCA\WorkflowEngine\Migration;
use Closure;
use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCA\WorkflowEngine\Entity\File;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;

2
core/Command/Db/ConvertFilecacheBigInt.php

@ -33,7 +33,7 @@ namespace OC\Core\Command\Db;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OC\DB\Connection;
use OC\DB\SchemaWrapper;
use Symfony\Component\Console\Command\Command;

2
core/Command/Db/ConvertType.php

@ -36,7 +36,7 @@ namespace OC\Core\Command\Db;
use Doctrine\DBAL\Exception;
use Doctrine\DBAL\Schema\AbstractAsset;
use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OC\DB\Connection;
use OC\DB\ConnectionFactory;
use OC\DB\MigrationService;

2
core/Migrations/Version13000Date20170705121758.php

@ -25,7 +25,7 @@
namespace OC\Core\Migrations;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
core/Migrations/Version13000Date20170718121200.php

@ -30,7 +30,7 @@
namespace OC\Core\Migrations;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\IDBConnection;
use OCP\Migration\IOutput;

2
core/Migrations/Version14000Date20180710092004.php

@ -29,7 +29,7 @@ declare(strict_types=1);
namespace OC\Core\Migrations;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
core/Migrations/Version16000Date20190207141427.php

@ -29,7 +29,7 @@ declare(strict_types=1);
namespace OC\Core\Migrations;
use Closure;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
core/Migrations/Version16000Date20190212081545.php

@ -30,7 +30,7 @@ declare(strict_types=1);
namespace OC\Core\Migrations;
use Closure;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
core/Migrations/Version16000Date20190428150708.php

@ -29,7 +29,7 @@ declare(strict_types=1);
namespace OC\Core\Migrations;
use Closure;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
core/Migrations/Version17000Date20190514105811.php

@ -31,7 +31,7 @@ declare(strict_types=1);
namespace OC\Core\Migrations;
use Closure;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

2
core/Migrations/Version18000Date20190920085628.php

@ -29,7 +29,7 @@ declare(strict_types=1);
namespace OC\Core\Migrations;
use Closure;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\IDBConnection;
use OCP\Migration\IOutput;

2
core/Migrations/Version18000Date20191014105105.php

@ -29,7 +29,7 @@ declare(strict_types=1);
namespace OC\Core\Migrations;
use Closure;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\IDBConnection;
use OCP\Migration\SimpleMigrationStep;

2
core/Migrations/Version20000Date20201109081918.php

@ -28,7 +28,7 @@ declare(strict_types=1);
namespace OC\Core\Migrations;
use Closure;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\IDBConnection;
use OCP\Migration\IOutput;

2
core/Migrations/Version21000Date20201202095923.php

@ -27,7 +27,7 @@ declare(strict_types=1);
namespace OC\Core\Migrations;
use Closure;
use Doctrine\DBAL\Types\Types;
use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

1
lib/composer/composer/autoload_classmap.php

@ -171,6 +171,7 @@ return array(
'OCP\\DB\\QueryBuilder\\IParameter' => $baseDir . '/lib/public/DB/QueryBuilder/IParameter.php',
'OCP\\DB\\QueryBuilder\\IQueryBuilder' => $baseDir . '/lib/public/DB/QueryBuilder/IQueryBuilder.php',
'OCP\\DB\\QueryBuilder\\IQueryFunction' => $baseDir . '/lib/public/DB/QueryBuilder/IQueryFunction.php',
'OCP\\DB\\Types' => $baseDir . '/lib/public/DB/Types.php',
'OCP\\Dashboard\\Exceptions\\DashboardAppNotAvailableException' => $baseDir . '/lib/public/Dashboard/Exceptions/DashboardAppNotAvailableException.php',
'OCP\\Dashboard\\IDashboardManager' => $baseDir . '/lib/public/Dashboard/IDashboardManager.php',
'OCP\\Dashboard\\IDashboardWidget' => $baseDir . '/lib/public/Dashboard/IDashboardWidget.php',

1
lib/composer/composer/autoload_static.php

@ -200,6 +200,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OCP\\DB\\QueryBuilder\\IParameter' => __DIR__ . '/../../..' . '/lib/public/DB/QueryBuilder/IParameter.php',
'OCP\\DB\\QueryBuilder\\IQueryBuilder' => __DIR__ . '/../../..' . '/lib/public/DB/QueryBuilder/IQueryBuilder.php',
'OCP\\DB\\QueryBuilder\\IQueryFunction' => __DIR__ . '/../../..' . '/lib/public/DB/QueryBuilder/IQueryFunction.php',
'OCP\\DB\\Types' => __DIR__ . '/../../..' . '/lib/public/DB/Types.php',
'OCP\\Dashboard\\Exceptions\\DashboardAppNotAvailableException' => __DIR__ . '/../../..' . '/lib/public/Dashboard/Exceptions/DashboardAppNotAvailableException.php',
'OCP\\Dashboard\\IDashboardManager' => __DIR__ . '/../../..' . '/lib/public/Dashboard/IDashboardManager.php',
'OCP\\Dashboard\\IDashboardWidget' => __DIR__ . '/../../..' . '/lib/public/Dashboard/IDashboardWidget.php',

113
lib/public/DB/Types.php

@ -0,0 +1,113 @@
<?php
declare(strict_types=1);
/*
* @copyright 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @author 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace OCP\DB;
/**
* Database types supported by Nextcloud's DBs
*
* Use these constants instead of \Doctrine\DBAL\Types\Type or \Doctrine\DBAL\Types\Types
*
* @since 21.0.0
*/
final class Types {
/**
* @var string
* @since 21.0.0
*/
public const BIGINT = 'bigint';
/**
* @var string
* @since 21.0.0
*/
public const BINARY = 'binary';
/**
* @var string
* @since 21.0.0
*/
public const BLOB = 'blob';
/**
* @var string
* @since 21.0.0
*/
public const BOOLEAN = 'boolean';
/**
* @var string
* @since 21.0.0
*/
public const DATE = 'date';
/**
* @var string
* @since 21.0.0
*/
public const DATETIME = 'datetime';
/**
* @var string
* @since 21.0.0
*/
public const DECIMAL = 'decimal';
/**
* @var string
* @since 21.0.0
*/
public const FLOAT = 'float';
/**
* @var string
* @since 21.0.0
*/
public const INTEGER = 'integer';
/**
* @var string
* @since 21.0.0
*/
public const SMALLINT = 'smallint';
/**
* @var string
* @since 21.0.0
*/
public const STRING = 'string';
/**
* @var string
* @since 21.0.0
*/
public const TEXT = 'text';
/**
* @var string
* @since 21.0.0
*/
public const TIME = 'time';
}
Loading…
Cancel
Save