Closed modekano closed 3 years ago
when run
python manage.py migrate
does not migrate tortoise model. after run migrate I get table for ChatGroup only no table for ChatMessage
Tortoise ORM doesn't have its own migration yet, you can try to delete the DB first and recreate
rm db.sqlite3.tortoise
Btw, We are using asyncio for our Chat consumer, to have the full performance benefits of using async I decided to use Tortoise ORM (since Django ORM doesn't support the async yet)
Thanks for your response,
I did remove the db.sqlite3.tortoise
using rm db.sqlite3.tortoise
after run migrate again it does not migrate ChatMessage
it should generate another instance of sqlite3 as in settings configuration
TORTOISE_INIT = {
"db_url": "sqlite://db.sqlite3.tortoise",
"modules" : {
"models": ["chat.tortoise_models"]
}
}
do I am right?
Yes, and It will recreate when you start entering the chat message
It work now, thanks for your kind support regards
Hi,
I am facing this issue as well. I tried deleting the database and ran the runserver command again but still seeing the same issue. Chat doesn't work. Any suggestions?
cursor = self._conn.execute(sql, parameters) sqlite3.OperationalError: no such table: chat_chatmessage Internal Server Error: /chat/history/2/ ..... ..... ..... raise OperationalError(exc) tortoise.exceptions.OperationalError: no such table: chat_chatmessage HTTP GET /chat/history/2/ 500 [0.07, 127.0.0.1:54758]
when run
python manage.py migrate
does not migrate tortoise model. after run migrate I get table for ChatGroup only no table for ChatMessage