R
R
RandomProgrammer2022-02-26 13:10:59
SQLite
RandomProgrammer, 2022-02-26 13:10:59

Migration issue?

I am using sqlite db in my web application. I changed one field in the User class. Now, when I try to migrate, I get the error:

ERROR [flask_migrate] Error: No support for ALTER of constraints in SQLite dialect. Please refer to the batch mode feature which allows for SQLite migrations using a copy-and-move strategy.
. I was looking for this problem, they said to change render_as_batch=True, but this does not help, I did not find other solutions.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Adamos, 2022-02-26
@RandomProgrammer

Since SQLite does not support ALTER ADD CONSTRAINT, there is only one way:
- unload data from a table
- delete a table
- create a new one with the desired key
- load data back
(well, as an option - rename / create / copy data / delete the old one, but the headache is the same same, in fact).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question