Unknown column 'base_filecomment.uuid_id' in 'where clause'


When I try to open a .md file on seafile server 7.0.4, I got this error :
(but it works with .txt !)

2019-09-11 14:09:25,386 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /api2/repos/a6625f8b-aecd-4635-a61d-06f766ea50e9/file/detail/
Traceback (most recent call last):
  File ".../seafile-server/seahub/thirdpart/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File ".../seafile-server/seahub/thirdpart/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File ".../seafile-server/seahub/thirdpart/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File ".../seafile-server/seahub/thirdpart/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File ".../seafile-server/seahub/thirdpart/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File ".../seafile-server/seahub/thirdpart/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File ".../seafile-server/seahub/seahub/api2/base.py", line 23, in dispatch
    response = super(APIView, self).dispatch(*a, **kw)
  File ".../seafile-server/seahub/thirdpart/rest_framework/views.py", line 466, in dispatch
    response = self.handle_exception(exc)
  File ".../seafile-server/seahub/seahub/api2/base.py", line 20, in handle_exception
    return super(APIView, self).handle_exception(exc)
  File ".../seafile-server/seahub/thirdpart/rest_framework/views.py", line 463, in dispatch
    response = handler(request, *args, **kwargs)
  File ".../seafile-server/seahub/seahub/api2/views.py", line 3191, in get
    comment_total = file_comments.count()
  File ".../seafile-server/seahub/thirdpart/django/db/models/query.py", line 364, in count
    return self.query.get_count(using=self.db)
  File ".../seafile-server/seahub/thirdpart/django/db/models/sql/query.py", line 499, in get_count
    number = obj.get_aggregation(using, ['__count'])['__count']
  File ".../seafile-server/seahub/thirdpart/django/db/models/sql/query.py", line 480, in get_aggregation
    result = compiler.execute_sql(SINGLE)
  File ".../seafile-server/seahub/thirdpart/django/db/models/sql/compiler.py", line 899, in execute_sql
    raise original_exception
OperationalError: (1054, "Unknown column 'base_filecomment.uuid_id' in 'where clause'")


Please check https://download.seafile.com/published/support/server-upgrade/ce-7.0.md

I just fount out I got the same problem but I use sqlite and I just viewed the update script but can’t find something like the constraint with the uuid

I just checked the whole sql folder and didn’t found the uuid column in the table base_filecomment at all for sqlite. Even on the initial sql statement. Also no alter table with uuid.

I still got the same Error with a adjusted sqlite script. But I couldn’t add all die other keys, don’t know if they’re the problem or not. I just found it strange that the error is exactly the same even when the column is present.

This is the script I was using:

CREATE TABLE base_filecomment (
author varchar(255) NOT NULL,
comment text NOT NULL,
created_at datetime NOT NULL,
updated_at datetime NOT NULL,
uuid_id char(32) NOT NULL,
detail text NOT NULL,
resolved tinyint(1) NOT NULL,
CONSTRAINT base_filecomment_uuid_id_4f9a2ca2_fk_tags_fileuuidmap_uuid FOREIGN KEY (uuid_id) REFERENCES tags_fileuuidmap (uuid));