class NonUserDraftingMigration

Public Class Methods

down() click to toggle source
# File lib/generators/drafting/migration/templates/non_user_migration.rb, line 10
def self.down
  remove_column :drafts, :user_type
end
up() click to toggle source
# File lib/generators/drafting/migration/templates/non_user_migration.rb, line 2
def self.up
  add_column :drafts, :user_type, :string, index: true

  # add in user_type for existing drafts table
  # for migration from old version
  Draft.update_all(user_type: 'User')
end