the problem of having something like
execute <<-SQL
ALTER TABLE target_table
ADD CONSTRAINT constraint FOREIGN KEY (FK)
REFERENCES some_table (id)
ON UPDATE CASCADE ON DELETE RESTRICT
SQL
on your migration file is that you are now stuck with SQL or the particular flavor of SQL that you are currently using. like you say the proper way of doing it is
add_index :targe_table, :FK
that ways the rails magic would know what flavor of SQL you where using and do the right thing
to do a down you would do
remove_index :targe_table, :FK