Topic: Trivial but time consuming bug in migrations
Hi Guys
Running rails 3.1.3/ postgres 9.1 / pg 12.2
Putting foreign keys in migrations, I got stuck on what kept on looking like good syntax
execute <<-SQL
ALTER TABLE redis_databases
ADD CONSTRAINT fk_redis_databases_release_statuses
FOREIGN KEY (release_status_id)
REFERENCES release_statuses(id)
ON DELETE RESTRICT
SQL
Two spaces after the closing SQL meant that I kept on getting a pg error. Took forever to figure out what the problem was. Hopefully this message will save someone the same heartache.
regards
dukkha