2020-08-07 01:14:14 +02:00
|
|
|
class CreatePages < ActiveRecord::Migration[4.2]
|
2009-03-25 19:54:04 +01:00
|
|
|
def self.up
|
|
|
|
create_table :pages do |t|
|
|
|
|
t.string :title
|
|
|
|
t.text :body
|
|
|
|
t.string :permalink
|
2009-05-15 13:54:42 +02:00
|
|
|
t.integer :lock_version, :default => 0
|
2009-05-15 17:32:45 +02:00
|
|
|
t.integer :updated_by
|
2009-06-11 23:51:26 +02:00
|
|
|
t.integer :redirect
|
2009-08-12 18:41:25 +02:00
|
|
|
t.integer :parent_id
|
2009-03-25 19:54:04 +01:00
|
|
|
|
|
|
|
t.timestamps
|
|
|
|
end
|
2009-08-15 17:36:13 +02:00
|
|
|
add_index :pages, :title
|
|
|
|
add_index :pages, :permalink
|
2009-05-15 17:32:45 +02:00
|
|
|
Page.create_versioned_table # Automaticly creates pages_versions table
|
2009-03-25 19:54:04 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
|
|
|
drop_table :pages
|
2009-05-15 17:32:45 +02:00
|
|
|
Page.drop_versioned_table
|
2009-03-25 19:54:04 +01:00
|
|
|
end
|
|
|
|
end
|