Class: CreateDogs

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/tasks/templates/migrate/050_create_dogs.rb

Class Method Summary collapse

Class Method Details

.downObject



14
15
16
# File 'lib/tasks/templates/migrate/050_create_dogs.rb', line 14

def self.down
  drop_table :dogs
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/tasks/templates/migrate/050_create_dogs.rb', line 2

def self.up
  create_table :dogs do |t|
    t.string :name, :null => false
    t.string :color, :null => true
    t.text :description, :null => true
    t.integer :fleas, :null => true
    t.timestamps
  end

  add_index :dogs, :name
end