ADD COLUMN and DROP COLUMN remove the size of every typed column from the stored schema
ADD COLUMN and DROP COLUMN write the table text in sqlite_master from the parsed form, and the parsed form has no type parameters. VARCHAR(10) becomes VARCHAR and DECIMAL(10,2) becomes DECIMAL for every column of the table. The change is in the file. SQLite reads the types without their sizes afterwards.
CREATE TABLE u(a VARCHAR(10), b DECIMAL(10,2) DEFAULT 1);
ALTER TABLE u ADD COLUMN c VARCHAR(20);
SELECT sql FROM sqlite_master WHERE name = 'u';
-- SQLite: CREATE TABLE u(a VARCHAR(10), b DECIMAL(10,2) DEFAULT 1, c VARCHAR(20))
-- turso: CREATE TABLE u (a VARCHAR, b DECIMAL DEFAULT 1, c VARCHAR)DROP COLUMN does the same. RENAME COLUMN and RENAME TO keep the parameters. Tools that read the declared types (ORMs, schema diff tools) see a different schema after the ALTER.
Related: #5762 (PRAGMA table_info strips the type parameters even before an ALTER).
Found by differential testing of turso dc5fda12 against SQLite 3.53.2 with generated schema changes on the FrankenSQLite harness. Files written by FrankenSQLite's own shell and read by turso showed the pragma_table_info type differences first.
Source: tursodatabase/turso