The .transform() method can handle most cases, but it does not automatically upgrade indexes, views or triggers associated with the table that is being transformed.
I make heavy use of triggers and consider using sqlite-utils for migrations, so understanding exactly what happens to my triggers is kind of important. Are we talking about cases where, say I rename a column which a trigger relied upon? E.g. in the following example:
CREATE TRIGGER IF NOT EXISTS insert_lang_on_thread_subject AFTER UPDATE OF subject ON thread
WHEN NEW.subject IN (6, 7)
BEGIN
...
END
any changes to the thread table, like, say renaming subject field won't be reflected in this trigger? Is this what the won't upgrade above mean?
IIUC the proposed remedy is to grab the sql code for changes from .transfor_sql() and for this particular example, I guess, add a statement that drops the trigger and creates a new one with correct references to tables and columns?
Could you clarify and expand what the
upgrade
verb in the following statement from Custom transformations with .transform_sql means, please?I make heavy use of triggers and consider using sqlite-utils for migrations, so understanding exactly what happens to my triggers is kind of important. Are we talking about cases where, say I rename a column which a trigger relied upon? E.g. in the following example:
any changes to the
thread
table, like, say renamingsubject
field won't be reflected in this trigger? Is this what the won't upgrade above mean?IIUC the proposed remedy is to grab the sql code for changes from
.transfor_sql()
and for this particular example, I guess, add a statement that drops the trigger and creates a new one with correct references to tables and columns?Thank you