2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/generators/spree_cms/install/templates/db/migrate/create_posts.rb', line 2
def self.up
create_table :posts do |t|
t.integer :user_id
t.string :title, :null => false, :limit => 128
t.text :body
t.text :body_raw
t.text :excerpt
t.integer :is_active, :default => 0
t.string :permalink, :null => false, :limit => 128
t.datetime :published_at
t.integer :commentable, :default => 0
t.string :meta_keywords
t.string :meta_description
t.timestamps
end
add_index :posts, :published_at, :name => 'posts_published_at_ix'
add_index :posts, :permalink, :name => 'posts_permalink_ix'
add_index :posts, [:is_active,:published_at], :name => 'posts_is_active_published_at_ix'
end
|