Class: CreateBites

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

Instance Method Summary collapse

Instance Method Details

#downObject



11
12
13
# File 'lib/generators/bites/install/templates/create_bites.rb', line 11

def down
  drop_table :bites
end

#upObject



2
3
4
5
6
7
8
9
# File 'lib/generators/bites/install/templates/create_bites.rb', line 2

def up
  create_table :bites do |t|
    t.string :identifier, null: false
    t.text :text, null: false, default: ""
  end

  add_index :bites, :identifier, unique: true
end