-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
:null => false, and MYSQL 5.0.x #10
Comments
Thanks for reporting the issue. I'll try to find some time to look at it (but it may not be easy to reproduce). |
No problem. Let me know if I can help in any way. |
Same here. I'm on MySQL 5.1 but I doubt that MySQL version is the problem. The problem is that the initial state is not set. The way it should work is that the first state should be used as initial state. At least that is what I understand from the documentation. Workaround is to specify the initial state in migration as the default value. |
I don't use MySQL in my recent projects. Any volunteer to check/fix it? |
@Porta , @ostraaten I can't reproduce this. There is one migration with null: false : https://github.com/troessner/transitions_intial_state_bug/blob/master/db/migrate/20120526121122_create_orders.rb In this project the initial state is set:
you can easily see what I mean by:
and then do a Order.new.state I assume this issue has been fixed with unrelated commits. |
I discovered that (though I cannot confirm 100%) that under mysql 5.0.x, if in the migration I set :null => false for the :state field, BUT don't provide a :default value on the migration, transitions doesn't set the initial state for the Model and it fails to be created.
This didn't happened on mysql 5.1.x.
I wrote a test here:
git://github.com/Porta/test_null_without_default.git
In case you'd like to test it.
Let me know if I can do anything else.
The text was updated successfully, but these errors were encountered: