summaryrefslogtreecommitdiff
blob: dbea6ba6e3e769e86649a91dd51dc27737de6069 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class CreateRevisions < ActiveRecord::Migration
  def self.up
    create_table :revisions do |t|
      t.integer :glsa_id
      t.integer :revid
      t.string :title
      t.string :access, :default => "remote"
      t.string :product
      t.string :category
      t.string :severity, :default => "normal"
      t.text :synopsis
      t.text :background
      t.text :description
      t.text :impact
      t.text :workaround
      t.text :resolution
      t.timestamps
    end
    
    add_index :revisions, :glsa_id
    add_index :revisions, :revid
    add_index :revisions, :title    
  end

  def self.down
    remove_index :revisions, :synopsis
    remove_index :revisions, :title
    remove_index :revisions, :revid
    remove_index :revisions, :glsa_id
    drop_table :revisions
  end
end