lobos icon indicating copy to clipboard operation
lobos copied to clipboard

Add example of adding/removing column to existing table

Open jsyrjala opened this issue 13 years ago • 3 comments

Documentation should have examples of how to alter table add/remove column. Currently that is not too clear.

jsyrjala avatar Jul 20 '12 17:07 jsyrjala

Took me a bit of playing around at first but here is a working example:

(defmigration add-data-to-videos
  (up []
      (alter :add
             (table :videos
                    (int :duration)
                    (double :frame_rate))))
  (down []
        (alter :drop
               (table :videos
                      (column :duration)
                      (column :frame_rate)))))

jjttjj avatar Aug 03 '12 18:08 jjttjj

Agreed. Thanks for your input, it helped get me up and running.

burningion avatar Sep 12 '12 03:09 burningion

Had to google for this. Agree that an example like this in the docs would be helpful.

graue avatar Dec 29 '13 00:12 graue