def self.up add_column :posts, :rendering_mode, :string, :default => "plain" end def self.down remove_column :posts, :rendering_mode end ããã§ã¯ãæ°ãããã¼ã¿ã«ã¯ããã©ã«ãå¤ã¯ä¸ãããã¾ãããæ¢åã®ãã¼ã¿ã«å¯¾ãã¦ã¯ããã©ã«ãå¤ãä¸ãããã¨ã¯ã§ãã¾ããããã®å ´åãupdate_allãå©ç¨ãã¦ãä¸è¨ã®ããã«è¨è¿°ããã¨ãä»ã¾ã§ã®ãã¼ã¿ãæ´æ°ãã¦ããã©ã«ãå¤ãä¸ãããã¨ãã§ãã¾ãã def self.up add_column :posts, :rendering_mode, :string, :default => "plain" Post.update_all ["rendering_mode = ?","plain"] end def self.down
{{#tags}}- {{label}}
{{/tags}}