![]() SQL end end add_column :users, :home_page_url, :string rename_column :users, :email, :email_address end end Copy up do # add a CHECK constraint execute <<- SQLĬHECK (char_length(zipcode) = 5) NO INHERIT string :zipcode end reversible do | dir | dir. Recreate the column exactly when rolling back:Ĭlass ExampleMigration < ActiveRecord :: Migration def change create_table :distributors do | t | t. Provide the original column options too, otherwise Rails can't Remove_column is reversible if you supply the column type as the thirdĪrgument.
0 Comments
Leave a Reply. |