[1.7.x] Fixed #22844: Duplicate SQL for SQLite FKs