Last active
November 5, 2015 11:55
-
-
Save rob-murray/14b6d68c18dec9aa51ca to your computer and use it in GitHub Desktop.
Rails, execute sql to update something in sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
say_with_time "Doing an update" do | |
execute %q{UPDATE somethings SET a_col = 'foo' WHERE other_col IN ('bar', 'foobar')} | |
end | |
# or | |
execute <<-SQL | |
CREATE UNIQUE INDEX foobars_name_lower_idx ON foobars (LOWER(name)); | |
SQL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment