Class: CortexReaver::PageparentsSchema

Inherits:
Sequel::Migration
  • Object
show all
Defined in:
lib/cortex_reaver/migrations/010_pageparents.rb

Instance Method Summary collapse

Instance Method Details

#downObject



3
4
5
6
7
8
9
# File 'lib/cortex_reaver/migrations/010_pageparents.rb', line 3

def down
  alter_table :pages do
    # Can't undo this cleanly yet. Fracking mysql. :/
#       drop_index :page_id
#       drop_column :page_id
  end
end

#upObject



11
12
13
14
15
16
# File 'lib/cortex_reaver/migrations/010_pageparents.rb', line 11

def up
  alter_table :pages do
    add_foreign_key :page_id, :pages, :key => :id
    add_index :page_id
  end
end