Created
May 23, 2016 10:02
-
-
Save amitpatelx/30e64330e9d5ea2c1e17b4f2312f035e to your computer and use it in GitHub Desktop.
Override default primary key Raw - Solution
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 CreateContentUnits < ActiveRecord::Migration | |
def up | |
create_table :content_units, id: false do |t| | |
t.boolean :active, default: false | |
end | |
execute 'ALTER TABLE content_units ADD guoid BIGINT(20) PRIMARY KEY AUTO_INCREMENT FIRST;' | |
end | |
def down | |
drop_table :guoids | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment