require 'migrate'
class AddUserAndDescriptionToRedaction < ActiveRecord::Migration
- def up
+ def change
add_column :redactions, :user_id, :bigint, :null => false
add_column :redactions, :description_format, :format_enum, :null => false, :default => "markdown"
- add_foreign_key :redactions, [:user_id], :users, [:id]
- end
-
- def down
- remove_foreign_key :redactions, [:user_id], :users, [:id]
-
- remove_column :redactions, :description_format
- remove_column :redactions, :user_id
+ add_foreign_key :redactions, :users, :name => "redactions_user_id_fkey"
end
end