#9048·turso

ALTER TABLE RENAME TO also renames a trigger that has the same name as the table

Author: LeMikaelFCreated Sep 16, 2026Updated Sep 30, 2026
Labelscompatibilityschema changestriggers

A trigger with the same name as the renamed table gets the new table name. SQLite leaves the trigger name as it is.

sql
CREATE TABLE ft(a INTEGER);
CREATE TABLE ts(a INTEGER);
CREATE TRIGGER ts AFTER INSERT ON ft BEGIN SELECT 1; END;
ALTER TABLE ts RENAME TO ts2;
SELECT type, name FROM sqlite_master WHERE type='trigger';  -- SQLite: trigger|ts   turso: trigger|ts2

Found with the FrankenSQLite test crates/fsqlite-core/src/connection.rs (line 168632) at commit d0edcc10 of Dicklesworthstone/frankensqlite, run against turso dc5fda12 with SQLite 3.53.2 as the oracle. Permalink: https://github.com/Dicklesworthstone/frankensqlite/blob/d0edcc10f3ef59b0d62b9a277eb7c8ca57e1c2ad/crates/fsqlite-core/src/connection.rs#L168632