Class: CreateHasEasyMigration

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/has_easy_migration/templates/has_easy_migration.rb

Class Method Summary collapse

Class Method Details

.downObject



13
14
15
# File 'lib/generators/has_easy_migration/templates/has_easy_migration.rb', line 13

def self.down
  drop_table :has_easy_things
end

.upObject



2
3
4
5
6
7
8
9
10
11
# File 'lib/generators/has_easy_migration/templates/has_easy_migration.rb', line 2

def self.up
  create_table :has_easy_things do |t|
    t.string  :model_type, :null => false
    t.integer :model_id, :null => false
    t.string  :context
    t.string  :name, :null => false
    t.string  :value
    t.timestamps
  end
end