Class: CreateCrawlerEngine

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/templates/migration.rb

Class Method Summary collapse

Class Method Details

.downObject



23
24
25
26
# File 'lib/generators/templates/migration.rb', line 23

def self.down
	drop_table :sources
	drop_table :posts
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/generators/templates/migration.rb', line 2

def self.up
	create_table :sources, :force => true do |t|
		t.string :site_name
		t.string :link
		t.string :filter
		t.string :category
		t.datetime :crawled_at # When to run. Could be Time.now for immediately, or sometime in the future.
	end

	create_table :posts, :force => true do |t|
		t.string :site_name
		t.string :title
		t.string :source
		t.text :content
		t.string :category
		t.integer :speed
		t.integer :support_num
		t.datetime :published_at
	end
end