Browse files

fixed tag import (was off by 1 --> tags were displayed one post too e…

…arly)
  • Loading branch information...
1 parent 34ddd19 commit 1b3b5a5108a708d9bb4666737e31c05a7e91e809 @rb2k committed Jun 10, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 main.rb
View
4 main.rb
@@ -4,7 +4,7 @@
puts "Starting Import"
DB_WP = Sequel.connect('mysql://user:pass@localhost/wp_database_name')
DB_ENKI = Sequel.connect('mysql://user:pass@localhost/enki_database_name')
-WP_PREFIX = "wp_123abc"
+WP_PREFIX = "wp_123abc" #ususally only 'wp_', some installations change this to make sql injection more difficult
#preparing post import
@@ -81,7 +81,7 @@
#updating count
DB_ENKI[:tags].filter(:name => tag_row[:name]).update(:taggings_count => new_count)
- DB_ENKI[:taggings].insert(:tag_id => my_tag_id, :taggable_id => index)
+ DB_ENKI[:taggings].insert(:tag_id => my_tag_id, :taggable_id => index + 1)
print " (#{new_count}) | "
end
print "\n"

0 comments on commit 1b3b5a5

Please sign in to comment.