Class: AddHostTags

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
db/migrate/20110204112800_add_host_tags.rb

Class Method Summary collapse

Class Method Details

.downObject



22
23
24
25
# File 'db/migrate/20110204112800_add_host_tags.rb', line 22

def self.down
  drop_table :hosts_tags
  drop_table :tags
end

.upObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'db/migrate/20110204112800_add_host_tags.rb', line 3

def self.up

  create_table :tags do |t|
    t.integer  :user_id
    t.string   :name, :limit => 1024
    t.text     :desc
    t.boolean  :report_summary, :null => false, :default => false
    t.boolean  :report_detail, :null => false, :default => false
    t.boolean  :critical, :null => false, :default => false
    t.timestamps
  end

  create_table :hosts_tags, :id => false do |t|
    t.integer :host_id
    t.integer :tag_id
  end

end