Created
November 2, 2017 17:11
-
-
Save edwardloveall/f87ff848b574b24434c55fb7e95384f9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class AddDirectionToVotes::V20171102095010 < LuckyMigrator::Migration::V1 | |
| def migrate | |
| alter :votes do | |
| add positive : Bool? | |
| end | |
| execute "UPDATE votes SET positive = 'true';" | |
| execute "ALTER TABLE votes ALTER COLUMN positive SET NOT NULL;" | |
| end | |
| def rollback | |
| alter :votes do | |
| remove :positive | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment