addcrawlobjects
This commit is contained in:
22
db/migrate/20150330191029_create_crawlobjects.rb
Normal file
22
db/migrate/20150330191029_create_crawlobjects.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
class CreateCrawlobjects < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :crawlobjects do |t|
|
||||
t.string :name
|
||||
t.text :text
|
||||
t.text :raw
|
||||
t.integer :objtype, :index=>true
|
||||
t.string :schematype
|
||||
t.string :crawlurl
|
||||
t.string :url
|
||||
t.timestamp :crawltime
|
||||
t.timestamp :published_at
|
||||
t.references :something, :polymorphic => true
|
||||
t.integer :parent_id, :index => true
|
||||
t.integer :lft, :null => false ,:index =>true
|
||||
t.integer :rgt, :null => false, :index => true
|
||||
t.integer :depth, :null => false, :default => 0
|
||||
t.integer :children_count, :null => false, :default => 0
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
14
db/migrate/20150330205419_add_hash_to_crawlobjects.rb
Normal file
14
db/migrate/20150330205419_add_hash_to_crawlobjects.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class AddHashToCrawlobjects < ActiveRecord::Migration
|
||||
def up
|
||||
change_table :crawlobjects do |t|
|
||||
t.string :objhash, :index=>true
|
||||
t.string :objhash2, :index=>true
|
||||
|
||||
end
|
||||
end
|
||||
def down
|
||||
remove_column :crawlobjects, :objhash
|
||||
remove_column :crawlobjects, :objhash2
|
||||
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user