This project is archived and is in readonly mode.
Changing id column to string "breaks" schema.rb
Reported by Martin Vielsmaier | March 3rd, 2009 @ 08:21 AM | in 3.x
When you change the datatype of your id column with a migration like
change_column :users, :id, :string
your schema.rb will not contain this column:
...
create_table "users", :force => true do |t|
t.string "email"
t.string "pwd_hash"
t.boolean "is_active"
t.datetime "last_activity"
t.string "pwd_salt"
t.string "activation_key"
t.datetime "signup_date"
end
So you will end up with
rake db:migrate
and
rake db:schema:load
creating different schemas.
Same behavior when your create a table with
create_table :objects, :id => false do |t|
t.string :id
end
Comments and changes to this ticket
-
jacob swanner (jswanner) November 24th, 2009 @ 08:38 PM
- Tag changed from activerecord, schema to activerecord, patch, schema
-
Tyler Hunt November 24th, 2009 @ 08:59 PM
- Tag set to activerecord, patch, schema
-
Elliot Winkler November 25th, 2009 @ 02:46 PM
- I'm running into this problem right now. I use schema.rb to create the test db but I end up having to modify it before I do so. Fortunately it doesn't happen that much but it should never have to happen.
-
Gabor Ratky July 19th, 2010 @ 11:36 AM
- Importance changed from to
+1, we're reusing the id space of an external service as our own PK's and it goes beyond 2 ** 31 - 1
-
Santiago Pastorino February 2nd, 2011 @ 04:51 PM
- State changed from new to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino February 2nd, 2011 @ 04:51 PM
- State changed from open to stale
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>