Code Duplication    Length = 22-23 lines in 2 locations

include/update.php 2 locations

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