Repository: voxel51/fiftyone

Issue:
[BUG] Can't downgrade after upgrading to FiftyOne v0.7.1
From a fresh virtual environment, I run the following commands:

```shell
# Install v0.7.0
pip install fiftyone==0.7.0

# Create a dataset
fiftyone zoo datasets load quickstart

# Install v0.7.1
pip install fiftyone==0.7.1

# Database is upgraded as expected, `quickstart` appears in dataset list
fiftyone datasets list

# Downgrade to v0.7.0
pip install fiftyone==0.7.0

# Fails with the error below
fiftyone datasets list
```

The issue is that v0.7.1 upgrades MongoDB to v4.4, and the [database migration up to v0.7.1](https://github.com/voxel51/fiftyone/blob/develop/fiftyone/migrations/revisions/admin/v0_7_1.py) sets a feature compatibility version. However, the downgrade migration was introduced in v0.7.1, so it's not there to run when v0.7.0 is installed.

```
2021-01-11T12:31:43.983-0500 I  CONTROL  [main] log file "/Users/Brian/.fiftyone/var/log/mongodb/mongo.log" exists; moved to "/Users/Brian/.fiftyone/var/log/mongodb/mongo.log.2021-01-11T17-31-43".
Subprocess ['/Users/Brian/dev/env/tmp3/lib/python3.6/site-packages/fiftyone/db/bin/mongod', '--dbpath', '/Users/Brian/.fiftyone/var/lib/mongo', '--logpath', '/Users/Brian/.fiftyone/var/log/mongodb/mongo.log', '--port', '0', '--nounixsocket'] exited with error 14:
Uncaught exception
Traceback (most recent call last):
  File "/Users/Brian/dev/env/tmp3/bin/fiftyone", line 5, in <module>
    from fiftyone.core.cli import main
  File "/Users/Brian/dev/env/tmp3/lib/python3.6/site-packages/fiftyone/__init__.py", line 24, in <module>
    from fiftyone.__public__ import *
  File "/Users/Brian/dev/env/tmp3/lib/python3.6/site-packages/fiftyone/__public__.py", line 11, in <module>
    _database_service = fos.DatabaseService()
  File "/Users/Brian/dev/env/tmp3/lib/python3.6/site-packages/fiftyone/core/service.py", line 198, in __init__
    super().__init__()
  File "/Users/Brian/dev/env/tmp3/lib/python3.6/site-packages/fiftyone/core/service.py", line 79, in __init__
    self.start()
  File "/Users/Brian/dev/env/tmp3/lib/python3.6/site-packages/fiftyone/core/service.py", line 283, in start
    food.set_default_port(self.port)
  File "/Users/Brian/dev/env/tmp3/lib/python3.6/site-packages/fiftyone/core/service.py", line 270, in port
    return self._wait_for_child_port()
  File "/Users/Brian/dev/env/tmp3/lib/python3.6/site-packages/fiftyone/core/service.py", line 177, in _wait_for_child_port
    return find_port()
  File "/Users/Brian/dev/env/tmp3/lib/python3.6/site-packages/retrying.py", line 49, in wrapped_f
    return Retrying(*dargs, **dkw).call(f, *args, **kw)
  File "/Users/Brian/dev/env/tmp3/lib/python3.6/site-packages/retrying.py", line 212, in call
    raise attempt.get()
  File "/Users/Brian/dev/env/tmp3/lib/python3.6/site-packages/retrying.py", line 247, in get
    six.reraise(self.value[0], self.value[1], self.value[2])
  File "/Users/Brian/dev/env/tmp3/lib/python3.6/site-packages/six.py", line 703, in reraise
    raise value
  File "/Users/Brian/dev/env/tmp3/lib/python3.6/site-packages/retrying.py", line 200, in call
    attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
  File "/Users/Brian/dev/env/tmp3/lib/python3.6/site-packages/fiftyone/core/service.py", line 175, in find_port
    raise ServiceListenTimeout(etau.get_class_name(self), port)
fiftyone.core.service.ServiceListenTimeout: fiftyone.core.service.DatabaseService failed to bind to port

```


Discussion:

Resolving patch:
diff --git a/package/db/setup.py b/package/db/setup.py
--- a/package/db/setup.py
+++ b/package/db/setup.py
@@ -35,7 +35,7 @@
 LINUX_DISTRO = os.environ.get("FIFTYONE_DB_BUILD_LINUX_DISTRO")
 
 
-VERSION = "0.3.0"
+VERSION = "0.2.1"
 
 
 def get_version():
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -18,11 +18,11 @@ def finalize_options(self):
         # for a development installation
         self.distribution.install_requires += [
             "fiftyone-brain>=0.2,<0.3",
-            "fiftyone-db>=0.3.0,<0.4",
+            "fiftyone-db>=0.2.1,<0.3",
         ]
 
 
-VERSION = "0.7.1.2"
+VERSION = "0.7.1.3"
 
 
 def get_version():


Test patch: