RENAME COLUMN incomplete documentation
I believe the RENAME COLUMN documentation is incomplete.
Currently, it reads:
ALTER TABLE RENAME COLUMN
The RENAME COLUMN TO syntax changes the column-name of table table-name into new-column-name. The column name is changed both within the table definition itself and also within all indexes, triggers, and views that reference the column. If the column name change would result in a semantic ambiguity in a trigger or view, then the RENAME COLUMN fails with an error and no changes are applied.
RENAME COLUMN requires version 3.25 or later. This is only clear from reading the Release History for 2018-09-15 (3.25.0).
The doc mentions effects on "indexes, triggers, and views," but nothing about what happens if the renamed column is used as a foreign key.
No one has commented on the documentation issue, so let me specifically ask a question: If I use ALTER TABLE RENAME COLUMN, what effect does it have on any foreign keys that use the old name?
THe documentation says "the column name is changed within the table definition". Foreign key definitions are part of the "table definition". Rather trivial to demonstrate.
sqlite> create table parent (id integer primary key, stuff1 text collate nocase unique); sqlite> create table child (id integer primary key, pid integer not null references parent(id), stuff2); sqlite> alter table parent rename column id to chickadee; sqlite> .schema CREATE TABLE parent (chickadee integer primary key, stuff1 text collate nocase unique); CREATE TABLE child (id integer primary key, pid integer not null references parent(chickadee), stuff2);