budu/lobos — Issue #29: Columns are created in funny order when creating a table
Author: jsyrjala
Created: 2012-02-02 22:42:10+00:00
State: open

(defmigration add-event-annotations-table
(up [] (create
(tbl :event_annotations
(refer-to :events)
(varchar :annotation 256))))
(down [] (drop (table :event_annotations))))

Results in this with PostgreSQL:

CREATE TABLE event_annotations (
annotation character varying(256),
event_id integer NOT NULL,
id integer NOT NULL,
created_on timestamp without time zone DEFAULT now(),
updated_on timestamp without time zone
);

Natural order for fields is: id, event_id, annotation, updated_on, created_on.