@@ -97,6 +97,14 @@ public function generateChangeScript(Schema $targetSchema) {
9797 return $ script ;
9898 }
9999
100+ public function filterSchemaAsset ($ asset ): bool {
101+ if ($ asset instanceof AbstractAsset) {
102+ $ asset = $ asset ->getName ();
103+ }
104+ $ prefix = $ this ->config ->getSystemValue ('dbtableprefix ' , 'oc_ ' );
105+ return str_starts_with ($ asset , $ prefix );
106+ }
107+
100108 /**
101109 * Create a unique name for the temporary table
102110 *
@@ -108,12 +116,8 @@ protected function generateTemporaryTableName($name) {
108116 }
109117
110118 public function createSchema () {
111- $ prefix = $ this ->config ->getSystemValue ('dbtableprefix ' , 'oc_ ' );
112- $ this ->connection ->getConfiguration ()->setSchemaAssetsFilter (function ($ asset ) use ($ prefix ) {
113- if ($ asset instanceof AbstractAsset) {
114- $ asset = $ asset ->getName ();
115- }
116- return str_starts_with ($ asset , $ prefix );
119+ $ this ->connection ->getConfiguration ()->setSchemaAssetsFilter (function ($ asset ) {
120+ return $ this ->filterSchemaAsset ($ asset );
117121 });
118122 return $ this ->connection ->getSchemaManager ()->createSchema ();
119123 }
@@ -137,12 +141,8 @@ protected function getDiff(Schema $targetSchema, \Doctrine\DBAL\Connection $conn
137141 }
138142 }
139143
140- $ prefix = $ this ->config ->getSystemValue ('dbtableprefix ' , 'oc_ ' );
141- $ this ->connection ->getConfiguration ()->setSchemaAssetsFilter (function ($ asset ) use ($ prefix ) {
142- if ($ asset instanceof AbstractAsset) {
143- $ asset = $ asset ->getName ();
144- }
145- return str_starts_with ($ asset , $ prefix );
144+ $ this ->connection ->getConfiguration ()->setSchemaAssetsFilter (function ($ asset ) {
145+ return $ this ->filterSchemaAsset ($ asset );
146146 });
147147 $ sourceSchema = $ connection ->getSchemaManager ()->createSchema ();
148148
0 commit comments