I would like to rename a column in sqlite. I created two word titles with whitespace for some columns which creates issues later on (e.g. first name
instead of first_name
.
Previously, it seems that this was not possible link. But a release from a few months ago seems to have included the RENAME COLUMN
option link.
This does not seem to work however.
ALTER TABLE tablename RENAME COLUMN first name TO first_name
The query produces the following error message :
near "COLUMN": syntax error: ALTER TABLE tablename RENAME COLUMN
I have including quotation marks for the column name in case whitespace was the issue :
ALTER TABLE tablename RENAME COLUMN "first name" TO "first_name"
But get the same error.
This solution hints that renaming is possible. But only renames tables (which works fine) but not columns.