anchor.diff:                  )''');
     }
   
  -  void _updateTableServerV1toV4(Batch batch) {
  +  void _updateTableServerV1toV5(Batch batch) {
       batch.execute('ALTER TABLE servers ADD plex_pass INTEGER');
       batch.execute('ALTER TABLE servers ADD date_format TEXT');
       batch.execute('ALTER TABLE servers ADD time_format TEXT');
       batch.execute('ALTER TABLE servers ADD plex_identifier TEXT');
  -  }
  -
  -  void _updateTableServerV2toV4(Batch batch) {
  +    batch.execute('ALTER TABLE servers ADD sort_index INTEGER');
  +  }
  +
  +  void _updateTableServerV2toV5(Batch batch) {
       batch.execute('ALTER TABLE servers ADD date_format TEXT');
       batch.execute('ALTER TABLE servers ADD time_format TEXT');
       batch.execute('ALTER TABLE servers ADD plex_identifier TEXT');
  -  }
  -
  -  void _updateTableServerV3toV4(Batch batch) {
  +    batch.execute('ALTER TABLE servers ADD sort_index INTEGER');
  +  }
  +
  +  void _updateTableServerV3toV5(Batch batch) {
       batch.execute('ALTER TABLE servers ADD plex_identifier TEXT');
  +    batch.execute('ALTER TABLE servers ADD sort_index INTEGER');
  +  }
  +
  +  void _updateTableServerV4toV5(Batch batch) {
  +    batch.execute('ALTER TABLE servers ADD sort_index INTEGER');
  +  }
  +
  +  Future<void> _addInitialIndexValue(Database db, Batch batch) async {
  +    var servers = await db.query('servers');
  +    for (var i = 0; i <= servers.length - 1; i++) {
  +      batch.update(
  +        'servers',
  +        {'sort_index': i},
  +        where: 'id = ?',
  +        whereArgs: [servers[i]['id']],
  +      );
  +    }
     }
   
     addServer(ServerModel server) async {
  
positive.code:     final db = await database;
      var result = await db.update('servers', server.toJson(),
          where: 'id = ?', whereArgs: [server.id]);
  
      return result;
    }
  
negative.code: 
    deleteServer(int id) async {
      final db = await database;
      var batch = db.batch();
  
      int count = Sqflite.firstIntValue(
          await db.rawQuery('SELECT COUNT(*) FROM servers'));
  
      batch.delete('servers', where: 'id = ?', whereArgs: [id]);
  
      if (count > 1) {
        int sortIndex = await db
            .query(
              'servers',
              columns: ['sort_index'],
              where: 'id = ?',
              whereArgs: [id],
            )
            .then((value) => value.first['sort_index']);
  
        for (var i = count - 1; i > sortIndex; i--) {
          batch.update(
            'servers',
            {'sort_index': i - 1},
            where: 'sort_index = ?',
            whereArgs: [i],
          );
        }
      }
      batch.commit();
    }
  
    updateServer(ServerModel server) async {
  