2007-09-27 02:19:14 -04:00
|
|
|
class CreatePages < ActiveRecord::Migration
|
|
|
|
def self.up
|
|
|
|
create_table :pages do |t|
|
|
|
|
t.column :title, :string
|
|
|
|
t.column :redcloth, :text
|
|
|
|
t.column :html, :text
|
|
|
|
t.column :owner_id, :integer
|
|
|
|
t.column :owner_type, :string, :limit => 32
|
|
|
|
t.column :version, :integer
|
2008-02-03 00:50:41 -05:00
|
|
|
t.column :created_at, :timestamp
|
|
|
|
t.column :updated_at, :timestamp
|
2008-01-02 02:58:03 -05:00
|
|
|
t.column :created_by, :integer
|
|
|
|
t.column :updated_by, :integer
|
2007-09-27 02:19:14 -04:00
|
|
|
end
|
2008-02-03 00:50:41 -05:00
|
|
|
add_index :pages, :title
|
2007-09-27 02:19:14 -04:00
|
|
|
add_index :pages, :owner_id
|
2008-02-03 00:50:41 -05:00
|
|
|
add_index :pages, :owner_type
|
2008-01-02 02:58:03 -05:00
|
|
|
add_index :pages, :created_by
|
|
|
|
add_index :pages, :updated_by
|
2007-09-27 02:19:14 -04:00
|
|
|
Page.create_versioned_table
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
|
|
|
drop_table :pages
|
|
|
|
Page.drop_versioned_table
|
|
|
|
end
|
|
|
|
end
|