#INSERT INTO CmsBlog (
#  `id` ,  `title`,  `published` ,    `created` ,  `updated` ,  `body` ,    `comments_no`,  `trackbacks_no`,  `extended` ,  
#  `has_extended` ,  `author_id`,  `category_id` ,    `is_draft` ,   in_rss)
#SELECT `id` ,  `title`,  FROM_UNIXTIME(`timestamp`),    FROM_UNIXTIME(`timestamp`),  FROM_UNIXTIME(`timestamp`),  `body` ,
#    `comments`,  `trackbacks`,  `extended` ,    `exflag` ,   4,  `categoryid` ,    `isdraft` ,   1  FROM serendipity.entries;

#INSERT INTO Category (  `id` ,  `title` , `page_text` )
#  SELECT categoryid, category_name, category_description   FROM serendipity.category;
  
  
  #INSERT INTO Category (  `id` ,  `title` , `page_text` )
#  SELECT categoryid, category_name, category_description   FROM serendipity.category;


CREATE TABLE CmsComments SELECT 
	id, entry_id, FROM_UNIXTIME(timestamp) as posted,
	title, author, email, url, ip, body, type, subscribed, wikifile
	FROM serendipity.comments;

	
ALTER TABLE CmsComments change column subscribed subscribed int(2) default 0;
ALTER TABLE CmsComments ADD PRIMARY KEY ( id );
ALTER TABLE CmsComments change column id  id  int(11) NOT NULL AUTO_INCREMENT;


CREATE TABLE CmsRefer SELECT 
	entry_id as id, entry as blog_id, day, count as seen,
	scheme, host,port,path,query, checked, checked_success,
	title
	FROM serendipity.referrers;
	
ALTER TABLE CmsRefer ADD PRIMARY KEY ( id );
ALTER TABLE CmsRefer change column id  id  int(11) NOT NULL AUTO_INCREMENT;


