Code Duplication    Length = 22-23 lines in 2 locations

include/update.php 2 locations

@@ 187-208 (lines=22) @@
184
185
    // db migrate version = 3
186
    $newDbVersion = 3;
187
    if ($dbVersion < $newDbVersion) {
188
        echo 'Database migrate to version ' . $newDbVersion . '<br>';
189
190
        // Create table smartobject_customtag
191
        $table = new XoopsModules\Smartobject\DbTable('smartobject_customtag');
192
        if (!$table->exists()) {
193
            $table->setStructure('
194
              `customtagid` int(11) NOT NULL auto_increment,
195
              `name` VARCHAR(255) NOT NULL,
196
              `description` TEXT NOT NULL,
197
              `content` TEXT NOT NULL,
198
              `language` TEXT NOT NULL,
199
              PRIMARY KEY  (`customtagid`)
200
            ');
201
        }
202
203
        if (!$dbupdater->updateTable($table)) {
204
            /**
205
             * @todo trap the errors
206
             */
207
        }
208
    }
209
210
    // db migrate version = 4
211
    $newDbVersion = 4;
@@ 212-234 (lines=23) @@
209
210
    // db migrate version = 4
211
    $newDbVersion = 4;
212
    if ($dbVersion < $newDbVersion) {
213
        echo 'Database migrate to version ' . $newDbVersion . '<br>';
214
215
        // Create table smartobject_currency
216
        $table = new XoopsModules\Smartobject\DbTable('smartobject_currency');
217
        if (!$table->exists()) {
218
            $table->setStructure('
219
              `currencyid` int(11) NOT NULL auto_increment,
220
              `iso4217` VARCHAR(5) NOT NULL,
221
              `name` VARCHAR(255) NOT NULL,
222
              `symbol`  VARCHAR(1) NOT NULL,
223
              `rate` float NOT NULL,
224
              `default_currency` int(1) NOT NULL,
225
              PRIMARY KEY  (`currencyid`)
226
            ');
227
        }
228
229
        if (!$dbupdater->updateTable($table)) {
230
            /**
231
             * @todo trap the errors
232
             */
233
        }
234
    }
235
236
    // db migrate version = 6
237
    $newDbVersion = 6;