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
33
34
35
36
|
# File 'lib/rails/generators/devape_cms/templates/migration.rb', line 2
def self.up
create_table :categories_posts, :id => false do |t|
t.integer :post_id
t.integer :category_id
t.timestamps
end
create_table :devape_cms_categories do |t|
t.string :title
t.text :description
t.integer :parent_id
t.timestamps
end
create_table :devape_cms_posts do |t|
t.integer :admin_id
t.string :title
t.integer :parent_id
t.string :layout
t.string :template
t.string :cached_slug
t.integer :show_nav
t.timestamps
end
create_table :devape_cms_content do |t|
t.text :content
t.string :title
t.integer :post_id
end
add_index(:categories_posts, :post_id)
add_index(:categories_posts, :category_id)
add_index(:devape_cms_categories, :parent_id)
add_index(:devape_cms_posts, :parent_id)
add_index(:devape_cms_posts, :cached_slug)
add_index(:devape_cms_content, :post_id)
add_index(:devape_cms_content, :title)
end
|