File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 29
29
use OCP \BackgroundJob \IJobList ;
30
30
use OCP \BackgroundJob \TimedJob ;
31
31
use OCP \DB \QueryBuilder \IQueryBuilder ;
32
+ use OCP \IConfig ;
32
33
use OCP \IDBConnection ;
33
34
34
35
// Migrate oc_file_metadata.metadata to oc_file_metadata.value.
@@ -40,6 +41,7 @@ public function __construct(
40
41
ITimeFactory $ time ,
41
42
private IDBConnection $ db ,
42
43
private IJobList $ jobList ,
44
+ private IConfig $ config ,
43
45
) {
44
46
parent ::__construct ($ time );
45
47
@@ -48,7 +50,8 @@ public function __construct(
48
50
}
49
51
50
52
protected function run (mixed $ argument ): void {
51
- if (!$ this ->db ->createSchema ()->getTable ('oc_file_metadata ' )->hasColumn ('metadata ' )) {
53
+ $ prefix = $ this ->config ->getSystemValueString ('dbtableprefix ' , 'oc_ ' );
54
+ if (!$ this ->db ->createSchema ()->getTable ($ prefix .'file_metadata ' )->hasColumn ('metadata ' )) {
52
55
return ;
53
56
}
54
57
Original file line number Diff line number Diff line change 24
24
25
25
use OC \Core \BackgroundJobs \MetadataMigrationJob ;
26
26
use OCP \BackgroundJob \IJobList ;
27
+ use OCP \IConfig ;
27
28
use OCP \IDBConnection ;
28
29
use OCP \Migration \IOutput ;
29
30
use OCP \Migration \IRepairStep ;
@@ -32,6 +33,7 @@ class AddMetadataMigrationJob implements IRepairStep {
32
33
public function __construct (
33
34
private IJobList $ jobList ,
34
35
private IDBConnection $ db ,
36
+ private IConfig $ config ,
35
37
) {
36
38
}
37
39
@@ -41,7 +43,9 @@ public function getName() {
41
43
42
44
public function run (IOutput $ output ) {
43
45
$ schema = $ this ->db ->createSchema ();
44
- $ metadataTable = $ schema ->getTable ('oc_file_metadata ' );
46
+
47
+ $ prefix = $ this ->config ->getSystemValueString ('dbtableprefix ' , 'oc_ ' );
48
+ $ metadataTable = $ schema ->getTable ($ prefix .'file_metadata ' );
45
49
46
50
if (!$ metadataTable ->hasColumn ('metadata ' )) {
47
51
return ;
You can’t perform that action at this time.
0 commit comments