Skip to content
Browse files

changed post ID so it works with mysql and not only with sqlite

  • Loading branch information...
1 parent 1085adb commit 34ddd19ac29c5d637c176ff9b3ea511d5d03d11e @rb2k committed Jun 9, 2009
Showing with 5 additions and 5 deletions.
  1. +5 −5 main.rb
View
10 main.rb
@@ -2,8 +2,8 @@
require "sequel"
puts "Starting Import"
-DB_WP = Sequel.connect('mysql://user:pass@localhost/database_name')
-DB_ENKI = Sequel.connect('sqlite:///path/to/db/file.sqlite3')
+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"
@@ -25,9 +25,9 @@
#Transfering the posts + related comments
puts "Transfering posts and comments"
-comment_counter = 0
+comment_counter = 1
WP_POSTS.all.each_with_index do |row,index|
- post_ID = index
+ post_ID = index + 1
post_original_ID = row[:ID]
post_date = row[:post_date]
post_title = row[:post_title].to_s
@@ -91,7 +91,7 @@
puts "Transfering pages"
WP_PAGES.all.each_with_index do |row, index|
- page_ID = index
+ page_ID = index + 1
page_date = row[:post_date]
page_title = row[:post_title].to_s
page_content = row[:post_content].to_s

0 comments on commit 34ddd19

Please sign in to comment.
Something went wrong with that request. Please try again.