Created
January 15, 2019 08:14
-
-
Save 3014zhangshuo/c87b2bf74cf0765f3a80918805d5ba3f to your computer and use it in GitHub Desktop.
Rails error unkown primary key for table but the id exist
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 AddPrimaryKeyToCollections < ActiveRecord::Migration | |
def change | |
execute "ALTER TABLE collections ADD PRIMARY KEY (id);" | |
end | |
end | |
# https://stackoverflow.com/questions/18056162/getting-unknown-primary-key-for-table-while-the-id-is-there |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment