Skip to content

Commit 5d9030b

Browse files
committed
Add DB table to extend filecache with metadata etag, creation time and upload time
Signed-off-by: Morris Jobke <[email protected]>
1 parent bf19431 commit 5d9030b

File tree

2 files changed

+67
-1
lines changed

2 files changed

+67
-1
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?php
2+
declare(strict_types=1);
3+
/**
4+
* @copyright Copyright (c) 2019 Morris Jobke <[email protected]>
5+
*
6+
* @author Morris Jobke <[email protected]>
7+
*
8+
* @license GNU AGPL version 3 or any later version
9+
*
10+
* This program is free software: you can redistribute it and/or modify
11+
* it under the terms of the GNU Affero General Public License as
12+
* published by the Free Software Foundation, either version 3 of the
13+
* License, or (at your option) any later version.
14+
*
15+
* This program is distributed in the hope that it will be useful,
16+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
* GNU Affero General Public License for more details.
19+
*
20+
* You should have received a copy of the GNU Affero General Public License
21+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22+
*
23+
*/
24+
25+
26+
namespace OC\Core\Migrations;
27+
28+
use Closure;
29+
use OCP\DB\ISchemaWrapper;
30+
use OCP\Migration\SimpleMigrationStep;
31+
use OCP\Migration\IOutput;
32+
33+
class Version16000Date20190215125511 extends SimpleMigrationStep {
34+
35+
/**
36+
* @param IOutput $output
37+
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
38+
* @param array $options
39+
* @return ISchemaWrapper
40+
*/
41+
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
42+
/** @var ISchemaWrapper $schema */
43+
$schema = $schemaClosure();
44+
if(!$schema->hasTable('filecache_extended')) {
45+
$table = $schema->createTable('filecache_extended');
46+
$table->addColumn('fileid', 'integer', [
47+
'notnull' => true,
48+
'length' => 4,
49+
'unsigned' => true,
50+
]);
51+
$table->addColumn('metadata_etag', 'string', [
52+
'notnull' => false,
53+
'length' => 40,
54+
]);
55+
$table->addColumn('creation_time', 'datetime', [
56+
'notnull' => false,
57+
]);
58+
$table->addColumn('upload_time', 'datetime', [
59+
'notnull' => false,
60+
]);
61+
$table->addUniqueIndex(['fileid']);
62+
}
63+
64+
return $schema;
65+
}
66+
}

version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
// between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel
3030
// when updating major/minor version number.
3131

32-
$OC_Version = array(16, 0, 0, 0);
32+
$OC_Version = array(16, 0, 0, 1);
3333

3434
// The human readable string
3535
$OC_VersionString = '16.0.0 alpha';

0 commit comments

Comments
 (0)