Code Duplication    Length = 9-9 lines in 2 locations

src/database/databasetraits/SchemaTrait.php 2 locations

@@ 203-211 (lines=9) @@
200
201
        $schema_rs = $this->getSchemaByName($schemaname);
202
        /* Only if the owner change */
203
        if ($schema_rs->fields['ownername'] != $owner) {
204
            $sql    = "ALTER SCHEMA \"{$schemaname}\" OWNER TO \"{$owner}\"";
205
            $status = $this->execute($sql);
206
            if ($status != 0) {
207
                $this->rollbackTransaction();
208
209
                return -1;
210
            }
211
        }
212
213
        // Only if the name has changed
214
        if ($name != $schemaname) {
@@ 214-222 (lines=9) @@
211
        }
212
213
        // Only if the name has changed
214
        if ($name != $schemaname) {
215
            $sql    = "ALTER SCHEMA \"{$schemaname}\" RENAME TO \"{$name}\"";
216
            $status = $this->execute($sql);
217
            if ($status != 0) {
218
                $this->rollbackTransaction();
219
220
                return -1;
221
            }
222
        }
223
224
        return $this->endTransaction();
225
    }