1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- declare(strict_types=1);
- namespace OC\Core\Migrations;
- use Closure;
- use OCP\DB\ISchemaWrapper;
- use OCP\DB\Types;
- use OCP\Migration\IOutput;
- use OCP\Migration\SimpleMigrationStep;
- class Version17000Date20190514105811 extends SimpleMigrationStep {
-
- public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
-
- $schema = $schemaClosure();
- if (!$schema->hasTable('filecache_extended')) {
- $table = $schema->createTable('filecache_extended');
- $table->addColumn('fileid', Types::BIGINT, [
- 'notnull' => true,
- 'length' => 4,
- 'unsigned' => true,
- ]);
- $table->addColumn('metadata_etag', Types::STRING, [
- 'notnull' => false,
- 'length' => 40,
- ]);
- $table->addColumn('creation_time', Types::BIGINT, [
- 'notnull' => true,
- 'length' => 20,
- 'default' => 0,
- ]);
- $table->addColumn('upload_time', Types::BIGINT, [
- 'notnull' => true,
- 'length' => 20,
- 'default' => 0,
- ]);
- $table->setPrimaryKey(['fileid'], 'fce_pk');
-
- $table->addIndex(['creation_time'], 'fce_ctime_idx');
- $table->addIndex(['upload_time'], 'fce_utime_idx');
- }
- return $schema;
- }
- }
|