Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added featured column to pages

  • Loading branch information...
commit 64571ef1680a5bdf729667aca3b0c40e164d44a2 1 parent e961721
@datawrangling authored
View
9 db/migrate/20090621055343_add_featured_to_page.rb
@@ -0,0 +1,9 @@
+class AddFeaturedToPage < ActiveRecord::Migration
+ def self.up
+ add_column :pages, :featured, :boolean, :default => 0
+ end
+
+ def self.down
+ remove_column :pages, :featured
+ end
+end
View
3  db/schema.rb
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20090621034525) do
+ActiveRecord::Schema.define(:version => 20090621055343) do
create_table "companies", :force => true do |t|
t.integer "page_id"
@@ -75,6 +75,7 @@
t.integer "page_latest"
t.integer "total_pageviews"
t.float "monthly_trend"
+ t.boolean "featured", :default => false
end
add_index "pages", ["title"], :name => "pages_title_index"
View
2  lib/scripts/daily_load.sh
@@ -62,6 +62,8 @@ cd /mnt
python /mnt/app/current/lib/scripts/generate_featured_pages.py -d $MAXDATE > /mnt/featured_pages.txt
time mysql -u root trendingtopics_production < /mnt/app/current/lib/sql/load_featured_pages.sql
+time mysql -u root trendingtopics_production -e "update pages p set p.featured = (select 1 from new_featured_pages fp where fp.page_id=p.id);"
+
echo archiving the data to S3
# back up the trendsdb data, this copy will be pulled by the next daily job
time s3cmd --config=/root/.s3cfg put trendsdb.tar.gz s3://$MYBUCKET/archive/trendsdb.tar.gz
Please sign in to comment.
Something went wrong with that request. Please try again.