Class: MoveNotes

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
db/migrate/003_move_notes.rb

Class Method Summary collapse

Class Method Details

.downObject



12
13
14
15
16
17
18
# File 'db/migrate/003_move_notes.rb', line 12

def self.down
  remove_column :notes, :workspace_id
  remove_column :notes, :service_id
  change_table :notes do |t|
    t.integer :host_id, :null => false
  end
end

.upObject



2
3
4
5
6
7
8
9
10
# File 'db/migrate/003_move_notes.rb', line 2

def self.up
  # Remove the host requirement.  We'll add the column back in below.
  remove_column :notes, :host_id
  change_table :notes do |t|
    t.integer :workspace_id, :null => false, :default => 1
    t.integer :service_id
    t.integer :host_id
  end
end