Class: NonUserDraftingMigration
- Inherits:
-
Drafting::MIGRATION_BASE_CLASS
- Object
- Drafting::MIGRATION_BASE_CLASS
- NonUserDraftingMigration
- Defined in:
- lib/generators/drafting/migration/templates/non_user_migration.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
10 11 12 |
# File 'lib/generators/drafting/migration/templates/non_user_migration.rb', line 10 def self.down remove_column :drafts, :user_type end |
.up ⇒ Object
2 3 4 5 6 7 8 |
# 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 |