final/db/migrate/20151204093310_create_categ...

11 lines
231 B
Ruby
Raw Normal View History

2015-12-07 04:43:35 +08:00
class CreateCategories < ActiveRecord::Migration
def change
create_table :categories do |t|
2015-12-09 05:05:24 +08:00
t.string :name
t.integer :articles_count
t.timestamps
2015-12-07 04:43:35 +08:00
end
2015-12-09 05:05:24 +08:00
add_index :categories, :articles_count
2015-12-07 04:43:35 +08:00
end
end