On 18 September 2011 11:13, gato pardo <[email protected]> wrote:
>>
>>
>> > Well you should have, you should have used rails migrations to create
>> > the db, unless this is a legacy database.  Create schema.rb by running
>> > rake db:schema:dump
>> > and post it here, though whether this is anything to do with the
>> > problem is unlikely.
>>
>> Also post model/pack.rb please.
>>
>> Colin
>
>
>>
>> Thanks Colin for your fast answer and your care.
>
>  I just created  schema.rb. Here I send its content:
>
>>
>> --------------------------------------------------------------
>>
>>  ActiveRecord::Schema.define(:version => 20110110162357) do
>>
>>   create_table "packs", :id => false, :force => true do |t|
>>     t.integer "id",                    :null => false
>>     t.string  "nombre", :limit => 40
>>     t.string  "path",   :limit => 250
>>   end
>>
>>   create_table "sessions", :force => true do |t|
>>     t.string   "session_id", :null => false
>>     t.text     "data"
>>     t.datetime "created_at"
>>     t.datetime "updated_at"
>>   end

Notice how the spec for id is different between the two tables, I
suppose that is due to the fact that you are providing your own
nextval for id (there is no spec for it in sessions so rails will
assume the default id column).  I suspect this may be the cause of the
problem.  First I suggest reverting id to a normal id column as you
have for sessions and see if this removes the problem.  If it does
then either don't use the nextval feature or you will have to ask
others whether it is possible to do this and if so whether you are
doing it correctly.  I strongly advise against doing this, life will
be much simpler if you stick to the rails conventions.  Possibly you
can find another way to achieve what you want, maybe by adding another
column for your alternative id.

Colin

-- 
gplus.to/clanlaw

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: 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/rubyonrails-talk?hl=en.

Reply via email to