The error you see occurs because, for several versions now, SQLite has, upon table renames, undertaken to revise references to the renamed table within views. You might have hoped that the rename which is failing, because it cures a view's reference to a non-existent table, would thereby succeed. Apparently, the code lacks that foresight. You can do things in a different order, possibly with an intermediate rename, to get around this. Or, more simply, ``` PRAGMA legacy_alter_table = TRUE; ``` will suspend the check which your rename caused to be failed, as [described here](https://sqlite.org/pragma.html#pragma_legacy_alter_table).