On Jun 17, 4:04 am, Artyom Bolshakov <[email protected]> wrote:
> I need 'created_at' timestamp. What wrong with this code?
>
> class CreatePosts < Sequel::Migration
>   def up
>     create_table :posts do
>       plugin :timestamps, :update_on_create => true, :create
> => :created_on
>       primary_key :id
>       String :title
>       Text :body
>     end
>   end
>
>   def down
>     drop_table :posts
>   end
> end

plugin is a Model class method, it has nothing to do with migrations
or the schema generator.  Try this migration instead:

Sequel.migration do
  up do
    create_table :posts do
      primary_key :id
      String :title
      String :body, :text=>true
      DateTime :created_at
      DateTime :updated_at
    end
  end

  down{drop_table :post}
end

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.

Reply via email to