On Mar 9, 10:07 pm, hendra kusuma <[email protected]> wrote: > Sorry for not making my self clear > I mean : > DB.create_table :categories do > primary_key :id, :type=>Integer, :auto_increment => true > String :name > end > > gives me error : /usr/lib/ruby/1.8/sequel/adapters/postgres.rb:135:in > `async_exec': PGError ERROR: syntax error at or near "AUTOINCREMENT" > (Sequel::DatabaseError) > > How do I solve this?
primary_key creates an autoincrementing integer column by default, so just: DB.create_table :categories do primary_key :id String :name end Technically, on PostgreSQL it uses a sequence as the default value for the column. Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
