Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The migrate_comments command when adding threaded comments is giving an error. #117

Open
hexstr1p opened this issue Feb 12, 2019 · 1 comment

Comments

@hexstr1p
Copy link

When trying to add django-threadedcomments, the documentation states to do this:

INSTALLED_APPS += (
    'threadedcomments',
)

COMMENTS_APP = 'fluent_comments'

and then run

./manage.py migrate
./manage.py migrate_comments

but when ./manage.py migrate_comments is run it gives this error:

Traceback (most recent call last):
  File "/Users/jeanne/Env/phobeus_env/lib/python3.7/site-packages/django/db/backends/utils.py", line 83, in _execute
    return self.cursor.execute(sql)
  File "/Users/jeanne/Env/phobeus_env/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py", line 296, in execute
    return Database.Cursor.execute(self, query)
sqlite3.OperationalError: no such function: TO_CHAR

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/jeanne/Env/phobeus_env/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/Users/jeanne/Env/phobeus_env/lib/python3.7/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/jeanne/Env/phobeus_env/lib/python3.7/site-packages/django/core/management/base.py", line 316, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/jeanne/Env/phobeus_env/lib/python3.7/site-packages/django/core/management/base.py", line 353, in execute
    output = self.handle(*args, **options)
  File "/Users/jeanne/Env/phobeus_env/lib/python3.7/site-packages/threadedcomments/management/commands/migrate_comments.py", line 33, in handle
    cursor.execute(SQL)
  File "/Users/jeanne/Env/phobeus_env/lib/python3.7/site-packages/django/db/backends/utils.py", line 100, in execute
    return super().execute(sql, params)
  File "/Users/jeanne/Env/phobeus_env/lib/python3.7/site-packages/django/db/backends/utils.py", line 68, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/Users/jeanne/Env/phobeus_env/lib/python3.7/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/Users/jeanne/Env/phobeus_env/lib/python3.7/site-packages/django/db/backends/utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
  File "/Users/jeanne/Env/phobeus_env/lib/python3.7/site-packages/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/Users/jeanne/Env/phobeus_env/lib/python3.7/site-packages/django/db/backends/utils.py", line 83, in _execute
    return self.cursor.execute(sql)
  File "/Users/jeanne/Env/phobeus_env/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py", line 296, in execute
    return Database.Cursor.execute(self, query)
django.db.utils.OperationalError: no such function: TO_CHAR
@vdboor
Copy link
Contributor

vdboor commented Sep 25, 2019

Hmm it looks like sqlite isn't supported by the threadedcomments migration.

You only need this when there are existing comments in the database, otherwise, you can skip that command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants