--- /dev/null
+class RmComicIdOnStory < ActiveRecord::Migration
+ def up
+ add_column :stories, :author_id, :integer, :null => false, :default => 0
+ Story.all.each do |s|
+ c = Comic.find(s.comic_id)
+ ComicStory.create! :comic_id => s.comic_id, :story_id => s.id,
+ :author_id => c.author_id, :t => s.t
+ s.author_id = c.author_id
+ s.save!
+ end
+ remove_column :stories, :comic_id
+ remove_column :stories, :t
+ end
+
+ def down
+ end
+end