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 2929use OCP \BackgroundJob \IJobList ;
3030use OCP \BackgroundJob \TimedJob ;
3131use OCP \DB \QueryBuilder \IQueryBuilder ;
32+ use OCP \IConfig ;
3233use OCP \IDBConnection ;
3334
3435// Migrate oc_file_metadata.metadata to oc_file_metadata.value.
@@ -40,6 +41,7 @@ public function __construct(
4041 ITimeFactory $ time ,
4142 private IDBConnection $ db ,
4243 private IJobList $ jobList ,
44+ private IConfig $ config ,
4345 ) {
4446 parent ::__construct ($ time );
4547
@@ -48,7 +50,8 @@ public function __construct(
4850 }
4951
5052 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 ' )) {
5255 return ;
5356 }
5457
Original file line number Diff line number Diff line change 2424
2525use OC \Core \BackgroundJobs \MetadataMigrationJob ;
2626use OCP \BackgroundJob \IJobList ;
27+ use OCP \IConfig ;
2728use OCP \IDBConnection ;
2829use OCP \Migration \IOutput ;
2930use OCP \Migration \IRepairStep ;
@@ -32,6 +33,7 @@ class AddMetadataMigrationJob implements IRepairStep {
3233 public function __construct (
3334 private IJobList $ jobList ,
3435 private IDBConnection $ db ,
36+ private IConfig $ config ,
3537 ) {
3638 }
3739
@@ -41,7 +43,9 @@ public function getName() {
4143
4244 public function run (IOutput $ output ) {
4345 $ 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 ' );
4549
4650 if (!$ metadataTable ->hasColumn ('metadata ' )) {
4751 return ;
You can’t perform that action at this time.
0 commit comments