Replies: 2 comments 2 replies
-
I think a better option here would be that the SQLite batch op feature detects those cases where "add column" requires the batch version of things and then does the right thing automatically. can you add some detail on the sets of circumstances under which SQLite does not allow additions of columns? is it with any kind of server default ? |
Beta Was this translation helpful? Give feedback.
1 reply
-
there is a patch in review at #883. we have a little bit of a delayed timeline for alembic 0.7 though, so you might want to use this patch locally in the interim. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! I want a new option of
batch_alter_table
'srecreate
argument; always use the recreate style on SQLite backend. Here is a use case:The above code raises an error on SQLite, since alembic does not use the recreate style for a batch only having
add_column
s, but SQLite does not support ADD COLUMN with a default value of CURRENT_TIMESTAMP.The option
recreate=always
atbatch_alter_table
can be used for avoiding this error, but then alembic uses recreate style also on other backends. Such a behavior is not desirable in some cases, e.g., using MySQL for the production environment (with a large data) and using SQLite for the development environment (with fewer data).So I think the flag for always using the recreate style on SQLite backend is useful. Or are there any methods which alternates this?
Beta Was this translation helpful? Give feedback.
All reactions