Skip to content

Commit

Permalink
Remove table from database before scraping
Browse files Browse the repository at this point in the history
SqliteMagic creates a unique index at CREATE TABLE time. This means that if the unique index arguments of ScraperWiki.save_sqlite change, we need to create a new table to ensure the db reflects the change. Part of: everypolitician/everypolitician#593
  • Loading branch information
Oliver Denman committed May 9, 2017
1 parent 3240780 commit 2e7a767
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scraper.rb
Expand Up @@ -40,5 +40,5 @@ def scrape_list(url)
end
end

ScraperWiki.sqliteexecute('DELETE FROM data') rescue nil
ScraperWiki.sqliteexecute('DROP TABLE data') rescue nil
scrape_list('http://www.congres.nc/assemblee/les-elus/?panel=5')

0 comments on commit 2e7a767

Please sign in to comment.