データベース †エントリー関連のテーブルは*entriesと*commentsの2つ。 commentsのentry_idに*entriesのidを指定することでコメントを付けられる。 でもコメント数は*entriesのcommentsカラムに格納されているのでデータをインポートする際には下記のようなrubyコードなどでupdate文を作って実行する必要がある。 sql = ""
(0..100).each{|i|
sql +=<<EOT
update s9y_entries
set comments = (select count(*) from s9y_comments where entry_id = #{i})
where id = #{i};
EOT
}
|