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
Data too long for column 'crypted_password' with DM admin install #569
Comments
What does your gemfile look like? It's almost as if you are trying to load AR 2.3.8 from the Gemfile directly. |
Sorry, please ignore the separate AR issue. It's not the main issue. Sorry. My fault. The DataMapper issue is real, though. |
@DAddYE I feel like we run into this problem a lot for some reason....why is crypted password only 50 length when I thought we set string default to 255? |
Seems an issue of datamapper if you use |
Really frustrating, can't we set the size explicitly in the migration to alleviate this. I see this reported alot. |
Yep @dkubb any workaround for this big big problem with DM migrations? |
The The limitations in I'm not familiar with padrino's codebase, so if someone could point me towards where the migration is declared or the model is defined I can look into this. |
@dkubb the problem is that we have set: DataMapper.logger = logger
DataMapper::Property::String.length(255)
case Padrino.env
when :development then DataMapper.setup(:default, !DB_DEVELOPMENT!)
when :production then DataMapper.setup(:default, !DB_PRODUCTION!)
when :test then DataMapper.setup(:default, !DB_TEST!)
end When u use the This didn't happen if you perform migration with db:migrate create columns with varchar(50) Also setting in the migration Why? |
@auxbuss can you provide an example of the migration script you're trying to run? Or is it coming from something in padrino? @DAddYE I'm looking into it. The code is supposed to take the options for the type, in this case DataMapper::Property::String and use them as defaults when other options aren't specified. The actual DDL generation uses the same code path as auto-migration, so there's probably a bug in the code that takes the migration script and generates the options for DDL generation. I'll start off by looking at what the migration script passes in and work backwards to find out why the options provided to the DDL generator are invalid. |
This is a clean install. I'm familiar with sinatra, I'm trying padrino for the first time. Hence my repeat steps in my first post. $ padrino-gen project myproject -t shoulda -e haml -c sass -s jquery -d datamapper -a mysql $ cd myproject $ padrino-gen admin $ padrino rake dm:migrate $ padrino rake seed ... |
@dkubb Here's a gist with relevant files (generated model, migration, and database.rb which sets 255 default): https://gist.github.com/1015239 |
@dkubb any suggestion for us? |
@DAddYE I just built a new padrino project using the following steps and was able to see the problem. However I was also able to fix it by specifying
Also, I have a fix in edge dm-migrations that should resolve this problem and make it unnecessary to explicitly specify |
Generte a padrino project. Generate admin. Migration with DataMapper works okay to MySQL, seed fails, as follows:
Last few lines of stack trace:
/usr/lib/ruby/gems/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:114:in
execute_non_query' /usr/lib/ruby/gems/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:114:in
create'/usr/lib/ruby/gems/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:276:in
with_connection' /usr/lib/ruby/gems/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:113:in
create'/usr/lib/ruby/gems/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:85:in
each' /usr/lib/ruby/gems/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:85:in
create'/usr/lib/ruby/gems/1.8/gems/dm-core-1.1.0/lib/dm-core/repository.rb:146:in
create' /usr/lib/ruby/gems/1.8/gems/dm-core-1.1.0/lib/dm-core/resource/state/transient.rb:61:in
create_resource'/usr/lib/ruby/gems/1.8/gems/dm-core-1.1.0/lib/dm-core/resource/state/transient.rb:25:in
commit' /usr/lib/ruby/gems/1.8/gems/dm-core-1.1.0/lib/dm-core/resource.rb:957:in
_persist'Cheers,
Marc
The text was updated successfully, but these errors were encountered: