Skip to content

Commit

Permalink
Add Jekyll::WordPress.TABLE_PREFIX and inclusion in QUERY
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Chatelain committed Jan 23, 2011
1 parent 13df722 commit 42f63f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/jekyll/migrators/wordpress.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@

module Jekyll
module WordPress

TABLE_PREFIX = 'wp_xh2g8g_'

# Reads a MySQL database via Sequel and creates a post file for each
# post in wp_posts that has post_status = 'publish'.
# This restriction is made because 'draft' posts are not guaranteed to
# have valid dates.
QUERY = "select post_title, post_name, post_date, post_content, post_excerpt, ID, guid from wp_posts where post_status = 'publish' and post_type = 'post'"
QUERY = "select post_title, post_name, post_date, post_content, post_excerpt, ID, guid from #{TABLE_PREFIX}posts where post_status = 'publish' and post_type = 'post'"

def self.process(dbname, user, pass, host = 'localhost')
db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host, :encoding => 'utf8')
Expand Down

0 comments on commit 42f63f9

Please sign in to comment.