Class: CreateCommands

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/db/migrate/010_create_commands.rb

Class Method Summary collapse

Class Method Details

.downObject



18
19
20
# File 'lib/db/migrate/010_create_commands.rb', line 18

def self.down
  drop_table :commands
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/db/migrate/010_create_commands.rb', line 2

def self.up
  create_table "commands", force: :cascade do |t|
    t.string  "name",         limit: 25, null: false
    t.text    "description"
    t.integer "bus_id",           limit: 4,  null: false
    t.integer "chip_id",  limit: 4,  null: false
  end

  add_index "commands", ["bus_id"], name: "index_commands_on_bus_id", using: :btree
  add_index "commands", ["chip_id"], name: "index_commands_on_chip_id", using: :btree

  add_foreign_key "commands", "buses"
  add_foreign_key "commands", "chips"

end