24 lines
581 B
Ruby
24 lines
581 B
Ruby
class CreateArticles < ActiveRecord::Migration
|
|
def self.up
|
|
create_table :articles do |t|
|
|
t.string :title, :null => false
|
|
t.string :slug, :null => false
|
|
t.text :content, :null => false
|
|
t.date :date, :null => false
|
|
t.string :status, :default => 'draft'
|
|
t.string :keywords
|
|
t.text :custom_subtemplate
|
|
t.integer :screenshot_id
|
|
|
|
t.timestamps
|
|
t.datetime :deleted_at
|
|
end
|
|
|
|
add_index(:articles, :slug, :unique => true)
|
|
end
|
|
|
|
def self.down
|
|
drop_table :articles
|
|
end
|
|
end
|